Changeset 2636


Ignore:
Timestamp:
01/18/10 10:59:25 (10 years ago)
Author:
mkommend
Message:

registered on additional event ActiveContentChanged in !WinFormsUI to fire ActiveViewChanged (ticket #843)

Location:
trunk/sources
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/Actions/NewEditorAction.cs

    r2458 r2636  
    77namespace HeuristicLab.MainForm.Test {
    88  public static class NewEditorAction{
    9     private static IView view;
     9
    1010    public static void Execute(IMainForm mainform) {
    11       if (view == null)
    12         view = new EditorView();
    13       view.Caption = "Editor View";
     11      EditorView view = new EditorView();
     12      view.Caption = "Editor View " + mainform.Views.Count();
    1413      mainform.ShowView(view);
    1514    }
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/OpenToolStripButtonItem.cs

    r2514 r2636  
    2222      new OpenAction().Execute(MainFormManager.MainForm);
    2323    }
     24
     25    public override void ActiveViewChanged(object sender, EventArgs e) {
     26      this.ToolStripItem.Enabled = !this.ToolStripItem.Enabled;
     27      MainFormManager.MainForm.Title =
     28        MainFormManager.MainForm.ActiveView == null ? "null" : MainFormManager.MainForm.ActiveView.Caption;
     29    }
    2430  }
    2531}
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.Designer.cs

    r2458 r2636  
    115115      this.dockPanel.Skin = dockPanelSkin1;
    116116      this.dockPanel.TabIndex = 3;
     117      this.dockPanel.ActiveContentChanged += new System.EventHandler(this.dockPanel_ActiveContentChanged);
    117118      //
    118119      // DockingMainForm
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/DockingMainForm.cs

    r2548 r2636  
    6767    }
    6868
     69    private void dockPanel_ActiveContentChanged(object sender, EventArgs e) {
     70      DockForm content = this.dockPanel.ActiveContent as DockForm;
     71      this.ActiveView = content == null ? null : content.View;
     72    }
    6973  }
    7074}
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainFormBase.cs

    r2591 r2636  
    176176          views[view] = form;
    177177          form.Activated += new EventHandler(FormActivated);
    178           form.GotFocus += new EventHandler(FormActivated);
    179178          form.FormClosing += new FormClosingEventHandler(view.OnClosing);
    180179          form.FormClosing += new FormClosingEventHandler(((ViewBase)view).OnClosingHelper);
     
    192191    }
    193192
    194     protected virtual void Show(IView view, bool firstTimeShown) {     
     193    protected virtual void Show(IView view, bool firstTimeShown) {
    195194    }
    196195
     
    245244
    246245      form.Activated -= new EventHandler(FormActivated);
    247       form.GotFocus -= new EventHandler(FormActivated);
    248246      form.FormClosing -= new FormClosingEventHandler(view.OnClosing);
    249247      form.FormClosing -= new FormClosingEventHandler(((ViewBase)view).OnClosingHelper);
     
    269267
    270268    #region create menu and toolbar
    271     protected virtual void CreateGUI() {     
    272 
     269    protected virtual void CreateGUI() {
    273270      IEnumerable<IMenuItem> toolStripMenuItems =
    274271        from mi in ApplicationManager.Manager.GetInstances(userInterfaceItemType)
Note: See TracChangeset for help on using the changeset viewer.