- Timestamp:
- 09/19/10 19:43:05 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs
r4418 r4435 61 61 View view = activeView as View; 62 62 if (view != null) { 63 view.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; 64 view.Size = new System.Drawing.Size(this.Width - this.viewsLabel.Width - this.viewsLabel.Margin.Left - this.viewsLabel.Margin.Right, this.Height); 63 65 view.OnShown(new ViewShownEventArgs(view, false)); 64 66 Controls.Add(view); 65 67 } 66 68 } else viewType = null; 67 OnActiveViewChanged();68 69 } 69 70 } … … 84 85 OnViewTypeChanged(); 85 86 } 86 }87 }88 89 public new bool Enabled {90 get { return base.Enabled; }91 set {92 base.Enabled = value;93 this.viewsLabel.Enabled = value;94 87 } 95 88 } … … 136 129 IContentView view; 137 130 view = MainFormManager.CreateView(viewType); 131 view.Locked = this.Locked; 138 132 view.ReadOnly = this.ReadOnly; 139 view.Locked = this.Locked;140 133 ActiveView = view; //necessary to allow the views to change the status of the viewhost 141 134 view.Content = Content; … … 145 138 } 146 139 147 private void OnActiveViewChanged() {148 this.SuspendRepaint();149 if (activeView != null) {150 this.ActiveView.ReadOnly = this.ReadOnly;151 this.ActiveView.Locked = this.Locked;152 this.ActiveViewControl.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;153 this.ActiveViewControl.Size = new System.Drawing.Size(this.Width - this.viewsLabel.Width - this.viewsLabel.Margin.Left - this.viewsLabel.Margin.Right, this.Height);154 }155 this.ResumeRepaint(true);156 }157 158 140 private void RegisterActiveViewEvents() { 159 activeView.Changed += new EventHandler(activeView_Changed);160 141 activeView.CaptionChanged += new EventHandler(activeView_CaptionChanged); 142 activeView.LockedChanged += new EventHandler(activeView_LockedChanged); 161 143 } 162 144 private void DeregisterActiveViewEvents() { 163 activeView.C hanged -= new EventHandler(activeView_Changed);164 activeView. CaptionChanged -= new EventHandler(activeView_CaptionChanged);145 activeView.CaptionChanged += new EventHandler(activeView_CaptionChanged); 146 activeView.LockedChanged += new EventHandler(activeView_LockedChanged); 165 147 } 166 148 private void activeView_CaptionChanged(object sender, EventArgs e) { 167 this.ActiveViewChanged(); 168 } 169 private void activeView_Changed(object sender, EventArgs e) { 170 this.ActiveViewChanged(); 171 } 172 private void ActiveViewChanged() { 173 if (ActiveView != null) { 174 this.Caption = this.ActiveView.Caption; 175 this.ReadOnly = this.ActiveView.ReadOnly; 176 this.Locked = this.ActiveView.Locked; 177 } 149 this.Caption = activeView.Caption; 150 } 151 private void activeView_LockedChanged(object sender, EventArgs e) { 152 this.Locked = activeView.Locked; 178 153 } 179 154
Note: See TracChangeset
for help on using the changeset viewer.