Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3394 for trunk


Ignore:
Timestamp:
04/18/10 03:01:25 (15 years ago)
Author:
mkommend
Message:

adapted mainforms to have a ShowInViewHost property (ticket #972)

Location:
trunk/sources
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs

    r2963 r3394  
    3636      InitializeComponent();
    3737    }
    38 
    3938    public DockingMainForm(Type userInterfaceItemType)
    4039      : base(userInterfaceItemType) {
    4140      InitializeComponent();
     41    }
     42    public DockingMainForm(Type userInterfaceItemType, bool showInViewHost)
     43      : this(userInterfaceItemType) {
     44      this.ShowInViewHost = showInViewHost;
    4245    }
    4346
     
    6467
    6568    protected override Form CreateForm(IView view) {
    66       return new DockForm(view);
     69      DockForm form;
     70      IContentView contentView = view as IContentView;
     71      if (ShowInViewHost && contentView != null && contentView.GetType() != typeof(ViewHost)) {
     72        ViewHost viewHost = new ViewHost(contentView.Content);
     73        form = new DockForm(viewHost);
     74      } else
     75        form = new DockForm(view);
     76      return form;
    6777    }
    6878
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainForm.cs

    r3301 r3394  
    5151
    5252    #region properties
     53    private bool showInViewHost;
     54    public bool ShowInViewHost {
     55      get { return this.showInViewHost; }
     56      set { this.showInViewHost = value; }
     57    }
     58
    5359    public string Title {
    5460      get { return this.Text; }
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MultipleDocumentMainForm.cs

    r2790 r3394  
    3535      InitializeComponent();
    3636    }
    37 
    3837    public MultipleDocumentMainForm(Type userInterfaceType)
    3938      : base(userInterfaceType) {
    4039      InitializeComponent();
     40    }
     41    public MultipleDocumentMainForm(Type userInterfaceItemType, bool showInViewHost)
     42      : this(userInterfaceItemType) {
     43      this.ShowInViewHost = showInViewHost;
    4144    }
    4245
     
    7073
    7174    protected override Form CreateForm(IView view) {
    72       Form form = new DocumentForm(view);
     75      Form form;
     76      IContentView contentView = view as IContentView;
     77      if (ShowInViewHost && contentView != null && contentView.GetType() != typeof(ViewHost)) {
     78        ViewHost viewHost = new ViewHost(contentView.Content);
     79        form = new DocumentForm(viewHost);
     80      } else
     81        form = new DocumentForm(view);
     82
    7383      form.MdiParent = this;
    7484      return form;
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/SingleDocumentMainForm.cs

    r2790 r3394  
    3636      InitializeComponent();
    3737    }
    38 
    3938    public SingleDocumentMainForm(Type userInterfaceItemType)
    4039      : base(userInterfaceItemType) {
    4140      InitializeComponent();
     41    }
     42    public SingleDocumentMainForm(Type userInterfaceItemType, bool showInViewHost)
     43      : this(userInterfaceItemType) {
     44      this.ShowInViewHost = showInViewHost;
    4245    }
    4346
     
    6467
    6568    protected override Form CreateForm(IView view) {
    66       DocumentForm form = new DocumentForm(view);
     69      Form form;
     70      IContentView contentView = view as IContentView;
     71      if (ShowInViewHost && contentView != null && contentView.GetType() != typeof(ViewHost)) {
     72        ViewHost viewHost = new ViewHost(contentView.Content);
     73        form = new DocumentForm(viewHost);
     74      } else
     75        form = new DocumentForm(view);
     76
    6777      form.ShowInTaskbar = true;
    6878      return form;
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewHost.cs

    r3391 r3394  
    130130        cachedViews.Add(viewType, view);
    131131      }
     132      this.Caption = view.Caption;
     133      this.SaveEnabled = view.SaveEnabled;
    132134
    133135      Control control = (Control)view;
  • trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLabOptimizerPlugin.cs.frame

    r3384 r3394  
    4040    public override void Run() {
    4141      OptimizerMainForm mainForm = new OptimizerMainForm(typeof(IOptimizerUserInterfaceItemProvider));
     42      mainForm.ShowInViewHost = true;
    4243      Application.Run(mainForm);
    4344    }
  • trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerMainForm.cs

    r3376 r3394  
    4141      InitializeComponent();
    4242    }
    43 
    4443    public OptimizerMainForm(Type userInterfaceItemType)
    4544      : base(userInterfaceItemType) {
    4645      InitializeComponent();
     46    }
     47    public OptimizerMainForm(Type userInterfaceItemType, bool showInViewHost)
     48      : this(userInterfaceItemType) {
     49      this.ShowInViewHost = showInViewHost;
    4750    }
    4851
Note: See TracChangeset for help on using the changeset viewer.