/// <summary> /// Initialize a new instance of the KryptonDockingAutoHiddenGroup class. /// </summary> /// <param name="name">Initial name of the element.</param> /// <param name="edge">Docking edge being managed.</param> public KryptonDockingAutoHiddenGroup(string name, DockingEdge edge) : base(name) { Edge = edge; // Create a control that will draw tabs for auto hidden pages AutoHiddenGroupControl = new KryptonAutoHiddenGroup(edge); AutoHiddenGroupControl.StoringPage += OnAutoHiddenGroupStoringPage; AutoHiddenGroupControl.TabClicked += OnAutoHiddenGroupTabClicked; AutoHiddenGroupControl.TabMouseHoverStart += OnAutoHiddenGroupHoverStart; AutoHiddenGroupControl.TabMouseHoverEnd += OnAutoHiddenGroupHoverEnd; AutoHiddenGroupControl.TabVisibleCountChanged += OnAutoHiddenGroupTabVisibleCountChanged; AutoHiddenGroupControl.Disposed += OnAutoHiddenGroupDisposed; }
/// <summary> /// Initialize a new instance of the KryptonDockingAutoHiddenGroup class. /// </summary> /// <param name="name">Initial name of the element.</param> /// <param name="edge">Docking edge being managed.</param> public KryptonDockingAutoHiddenGroup(string name, DockingEdge edge) : base(name) { _edge = edge; // Create a control that will draw tabs for auto hidden pages _autoHiddenGroup = new KryptonAutoHiddenGroup(edge); _autoHiddenGroup.StoringPage += new EventHandler <UniqueNameEventArgs>(OnAutoHiddenGroupStoringPage); _autoHiddenGroup.TabClicked += new EventHandler <KryptonPageEventArgs>(OnAutoHiddenGroupTabClicked); _autoHiddenGroup.TabMouseHoverStart += new EventHandler <KryptonPageEventArgs>(OnAutoHiddenGroupHoverStart); _autoHiddenGroup.TabMouseHoverEnd += new EventHandler(OnAutoHiddenGroupHoverEnd); _autoHiddenGroup.TabVisibleCountChanged += new EventHandler(OnAutoHiddenGroupTabVisibleCountChanged); _autoHiddenGroup.Disposed += new EventHandler(OnAutoHiddenGroupDisposed); }
/// <summary> /// Initialize a new instance of the KryptonDockingAutoHiddenGroup class. /// </summary> /// <param name="name">Initial name of the element.</param> /// <param name="edge">Docking edge being managed.</param> public KryptonDockingAutoHiddenGroup(string name, DockingEdge edge) : base(name) { _edge = edge; // Create a control that will draw tabs for auto hidden pages _autoHiddenGroup = new KryptonAutoHiddenGroup(edge); _autoHiddenGroup.StoringPage += new EventHandler<UniqueNameEventArgs>(OnAutoHiddenGroupStoringPage); _autoHiddenGroup.TabClicked += new EventHandler<KryptonPageEventArgs>(OnAutoHiddenGroupTabClicked); _autoHiddenGroup.TabMouseHoverStart += new EventHandler<KryptonPageEventArgs>(OnAutoHiddenGroupHoverStart); _autoHiddenGroup.TabMouseHoverEnd += new EventHandler(OnAutoHiddenGroupHoverEnd); _autoHiddenGroup.TabVisibleCountChanged += new EventHandler(OnAutoHiddenGroupTabVisibleCountChanged); _autoHiddenGroup.Disposed += new EventHandler(OnAutoHiddenGroupDisposed); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { // Dispose of the timer resources if (_slideTimer != null) { _slideTimer.Stop(); _slideTimer.Dispose(); _slideTimer = null; } if (_dismissTimer != null) { _dismissTimer.Stop(); _dismissTimer.Dispose(); _dismissTimer = null; _dismissRunning = false; } // Remove cached references that might prevent those objects from being garbage collected Page = null; _group = null; // Remove ourself from the control we planted ourself into _control.Controls.Remove(this); // Remove all the pages so that the pages have palette redirection reset _dockspaceSlide.ClearAllPages(); // Unhook from events/static references to allow garbage collection SeparatorControl.SplitterMoving -= OnDockspaceSeparatorMoving; SeparatorControl.SplitterMoved -= OnDockspaceSeparatorMoved; SeparatorControl.SplitterMoveRect -= OnDockspaceSeparatorMoveRect; _dockspaceSlide.CellLosesFocus -= OnDockspaceCellLosesFocus; _dockspaceSlide.PageCloseClicked -= OnDockspacePageCloseClicked; _dockspaceSlide.PageAutoHiddenClicked -= OnDockspacePageAutoHiddenClicked; _dockspaceSlide.PageDropDownClicked -= OnDockspacePageDropDownClicked; Application.RemoveMessageFilter(this); } base.Dispose(disposing); }
private void MakeHidden() { // Check to see if we allowed to perform operations if (!Disposing && !IsDisposed) { if (_state != DockingAutoHiddenShowState.Hidden) { // Set state so timer processing does not perform any slide action _state = DockingAutoHiddenShowState.Hidden; AutoHiddenShowingStateEventArgs args = new AutoHiddenShowingStateEventArgs(_page, _state); // Remove cached references _page = null; _group = null; // No need for timers to be running or for our display _slideTimer.Stop(); _dismissTimer.Stop(); _dismissRunning = false; Visible = false; // Move to correct z-order position ResetChildIndex(); // If the dockspace has the focus we need to push focus elsewhere if (DockspaceControl.ContainsFocus) { DockspaceControl.CellLosesFocus -= new EventHandler <WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); _dummyTarget.Select(); } // Remove all the pages so that the pages have palette redirection reset DockspaceControl.ClearAllPages(); // Raises event to indicate change in auto hidden showing state OnAutoHiddenShowingStateChanged(args); } } }
private void MakeHidden() { // Check to see if we allowed to perform operations if (!Disposing && !IsDisposed) { if (_state != DockingAutoHiddenShowState.Hidden) { // Set state so timer processing does not perform any slide action _state = DockingAutoHiddenShowState.Hidden; AutoHiddenShowingStateEventArgs args = new AutoHiddenShowingStateEventArgs(_page, _state); // Remove cached references _page = null; _group = null; // No need for timers to be running or for our display _slideTimer.Stop(); _dismissTimer.Stop(); _dismissRunning = false; Visible = false; // Move to correct z-order position ResetChildIndex(); // If the dockspace has the focus we need to push focus elsewhere if (DockspaceControl.ContainsFocus) { DockspaceControl.CellLosesFocus -= new EventHandler<WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); _dummyTarget.Select(); } // Remove all the pages so that the pages have palette redirection reset DockspaceControl.ClearAllPages(); // Raises event to indicate change in auto hidden showing state OnAutoHiddenShowingStateChanged(args); } } }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing) { // Dispose of the timer resources if (_slideTimer != null) { _slideTimer.Stop(); _slideTimer.Dispose(); _slideTimer = null; } if (_dismissTimer != null) { _dismissTimer.Stop(); _dismissTimer.Dispose(); _dismissTimer = null; _dismissRunning = false; } // Remove cached references that might prevent those objects from being garbage collected _page = null; _group = null; // Remove ourself from the control we planted outself into _control.Controls.Remove(this); // Remove all the pages so that the pages have palette redirection reset _dockspaceSlide.ClearAllPages(); // Unhook from events/static references to allow garbage collection _separator.SplitterMoving -= new SplitterCancelEventHandler(OnDockspaceSeparatorMoving); _separator.SplitterMoved -= new SplitterEventHandler(OnDockspaceSeparatorMoved); _separator.SplitterMoveRect -= new EventHandler<SplitterMoveRectMenuArgs>(OnDockspaceSeparatorMoveRect); _dockspaceSlide.CellLosesFocus -= new EventHandler<WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); _dockspaceSlide.PageCloseClicked -= new EventHandler<UniqueNameEventArgs>(OnDockspacePageCloseClicked); _dockspaceSlide.PageAutoHiddenClicked -= new EventHandler<UniqueNameEventArgs>(OnDockspacePageAutoHiddenClicked); _dockspaceSlide.PageDropDownClicked -= new EventHandler<CancelDropDownEventArgs>(OnDockspacePageDropDownClicked); Application.RemoveMessageFilter(this); } base.Dispose(disposing); }
/// <summary> /// Requests the panel slide into view and display the provided page. /// </summary> /// <param name="page">Reference to page for display.</param> /// <param name="group">Reference to auto hidden group that displays the page.</param> /// <param name="select">Should the sliding out page become selected.</param> public void SlideOut(KryptonPage page, KryptonAutoHiddenGroup group, bool select) { // Check to see if we allowed to perform operations if (Disposing || IsDisposed) return; // Move to the hidden state switch (_state) { case DockingAutoHiddenShowState.Hidden: // Nothing to do, already in state we require break; case DockingAutoHiddenShowState.SlidingIn: // If already showing indicated page (although currently sliding inwards) if (page == _page) { // Switch to sliding out again _state = DockingAutoHiddenShowState.SlidingOut; // Are we requested to set focus to the sliding in dockspace? if (select) { DockspaceControl.Select(); DockspaceControl.CellLosesFocus += new EventHandler<WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); } return; } else { // Different page, so move straight to hidden state MakeHidden(); } break; case DockingAutoHiddenShowState.SlidingOut: case DockingAutoHiddenShowState.Showing: // If already showing indicated page (or in the process of showing) then do nothing if (page == _page) { // Are we requested to set focus to the sliding in dockspace? if (select) { DockspaceControl.Select(); DockspaceControl.CellLosesFocus += new EventHandler<WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); } return; } else { // Different page, so move straight to hidden state MakeHidden(); } break; } // Cache information about the page being displayed _page = page; _group = group; // Make sure we have a visible cell to update KryptonWorkspaceCell cell = DockspaceControl.FirstVisibleCell(); if (cell == null) { cell = new KryptonWorkspaceCell(); DockspaceControl.Root.Children.Add(cell); } // Replace any existing page with the new one DockspaceControl.ClearAllPages(); cell.Pages.Add(page); DockspaceControl.PerformLayout(); // Find the starting and ending rectangles for the slide operation CalculateStartAndEnd(); // Set initial positions of ourself and the contained inner panel _inner.SetBounds(0, 0, _endRect.Width, _endRect.Height); SetBounds(_startRect.X, _startRect.Y, _startRect.Width, _startRect.Height); // Make sure we are at the top of the z-order and visible _control.Controls.SetChildIndex(this, 0); Visible = true; // Switch to new state and start animation timer _state = DockingAutoHiddenShowState.SlidingOut; AutoHiddenShowingStateEventArgs args = new AutoHiddenShowingStateEventArgs(_page, _state); _slideTimer.Start(); // Are we requested to set focus to the sliding in dockspace? if (select) { DockspaceControl.Select(); DockspaceControl.CellLosesFocus += new EventHandler<WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); } // Raises event to indicate change in auto hidden showing state OnAutoHiddenShowingStateChanged(args); }
/// <summary> /// Requests the panel slide into view and display the provided page. /// </summary> /// <param name="page">Reference to page for display.</param> /// <param name="group">Reference to auto hidden group that displays the page.</param> /// <param name="select">Should the sliding out page become selected.</param> public void SlideOut(KryptonPage page, KryptonAutoHiddenGroup group, bool select) { // Check to see if we allowed to perform operations if (Disposing || IsDisposed) { return; } // Move to the hidden state switch (_state) { case DockingAutoHiddenShowState.Hidden: // Nothing to do, already in state we require break; case DockingAutoHiddenShowState.SlidingIn: // If already showing indicated page (although currently sliding inwards) if (page == _page) { // Switch to sliding out again _state = DockingAutoHiddenShowState.SlidingOut; // Are we requested to set focus to the sliding in dockspace? if (select) { DockspaceControl.Select(); DockspaceControl.CellLosesFocus += new EventHandler <WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); } return; } else { // Different page, so move straight to hidden state MakeHidden(); } break; case DockingAutoHiddenShowState.SlidingOut: case DockingAutoHiddenShowState.Showing: // If already showing indicated page (or in the process of showing) then do nothing if (page == _page) { // Are we requested to set focus to the sliding in dockspace? if (select) { DockspaceControl.Select(); DockspaceControl.CellLosesFocus += new EventHandler <WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); } return; } else { // Different page, so move straight to hidden state MakeHidden(); } break; } // Cache information about the page being displayed _page = page; _group = group; // Make sure we have a visible cell to update KryptonWorkspaceCell cell = DockspaceControl.FirstVisibleCell(); if (cell == null) { cell = new KryptonWorkspaceCell(); DockspaceControl.Root.Children.Add(cell); } // Replace any existing page with the new one DockspaceControl.ClearAllPages(); cell.Pages.Add(page); DockspaceControl.PerformLayout(); // Find the starting and ending rectangles for the slide operation CalculateStartAndEnd(); // Set initial positions of ourself and the contained inner panel _inner.SetBounds(0, 0, _endRect.Width, _endRect.Height); SetBounds(_startRect.X, _startRect.Y, _startRect.Width, _startRect.Height); // Make sure we are at the top of the z-order and visible _control.Controls.SetChildIndex(this, 0); Visible = true; // Switch to new state and start animation timer _state = DockingAutoHiddenShowState.SlidingOut; AutoHiddenShowingStateEventArgs args = new AutoHiddenShowingStateEventArgs(_page, _state); _slideTimer.Start(); // Are we requested to set focus to the sliding in dockspace? if (select) { DockspaceControl.Select(); DockspaceControl.CellLosesFocus += new EventHandler <WorkspaceCellEventArgs>(OnDockspaceCellLosesFocus); } // Raises event to indicate change in auto hidden showing state OnAutoHiddenShowingStateChanged(args); }
/// <summary> /// Initialize a new instance of the AutoHiddenGroupEventArgs class. /// </summary> /// <param name="control">Reference to auto hidden group control instance.</param> /// <param name="element">Reference to docking auto hidden group element that is managing the control.</param> public AutoHiddenGroupEventArgs(KryptonAutoHiddenGroup control, KryptonDockingAutoHiddenGroup element) { AutoHiddenGroupControl = control; AutoHiddenGroupElement = element; }
/// <summary> /// Initialize a new instance of the AutoHiddenGroupEventArgs class. /// </summary> /// <param name="control">Reference to auto hidden group control instance.</param> /// <param name="element">Reference to docking auto hidden group element that is managing the control.</param> public AutoHiddenGroupEventArgs(KryptonAutoHiddenGroup control, KryptonDockingAutoHiddenGroup element) { _autoHiddenGroup = control; _element = element; }