Commit 38946a3

mokhan <mokhan@ce5e1baf-6525-42e4-a1b2-857ea38da20a>
2009-04-15 14:10:11
git-svn-id: https://svn.xp-dev.com/svn/mokhan-mo.money@157 ce5e1baf-6525-42e4-a1b2-857ea38da20a
1 parent c139429
trunk/product/MyMoney/Presentation/Presenters/Shell/GettingStartedPresenter.cs
@@ -15,7 +15,7 @@ namespace MoMoney.Presentation.Presenters.Shell
 
         public override void run()
         {
-            view.display();
+            view.attach_to(this);
         }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Presenters/Shell/GettingStartedPresenterSpecs.cs
@@ -17,13 +17,13 @@ namespace MoMoney.Presentation.Presenters.Shell
                                 broker = the_dependency<IEventAggregator>();
                             };
 
-            protected static IEventAggregator broker;
-            protected static IGettingStartedView view;
+            static protected IEventAggregator broker;
+            static protected IGettingStartedView view;
         }
 
         public class when_a_new_project_is_opened : behaves_like_the_getting_started_presenter
         {
-            it should_display_the_getting_started_screen = () => view.was_told_to(x => x.display());
+            it should_display_the_getting_started_screen = () => view.was_told_to(x => x.attach_to(sut));
 
             because b = () => sut.run();
         }
trunk/product/MyMoney/Presentation/Views/Shell/ApplicationShell.Designer.cs
@@ -43,8 +43,7 @@ namespace MoMoney.Presentation.Views.Shell {
             this.ux_main_menu_strip.Font = new System.Drawing.Font("Segoe UI", 8.25F);
             this.ux_main_menu_strip.Location = new System.Drawing.Point(0, 0);
             this.ux_main_menu_strip.Name = "ux_main_menu_strip";
-            this.ux_main_menu_strip.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2);
-            this.ux_main_menu_strip.Size = new System.Drawing.Size(1008, 24);
+            this.ux_main_menu_strip.Size = new System.Drawing.Size(756, 24);
             this.ux_main_menu_strip.TabIndex = 0;
             this.ux_main_menu_strip.Text = "menuStrip1";
             // 
@@ -53,42 +52,42 @@ namespace MoMoney.Presentation.Views.Shell {
             this.ux_status_bar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.status_bar_label,
             this.status_bar_progress_bar});
-            this.ux_status_bar.Location = new System.Drawing.Point(0, 599);
+            this.ux_status_bar.Location = new System.Drawing.Point(0, 485);
             this.ux_status_bar.Name = "ux_status_bar";
-            this.ux_status_bar.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0);
             this.ux_status_bar.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
-            this.ux_status_bar.Size = new System.Drawing.Size(1008, 25);
+            this.ux_status_bar.Size = new System.Drawing.Size(756, 22);
             this.ux_status_bar.TabIndex = 2;
             this.ux_status_bar.Text = "statusStrip1";
             // 
             // status_bar_label
             // 
             this.status_bar_label.Name = "status_bar_label";
-            this.status_bar_label.Size = new System.Drawing.Size(18, 20);
+            this.status_bar_label.Size = new System.Drawing.Size(19, 17);
             this.status_bar_label.Text = "...";
             // 
             // status_bar_progress_bar
             // 
             this.status_bar_progress_bar.Name = "status_bar_progress_bar";
-            this.status_bar_progress_bar.Size = new System.Drawing.Size(100, 19);
+            this.status_bar_progress_bar.Size = new System.Drawing.Size(75, 16);
             // 
             // ux_dock_panel
             // 
             this.ux_dock_panel.ActiveAutoHideContent = null;
+            this.ux_dock_panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                        | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
             this.ux_dock_panel.BackColor = System.Drawing.Color.White;
             this.ux_dock_panel.CausesValidation = false;
-            this.ux_dock_panel.Dock = System.Windows.Forms.DockStyle.Fill;
             this.ux_dock_panel.DockBackColor = System.Drawing.Color.Transparent;
             this.ux_dock_panel.DockBottomPortion = 150;
             this.ux_dock_panel.DockLeftPortion = 200;
             this.ux_dock_panel.DockRightPortion = 200;
             this.ux_dock_panel.DockTopPortion = 150;
             this.ux_dock_panel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(0)));
-            this.ux_dock_panel.Location = new System.Drawing.Point(0, 24);
-            this.ux_dock_panel.Margin = new System.Windows.Forms.Padding(4);
+            this.ux_dock_panel.Location = new System.Drawing.Point(0, 52);
             this.ux_dock_panel.Name = "ux_dock_panel";
             this.ux_dock_panel.RightToLeftLayout = true;
