Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2268 for trunk


Ignore:
Timestamp:
08/10/09 11:11:16 (15 years ago)
Author:
mkommend
Message:

added SingleDocumentMainForm
reenabled designer support for MainForms (ticket #716)

Location:
trunk/sources
Files:
2 added
10 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLab.MainForm.Test-3.2.csproj

    r2256 r2268  
    8787    <Compile Include="ButtonItems\SaveToolStripButtonItem.cs" />
    8888    <Compile Include="ButtonItems\OpenToolStripButtonItem.cs" />
     89    <Compile Include="HeuristicLabSingleDocumentMainFormTestApplication.cs" />
    8990    <Compile Include="HeuristicLabMultipleDocumentMainFormTestApplication.cs" />
    9091    <Compile Include="EditorView.cs">
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLabSingleDocumentMainFormTestApplication.cs

    r2266 r2268  
    2828
    2929namespace HeuristicLab.MainForm.Test {
    30   [ClassInfo(Name = "MultipleDocumentMainForm Test", Description="Test application for new mainform development.")]
    31   public class HeuristicLabMultipleDocumentMainFormTestApplication : ApplicationBase {
     30  [ClassInfo(Name = "SingleDocumentMainForm Test", Description="Test application for new mainform development.")]
     31  public class HeuristicLabSingleDocumentMainFormTestApplication : ApplicationBase {
    3232    public override void Run() {
    33       MultipleDocumentMainForm mainForm = new MultipleDocumentMainForm(typeof(ITestUserInterfaceItemProvider));
     33      SingleDocumentMainForm mainForm = new SingleDocumentMainForm(typeof(ITestUserInterfaceItemProvider));
    3434      mainForm.Title = "Test new MAINFORM concept";
    3535      Application.Run(mainForm);
  • trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.Designer.cs

    r2233 r2268  
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       this.components = new System.ComponentModel.Container();
     26      WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin();
     27      WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin();
     28      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     29      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient1 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     30      WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin();
     31      WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient();
     32      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient2 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     33      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     34      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient3 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     35      WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
     36      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient4 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     37      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient5 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     38      WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient();
     39      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient6 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     40      WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient7 = new WeifenLuo.WinFormsUI.Docking.TabGradient();
     41      this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
     42      this.SuspendLayout();
     43      //
     44      // dockPanel
     45      //
     46      this.dockPanel.ActiveAutoHideContent = null;
     47      this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     48      this.dockPanel.DockBackColor = System.Drawing.SystemColors.Control;
     49      this.dockPanel.Location = new System.Drawing.Point(0, 49);
     50      this.dockPanel.Name = "dockPanel";
     51      this.dockPanel.Size = new System.Drawing.Size(624, 341);
     52      dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
     53      dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
     54      autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
     55      tabGradient1.EndColor = System.Drawing.SystemColors.Control;
     56      tabGradient1.StartColor = System.Drawing.SystemColors.Control;
     57      tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark;
     58      autoHideStripSkin1.TabGradient = tabGradient1;
     59      dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;
     60      tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight;
     61      tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight;
     62      tabGradient2.TextColor = System.Drawing.SystemColors.ControlText;
     63      dockPaneStripGradient1.ActiveTabGradient = tabGradient2;
     64      dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control;
     65      dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control;
     66      dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;
     67      tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
     68      tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
     69      tabGradient3.TextColor = System.Drawing.SystemColors.ControlText;
     70      dockPaneStripGradient1.InactiveTabGradient = tabGradient3;
     71      dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;
     72      tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption;
     73      tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
     74      tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
     75      tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
     76      dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;
     77      tabGradient5.EndColor = System.Drawing.SystemColors.Control;
     78      tabGradient5.StartColor = System.Drawing.SystemColors.Control;
     79      tabGradient5.TextColor = System.Drawing.SystemColors.ControlText;
     80      dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;
     81      dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
     82      dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
     83      dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;
     84      tabGradient6.EndColor = System.Drawing.SystemColors.GradientInactiveCaption;
     85      tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
     86      tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
     87      tabGradient6.TextColor = System.Drawing.SystemColors.ControlText;
     88      dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
     89      tabGradient7.EndColor = System.Drawing.Color.Transparent;
     90      tabGradient7.StartColor = System.Drawing.Color.Transparent;
     91      tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark;
     92      dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;
     93      dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;
     94      dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;
     95      this.dockPanel.Skin = dockPanelSkin1;
     96      this.dockPanel.TabIndex = 3;
     97      //
     98      // DockingMainForm
     99      //
     100      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    27101      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     102      this.ClientSize = new System.Drawing.Size(624, 412);
     103      this.Controls.Add(this.dockPanel);
     104      this.IsMdiContainer = true;
     105      this.Name = "DockingMainForm";
     106      this.Controls.SetChildIndex(this.dockPanel, 0);
     107      this.ResumeLayout(false);
     108      this.PerformLayout();
     109
    28110    }
    29111
    30112    #endregion
     113
     114    private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel;
    31115  }
    32116}
  • trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs

    r2266 r2268  
    3232namespace HeuristicLab.MainForm {
    3333  public partial class DockingMainForm : MainFormBase {
     34    public DockingMainForm()
     35      : base() {
     36      InitializeComponent();
     37    }
     38
    3439    public DockingMainForm(Type userInterfaceItemType)
    3540      : base(userInterfaceItemType) {
    3641      InitializeComponent();
    37       dockPanel = new DockPanel();
    38       InitializeDockPanel();
    39       this.IsMdiContainer = true;
    40       this.Controls.Add(dockPanel);
    41       this.Controls.SetChildIndex(dockPanel, 0);
    4242    }
    4343
    44     private DockPanel dockPanel;
    45 
    46     public override void ShowView(IView view) {     
     44    public override void ShowView(IView view) {
    4745      if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
    4846      else {
     
    7472      base.StatusStripText = ((DockForm)sender).View.Caption;
    7573    }
    76 
    77     private void InitializeDockPanel() {
    78       DockPanelSkin dockPanelSkin1 = new DockPanelSkin();
    79       AutoHideStripSkin autoHideStripSkin1 = new AutoHideStripSkin();
    80       DockPanelGradient dockPanelGradient1 = new DockPanelGradient();
    81       TabGradient tabGradient1 = new TabGradient();
    82       DockPaneStripSkin dockPaneStripSkin1 = new DockPaneStripSkin();
    83       DockPaneStripGradient dockPaneStripGradient1 = new DockPaneStripGradient();
    84       TabGradient tabGradient2 = new TabGradient();
    85       DockPanelGradient dockPanelGradient2 = new DockPanelGradient();
    86       TabGradient tabGradient3 = new TabGradient();
    87       DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new DockPaneStripToolWindowGradient();
    88       TabGradient tabGradient4 = new TabGradient();
    89       TabGradient tabGradient5 = new TabGradient();
    90       DockPanelGradient dockPanelGradient3 = new DockPanelGradient();
    91       TabGradient tabGradient6 = new TabGradient();
    92       TabGradient tabGradient7 = new TabGradient();
    93 
    94       this.dockPanel.ActiveAutoHideContent = null;
    95       this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
    96       this.dockPanel.DockBackColor = SystemColors.Control;
    97       this.dockPanel.DockBottomPortion = 0.33;
    98       this.dockPanel.DockLeftPortion = 0.33;
    99       this.dockPanel.DockRightPortion = 0.33;
    100       this.dockPanel.DockTopPortion = 0.33;
    101       this.dockPanel.Location = new Point(0, 49);
    102       this.dockPanel.Name = "dockPanel";
    103       this.dockPanel.RightToLeftLayout = true;
    104       dockPanelGradient1.EndColor = SystemColors.ControlLight;
    105       dockPanelGradient1.StartColor = SystemColors.ControlLight;
    106       autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
    107       tabGradient1.EndColor = SystemColors.Control;
    108       tabGradient1.StartColor = SystemColors.Control;
    109       tabGradient1.TextColor = SystemColors.ControlDarkDark;
    110       autoHideStripSkin1.TabGradient = tabGradient1;
    111       dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;
    112       tabGradient2.EndColor = SystemColors.ControlLightLight;
    113       tabGradient2.StartColor = SystemColors.ControlLightLight;
    114       tabGradient2.TextColor = SystemColors.ControlText;
    115       dockPaneStripGradient1.ActiveTabGradient = tabGradient2;
    116       dockPanelGradient2.EndColor = SystemColors.Control;
    117       dockPanelGradient2.StartColor = SystemColors.Control;
    118       dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;
    119       tabGradient3.EndColor = SystemColors.ControlLight;
    120       tabGradient3.StartColor = SystemColors.ControlLight;
    121       tabGradient3.TextColor = SystemColors.ControlText;
    122       dockPaneStripGradient1.InactiveTabGradient = tabGradient3;
    123       dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;
    124       tabGradient4.EndColor = SystemColors.ActiveCaption;
    125       tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
    126       tabGradient4.StartColor = SystemColors.GradientActiveCaption;
    127       tabGradient4.TextColor = SystemColors.ActiveCaptionText;
    128       dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;
    129       tabGradient5.EndColor = SystemColors.Control;
    130       tabGradient5.StartColor = SystemColors.Control;
    131       tabGradient5.TextColor = SystemColors.ControlText;
    132       dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;
    133       dockPanelGradient3.EndColor = SystemColors.ControlLight;
    134       dockPanelGradient3.StartColor = SystemColors.ControlLight;
    135       dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;
    136       tabGradient6.EndColor = SystemColors.GradientInactiveCaption;
    137       tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
    138       tabGradient6.StartColor = SystemColors.GradientInactiveCaption;
    139       tabGradient6.TextColor = SystemColors.ControlText;
    140       dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
    141       tabGradient7.EndColor = Color.Transparent;
    142       tabGradient7.StartColor = Color.Transparent;
    143       tabGradient7.TextColor = SystemColors.ControlDarkDark;
    144       dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;
    145       dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;
    146       dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;
    147       this.dockPanel.Skin = dockPanelSkin1;
    148       this.dockPanel.TabIndex = 2;
    149     }
    15074  }
    15175}
  • trunk/sources/HeuristicLab.MainForm/3.2/HeuristicLab.MainForm-3.2.csproj

    r2256 r2268  
    8282  </ItemGroup>
    8383  <ItemGroup>
     84    <Compile Include="SingleDocumentMainForm.cs">
     85      <SubType>Form</SubType>
     86    </Compile>
     87    <Compile Include="SingleDocumentMainForm.Designer.cs">
     88      <DependentUpon>SingleDocumentMainForm.cs</DependentUpon>
     89    </Compile>
    8490    <Compile Include="Interfaces\IUserInterfaceItem.cs" />
    8591    <Compile Include="MultipleDocumentMainForm.cs">
     
    147153  </ItemGroup>
    148154  <ItemGroup>
     155    <EmbeddedResource Include="SingleDocumentMainForm.resx">
     156      <DependentUpon>SingleDocumentMainForm.cs</DependentUpon>
     157    </EmbeddedResource>
     158    <EmbeddedResource Include="DockingMainForm.resx">
     159      <DependentUpon>DockingMainForm.cs</DependentUpon>
     160    </EmbeddedResource>
    149161    <EmbeddedResource Include="MainFormBase.resx">
    150162      <DependentUpon>MainFormBase.cs</DependentUpon>
  • trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.Designer.cs

    r2233 r2268  
    8080    #endregion
    8181
    82     private System.Windows.Forms.MenuStrip menuStrip;
    8382    private System.Windows.Forms.ToolStrip toolStrip;
    8483    private System.Windows.Forms.StatusStrip statusStrip;
    8584    private System.Windows.Forms.ToolStripStatusLabel statusStripLabel;
     85    protected System.Windows.Forms.MenuStrip menuStrip;
    8686  }
    8787}
  • trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs

    r2256 r2268  
    3232
    3333namespace HeuristicLab.MainForm {
    34   public abstract partial class MainFormBase : Form, IMainForm {
    35     protected MainFormBase(Type userInterfaceItemType)
     34  public partial class MainFormBase : Form, IMainForm {
     35    protected MainFormBase()
    3636      : base() {
    3737      InitializeComponent();
    3838      views = new List<IView>();
    3939      viewChangeToolStripItems = new List<IToolStripItem>();
     40    }
     41
     42    protected MainFormBase(Type userInterfaceItemType)
     43      : this() {
    4044      this.userInterfaceItemType = userInterfaceItemType;
    4145      CreateGUI();
     
    5963      set {
    6064        if (InvokeRequired) {
    61           Action<string> action = delegate(string s) { this.statusStripLabel.Text = s; };
     65          Action<string> action = delegate(string s) { this.StatusStripText = s; };
    6266          Invoke(action, new object[] { value });
    6367        } else
     
    107111
    108112    #region create menu and toolbar
    109     private void CreateGUI() {
     113    protected virtual void CreateGUI() {
    110114      DiscoveryService ds = new DiscoveryService();
    111115
     
    152156    }
    153157
    154     private ToolStripDropDownItem FindParent(IToolStripItem item, ToolStripItemCollection parentItems) {
     158    private ToolStripDropDownItem FindParent(IToolStripItem item, ToolStripItemCollection parentItems) {     
     159      if (String.IsNullOrEmpty(item.Structure))
     160        return null;
     161
    155162      ToolStripDropDownItem parent = null;
    156163      foreach (string structure in item.Structure.Split(item.StructureSeparator)) {
     
    158165          parent = (ToolStripDropDownItem)parentItems[structure];
    159166        else
    160           break;
     167          throw new ArgumentException("Structure string for item " + item.Name +
     168            " is invalid. Could not find " + structure + " in toolstrip!");
    161169        parentItems = parent.DropDownItems;
    162170      }
  • trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentForm.Designer.cs

    r2253 r2268  
    2121
    2222namespace HeuristicLab.MainForm {
    23   partial class MultipleDocumentForm {
     23  partial class DocumentForm {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    4747    /// </summary>
    4848    private void InitializeComponent() {
    49       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MultipleDocumentForm));
     49      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DocumentForm));
    5050      this.viewPanel = new System.Windows.Forms.Panel();
    5151      this.SuspendLayout();
  • trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentForm.cs

    r2253 r2268  
    2929
    3030namespace HeuristicLab.MainForm {
    31   public partial class MultipleDocumentForm : Form {
     31  public partial class DocumentForm : Form {
    3232    private IView myView;
    3333    public IView View {
     
    3535    }
    3636
    37     public MultipleDocumentForm() {
     37    public DocumentForm() {
    3838      InitializeComponent();
    3939    }
    40     public MultipleDocumentForm(IView view)
     40    public DocumentForm(IView view)
    4141      : this() {
    4242      myView = view;
  • trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.Designer.cs

    r2254 r2268  
    3131      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    3232      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    33       this.ClientSize = new System.Drawing.Size(284, 264);
     33      this.ClientSize = new System.Drawing.Size(596, 407);
     34      this.IsMdiContainer = true;
    3435      this.Name = "MultipleDocumentMainForm";
    3536      this.ResumeLayout(false);
     37      this.PerformLayout();
     38
    3639    }
    3740
  • trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs

    r2267 r2268  
    3131namespace HeuristicLab.MainForm {
    3232  public partial class MultipleDocumentMainForm : MainFormBase {
     33    public MultipleDocumentMainForm()
     34      : base() {
     35      InitializeComponent();
     36    }
     37
    3338    public MultipleDocumentMainForm(Type userInterfaceType)
    3439      : base(userInterfaceType) {
    3540      InitializeComponent();
    36       this.IsMdiContainer = true;
     41    }
     42
     43    protected override void CreateGUI() {
     44      base.CreateGUI();
     45      ToolStripMenuItem window = new ToolStripMenuItem("Windows");
     46      base.menuStrip.MdiWindowListItem = window;
     47      base.menuStrip.Items.Add(window);
    3748    }
    3849
     
    4152      else {
    4253        base.ShowView(view);
    43         MultipleDocumentForm form = new MultipleDocumentForm(view);
     54        DocumentForm form = new DocumentForm(view);
    4455        form.Activated += new EventHandler(MultipleDocumentFormActivated);
    4556        form.FormClosing += new FormClosingEventHandler(view.FormClosing);
     
    5364
    5465    private void MultipleDocumentFormActivated(object sender, EventArgs e) {
    55       base.ActiveView = ((MultipleDocumentForm)sender).View;
    56       base.StatusStripText = ((MultipleDocumentForm)sender).View.Caption;
     66      base.ActiveView = ((DocumentForm)sender).View;
     67      base.StatusStripText = ((DocumentForm)sender).View.Caption;
    5768    }
    5869
    5970    private void MultipleDocumentFormClosed(object sender, FormClosedEventArgs e) {
    60       MultipleDocumentForm form = (MultipleDocumentForm)sender;
     71      DocumentForm form = (DocumentForm)sender;
    6172      views.Remove(form.View);
    6273      if (views.Count == 0)
  • trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.Designer.cs

    r2266 r2268  
    11namespace HeuristicLab.MainForm {
    2   partial class DockingMainForm {
     2  partial class SingleDocumentMainForm {
    33    /// <summary>
    44    /// Required designer variable.
     
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       this.components = new System.ComponentModel.Container();
     26      this.SuspendLayout();
     27      //
     28      // SingleDocumentMainForm
     29      //
     30      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    2731      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     32      this.ClientSize = new System.Drawing.Size(624, 412);
     33      this.Name = "SingleDocumentMainForm";
     34      this.ResumeLayout(false);
     35      this.PerformLayout();
     36
    2837    }
    2938
    3039    #endregion
     40
    3141  }
    3242}
  • trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs

    r2266 r2268  
    3131
    3232namespace HeuristicLab.MainForm {
    33   public partial class DockingMainForm : MainFormBase {
    34     public DockingMainForm(Type userInterfaceItemType)
     33  public partial class SingleDocumentMainForm : MainFormBase {
     34    public SingleDocumentMainForm()
     35      : base() {
     36      InitializeComponent();
     37    }
     38
     39    public SingleDocumentMainForm(Type userInterfaceItemType)
    3540      : base(userInterfaceItemType) {
    3641      InitializeComponent();
    37       dockPanel = new DockPanel();
    38       InitializeDockPanel();
    39       this.IsMdiContainer = true;
    40       this.Controls.Add(dockPanel);
    41       this.Controls.SetChildIndex(dockPanel, 0);
    4242    }
    4343
    44     private DockPanel dockPanel;
    45 
    46     public override void ShowView(IView view) {     
     44    public override void ShowView(IView view) {
    4745      if (InvokeRequired) Invoke((Action<IView>)ShowView, view);
    4846      else {
    4947        base.ShowView(view);
    50         DockContent dockForm = new DockForm(view);
    51         dockForm.Activated += new EventHandler(DockFormActivated);
    52         dockForm.FormClosing += new FormClosingEventHandler(view.FormClosing);
    53         dockForm.FormClosed += new FormClosedEventHandler(DockFormClosed);
     48        DocumentForm form = new DocumentForm(view);
     49        form.Activated += new EventHandler(DockFormActivated);
     50        form.FormClosing += new FormClosingEventHandler(view.FormClosing);
     51        form.FormClosed += new FormClosedEventHandler(DockFormClosed);
    5452        foreach (IToolStripItem item in ViewChangedToolStripItems)
    5553          view.StateChanged += new EventHandler(item.ViewChanged);
    56         dockForm.Show(dockPanel);
     54        form.Show(this);
    5755      }
    5856    }
    5957
    6058    private void DockFormClosed(object sender, FormClosedEventArgs e) {
    61       DockForm dockForm = (DockForm)sender;
    62       views.Remove(dockForm.View);
     59      DocumentForm form = (DocumentForm)sender;
     60      views.Remove(form.View);
    6361      if (views.Count == 0)
    6462        ActiveView = null;
    65       dockForm.Activated -= new EventHandler(DockFormActivated);
    66       dockForm.FormClosing -= new FormClosingEventHandler(dockForm.View.FormClosing);
    67       dockForm.FormClosed -= new FormClosedEventHandler(DockFormClosed);
     63      form.Activated -= new EventHandler(DockFormActivated);
     64      form.FormClosing -= new FormClosingEventHandler(form.View.FormClosing);
     65      form.FormClosed -= new FormClosedEventHandler(DockFormClosed);
    6866      foreach (IToolStripItem item in ViewChangedToolStripItems)
    69         dockForm.View.StateChanged -= new EventHandler(item.ViewChanged);
     67        form.View.StateChanged -= new EventHandler(item.ViewChanged);
    7068    }
    7169
    7270    private void DockFormActivated(object sender, EventArgs e) {
    73       base.ActiveView = ((DockForm)sender).View;
    74       base.StatusStripText = ((DockForm)sender).View.Caption;
    75     }
    76 
    77     private void InitializeDockPanel() {
    78       DockPanelSkin dockPanelSkin1 = new DockPanelSkin();
    79       AutoHideStripSkin autoHideStripSkin1 = new AutoHideStripSkin();
    80       DockPanelGradient dockPanelGradient1 = new DockPanelGradient();
    81       TabGradient tabGradient1 = new TabGradient();
    82       DockPaneStripSkin dockPaneStripSkin1 = new DockPaneStripSkin();
    83       DockPaneStripGradient dockPaneStripGradient1 = new DockPaneStripGradient();
    84       TabGradient tabGradient2 = new TabGradient();
    85       DockPanelGradient dockPanelGradient2 = new DockPanelGradient();
    86       TabGradient tabGradient3 = new TabGradient();
    87       DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new DockPaneStripToolWindowGradient();
    88       TabGradient tabGradient4 = new TabGradient();
    89       TabGradient tabGradient5 = new TabGradient();
    90       DockPanelGradient dockPanelGradient3 = new DockPanelGradient();
    91       TabGradient tabGradient6 = new TabGradient();
    92       TabGradient tabGradient7 = new TabGradient();
    93 
    94       this.dockPanel.ActiveAutoHideContent = null;
    95       this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
    96       this.dockPanel.DockBackColor = SystemColors.Control;
    97       this.dockPanel.DockBottomPortion = 0.33;
    98       this.dockPanel.DockLeftPortion = 0.33;
    99       this.dockPanel.DockRightPortion = 0.33;
    100       this.dockPanel.DockTopPortion = 0.33;
    101       this.dockPanel.Location = new Point(0, 49);
    102       this.dockPanel.Name = "dockPanel";
    103       this.dockPanel.RightToLeftLayout = true;
    104       dockPanelGradient1.EndColor = SystemColors.ControlLight;
    105       dockPanelGradient1.StartColor = SystemColors.ControlLight;
    106       autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
    107       tabGradient1.EndColor = SystemColors.Control;
    108       tabGradient1.StartColor = SystemColors.Control;
    109       tabGradient1.TextColor = SystemColors.ControlDarkDark;
    110       autoHideStripSkin1.TabGradient = tabGradient1;
    111       dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;
    112       tabGradient2.EndColor = SystemColors.ControlLightLight;
    113       tabGradient2.StartColor = SystemColors.ControlLightLight;
    114       tabGradient2.TextColor = SystemColors.ControlText;
    115       dockPaneStripGradient1.ActiveTabGradient = tabGradient2;
    116       dockPanelGradient2.EndColor = SystemColors.Control;
    117       dockPanelGradient2.StartColor = SystemColors.Control;
    118       dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;
    119       tabGradient3.EndColor = SystemColors.ControlLight;
    120       tabGradient3.StartColor = SystemColors.ControlLight;
    121       tabGradient3.TextColor = SystemColors.ControlText;
    122       dockPaneStripGradient1.InactiveTabGradient = tabGradient3;
    123       dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;
    124       tabGradient4.EndColor = SystemColors.ActiveCaption;
    125       tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
    126       tabGradient4.StartColor = SystemColors.GradientActiveCaption;
    127       tabGradient4.TextColor = SystemColors.ActiveCaptionText;
    128       dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;
    129       tabGradient5.EndColor = SystemColors.Control;
    130       tabGradient5.StartColor = SystemColors.Control;
    131       tabGradient5.TextColor = SystemColors.ControlText;
    132       dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;
    133       dockPanelGradient3.EndColor = SystemColors.ControlLight;
    134       dockPanelGradient3.StartColor = SystemColors.ControlLight;
    135       dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;
    136       tabGradient6.EndColor = SystemColors.GradientInactiveCaption;
    137       tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
    138       tabGradient6.StartColor = SystemColors.GradientInactiveCaption;
    139       tabGradient6.TextColor = SystemColors.ControlText;
    140       dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
    141       tabGradient7.EndColor = Color.Transparent;
    142       tabGradient7.StartColor = Color.Transparent;
    143       tabGradient7.TextColor = SystemColors.ControlDarkDark;
    144       dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;
    145       dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;
    146       dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;
    147       this.dockPanel.Skin = dockPanelSkin1;
    148       this.dockPanel.TabIndex = 2;
     71      base.ActiveView = ((DocumentForm)sender).View;
     72      base.StatusStripText = ((DocumentForm)sender).View.Caption;
    14973    }
    15074  }
Note: See TracChangeset for help on using the changeset viewer.