Changeset 3644
- Timestamp:
- 05/05/10 17:31:58 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/DockForm.cs
r3571 r3644 53 53 break; 54 54 } 55 if (view is Sidebar) 55 Sidebar sidebar = view as Sidebar; 56 if (sidebar != null) { 57 if (sidebar.Collapsed) 58 this.ShowHint = DockState.DockLeftAutoHide; 59 else 60 this.ShowHint = DockState.DockLeft; 56 61 this.DockAreas = DockAreas.DockLeft | DockAreas.DockRight; 62 } 57 63 58 64 Type viewType = view.GetType(); … … 84 90 } 85 91 92 protected override void OnDockStateChanged(EventArgs e) { 93 base.OnDockStateChanged(e); 94 Sidebar sidebar = view as Sidebar; 95 if (sidebar != null) { 96 if (this.DockState == DockState.DockLeftAutoHide || this.DockState == DockState.DockRightAutoHide) 97 sidebar.Collapsed = true; 98 else 99 sidebar.Collapsed = false; 100 } 101 } 102 86 103 #region View Events 87 104 private void View_CaptionChanged(object sender, EventArgs e) { -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/SideBar.cs
r3571 r3644 28 28 using System.Text; 29 29 using System.Windows.Forms; 30 using WeifenLuo.WinFormsUI.Docking; 30 31 31 32 namespace HeuristicLab.MainForm.WindowsForms { … … 33 34 public Sidebar() { 34 35 InitializeComponent(); 36 } 37 38 private bool collapsed; 39 public bool Collapsed { 40 get { return this.collapsed; } 41 set { 42 if (this.collapsed != value) { 43 this.collapsed = value; 44 45 DockForm form = MainFormManager.GetMainForm<MainForm>().GetForm(this) as DockForm; 46 if (form != null) { 47 if (form.DockState == DockState.DockLeft || form.DockState == DockState.DockLeftAutoHide) 48 form.DockState = collapsed ? DockState.DockLeftAutoHide : DockState.DockLeft; 49 else if (form.DockState == DockState.DockRight || form.DockState == DockState.DockRightAutoHide) 50 form.DockState = collapsed ? DockState.DockRightAutoHide : DockState.DockRight; 51 } 52 53 this.OnCollapsedChanged(); 54 } 55 } 56 } 57 58 protected virtual void OnCollapsedChanged() { 35 59 } 36 60
Note: See TracChangeset
for help on using the changeset viewer.