-            this.ux_dock_panel.Size = new System.Drawing.Size(1008, 575);
+            this.ux_dock_panel.Size = new System.Drawing.Size(756, 435);
             this.ux_dock_panel.TabIndex = 3;
             // 
             // ux_tool_bar_strip
@@ -96,7 +95,7 @@ namespace MoMoney.Presentation.Views.Shell {
             this.ux_tool_bar_strip.Font = new System.Drawing.Font("Segoe UI", 8.25F);
             this.ux_tool_bar_strip.Location = new System.Drawing.Point(0, 24);
             this.ux_tool_bar_strip.Name = "ux_tool_bar_strip";
-            this.ux_tool_bar_strip.Size = new System.Drawing.Size(1008, 25);
+            this.ux_tool_bar_strip.Size = new System.Drawing.Size(756, 25);
             this.ux_tool_bar_strip.TabIndex = 6;
             this.ux_tool_bar_strip.Text = "toolStrip1";
             // 
@@ -110,9 +109,9 @@ namespace MoMoney.Presentation.Views.Shell {
             // 
             // ApplicationShell
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1008, 624);
+            this.ClientSize = new System.Drawing.Size(756, 507);
             this.Controls.Add(this.ux_tool_bar_strip);
             this.Controls.Add(this.ux_dock_panel);
             this.Controls.Add(this.ux_status_bar);
@@ -120,7 +119,7 @@ namespace MoMoney.Presentation.Views.Shell {
             this.HelpButton = true;
             this.IsMdiContainer = true;
             this.MainMenuStrip = this.ux_main_menu_strip;
-            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
             this.Name = "ApplicationShell";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "MoMoney";
trunk/product/MyMoney/Presentation/Views/Shell/button_extensions.cs
@@ -31,16 +31,39 @@ namespace MoMoney.Presentation.Views.Shell
 
         public static Control with_tool_tip(this Control control, string title, string caption)
         {
-            new ToolTip
-                {
-                    IsBalloon = true,
-                    ToolTipTitle = title,
-                    ToolTipIcon = ToolTipIcon.Info,
-                    UseAnimation = true,
-                    UseFading = true,
-                    AutoPopDelay = 10000,
-                }.SetToolTip(control, caption);
+            var tip = new ToolTip
+                          {
+                              IsBalloon = true,
+                              ToolTipTitle = title,
+                              ToolTipIcon = ToolTipIcon.Info,
+                              UseAnimation = true,
+                              UseFading = true,
+                              AutoPopDelay = 10000,
+                          };
+            tip.SetToolTip(control, caption);
+            control.Controls.Add(adapt(tip));
             return control;
         }
+
+        static Control adapt(IDisposable item)
+        {
+            return new ControlAdapter(item);
+        }
+
+        class ControlAdapter : Control
+        {
+            readonly IDisposable item;
+
+            public ControlAdapter(IDisposable item)
+            {
+                this.item = item;
+            }
+
+            protected override void Dispose(bool disposing)
+            {
+                if (disposing) item.Dispose();
+                base.Dispose(disposing);
+            }
+        }
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Shell/IGettingStartedView.cs
@@ -1,9 +1,10 @@
+using MoMoney.Presentation.Presenters.Shell;
 using MoMoney.Presentation.Views.core;
 
 namespace MoMoney.Presentation.Views.Shell
 {
-    public interface IGettingStartedView : IDockedContentView
+    public interface IGettingStartedView : IDockedContentView,
+                                           IView<IGettingStartedPresenter>
     {
-        void display();
     }
 }
\ No newline at end of file
trunk/product/MyMoney/Presentation/Views/Shell/WelcomeScreen.cs
@@ -1,4 +1,5 @@
 using MoMoney.Presentation.Model.Menu.File.Commands;
+using MoMoney.Presentation.Presenters.Shell;
 using MoMoney.Presentation.Resources;
 using MoMoney.Presentation.Views.core;
 
@@ -10,10 +11,7 @@ namespace MoMoney.Presentation.Views.Shell
         {
             InitializeComponent();
             titled("Getting Started");
-        }
 
-        public void display()
-        {
             ux_open_existing_file_button.will_be_shown_as(ApplicationImages.OpenExistingFile)
                 .when_hovered_over_will_show(ApplicationImages.OpenExistingFileSelected)
                 .will_execute<IOpenCommand>(() => true)
@@ -24,5 +22,9 @@ namespace MoMoney.Presentation.Views.Shell
                 .will_execute<INewCommand>(() => true)
                 .with_tool_tip("Create New File", "Create a new project.");
         }
+
+        public void attach_to(IGettingStartedPresenter presenter)
+        {
+        }
     }
 }
\ No newline at end of file