Inheritance: ComponentFactory.Krypton.Toolkit.KryptonPanel
        /// <summary>
        /// Initialize a new instance of the KryptonDockingEdgeAutoHidden class.
        /// </summary>
        /// <param name="name">Initial name of the element.</param>
        /// <param name="control">Reference to control that is being managed.</param>
        /// <param name="edge">Docking edge being managed.</param>
        public KryptonDockingEdgeAutoHidden(string name, Control control, DockingEdge edge)
            : base(name)
        {
            if (control == null)
                throw new ArgumentNullException("control");

            _control = control;
            _edge = edge;
            _panelEventFired = false;

            // Create and add the panel used to host auto hidden groups
            _panel = new KryptonAutoHiddenPanel(edge);
            _panel.AutoSize = true;
            _panel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            _panel.Dock = DockingHelper.DockStyleFromDockEdge(edge, false);
            _panel.Disposed += new EventHandler(OnPanelDisposed);

            // Create the panel that slides into/out of view to show selected auto host entry
            _slidePanel = new KryptonAutoHiddenSlidePanel(control, edge, _panel);
            _slidePanel.SplitterMoveRect += new EventHandler<SplitterMoveRectMenuArgs>(OnSlidePanelSeparatorMoveRect);
            _slidePanel.SplitterMoved += new SplitterEventHandler(OnSlidePanelSeparatorMoved);
            _slidePanel.SplitterMoving += new SplitterCancelEventHandler(OnSlidePanelSeparatorMoving);
            _slidePanel.PageCloseClicked += new EventHandler<UniqueNameEventArgs>(OnSlidePanelPageCloseClicked);
            _slidePanel.PageAutoHiddenClicked += new EventHandler<UniqueNameEventArgs>(OnSlidePanelPageAutoHiddenClicked);
            _slidePanel.PageDropDownClicked += new EventHandler<CancelDropDownEventArgs>(OnSlidePanelPageDropDownClicked);
            _slidePanel.AutoHiddenShowingStateChanged += new EventHandler<AutoHiddenShowingStateEventArgs>(OnSlidePanelAutoHiddenShowingStateChanged);
            _slidePanel.Disposed += new EventHandler(OnSlidePanelDisposed);

            Control.Controls.Add(_panel);
        }
Beispiel #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonAutoHiddenSlidePanel class.
        /// </summary>
        /// <param name="control">Reference to control that is being managed.</param>
        /// <param name="edge">Docking edge being managed.</param>
        /// <param name="panel">Reference to auto hidden panel for this edge.</param>
        public KryptonAutoHiddenSlidePanel(Control control, DockingEdge edge, KryptonAutoHiddenPanel panel)
        {
            _control         = control;
            _edge            = edge;
            _panel           = panel;
            _state           = DockingAutoHiddenShowState.Hidden;
            _checkMakeHidden = OnCheckMakeHidden;

            // We need to a timer to automate sliding in and out
            _slideTimer = new Timer
            {
                Interval = SLIDE_INTERVAL
            };
            _slideTimer.Tick += OnSlideTimerTick;

            // Timer used to delay between notification of need to slide inwards and performing actual slide
            _dismissTimer = new Timer
            {
                Interval = DISMISS_INTERVAL
            };
            _dismissTimer.Tick += OnDismissTimerTick;
            _dismissRunning     = false;

            // Create inner panel that holds the actual dockspace and separator
            _dockspaceSlide = new KryptonDockspaceSlide
            {
                Dock           = DockStyle.Fill,
                AutoHiddenHost = true
            };
            _dockspaceSlide.PageCloseClicked      += OnDockspacePageCloseClicked;
            _dockspaceSlide.PageAutoHiddenClicked += OnDockspacePageAutoHiddenClicked;
            _dockspaceSlide.PageDropDownClicked   += OnDockspacePageDropDownClicked;

            SeparatorControl = new KryptonDockspaceSeparator(edge, true);
            SeparatorControl.SplitterMoving   += OnDockspaceSeparatorMoving;
            SeparatorControl.SplitterMoved    += OnDockspaceSeparatorMoved;
            SeparatorControl.SplitterMoveRect += OnDockspaceSeparatorMoveRect;

            _inner = new KryptonPanel();
            _inner.Controls.AddRange(new Control[] { _dockspaceSlide, SeparatorControl });
            Controls.Add(_inner);

            // Do not show ourself until we are needed
            Visible = false;

            // Add a Button that is not showing and used to push focus away from the dockspace
            _dummyTarget = new Button
            {
                Location = new Point(-200, -200),
                Size     = new Size(100, 100)
            };
            Controls.Add(_dummyTarget);

            // Add ourself into the target control for docking
            control.SizeChanged += OnControlSizeChanged;
            control.Controls.Add(this);

            // Need to peek at windows messages so we can determine if mouse is over the slide out panel
            Application.AddMessageFilter(this);
        }
Beispiel #3
0
        /// <summary>
        /// Initialize a new instance of the KryptonDockingEdgeAutoHidden class.
        /// </summary>
        /// <param name="name">Initial name of the element.</param>
        /// <param name="control">Reference to control that is being managed.</param>
        /// <param name="edge">Docking edge being managed.</param>
        public KryptonDockingEdgeAutoHidden(string name, Control control, DockingEdge edge)
            : base(name)
        {
            Control          = control ?? throw new ArgumentNullException(nameof(control));
            Edge             = edge;
            _panelEventFired = false;

            // Create and add the panel used to host auto hidden groups
            _panel = new KryptonAutoHiddenPanel(edge)
            {
                AutoSize     = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink,
                Dock         = DockingHelper.DockStyleFromDockEdge(edge, false)
            };
            _panel.Disposed += OnPanelDisposed;

            // Create the panel that slides into/out of view to show selected auto host entry
            _slidePanel = new KryptonAutoHiddenSlidePanel(control, edge, _panel);
            _slidePanel.SplitterMoveRect              += OnSlidePanelSeparatorMoveRect;
            _slidePanel.SplitterMoved                 += OnSlidePanelSeparatorMoved;
            _slidePanel.SplitterMoving                += OnSlidePanelSeparatorMoving;
            _slidePanel.PageCloseClicked              += OnSlidePanelPageCloseClicked;
            _slidePanel.PageAutoHiddenClicked         += OnSlidePanelPageAutoHiddenClicked;
            _slidePanel.PageDropDownClicked           += OnSlidePanelPageDropDownClicked;
            _slidePanel.AutoHiddenShowingStateChanged += OnSlidePanelAutoHiddenShowingStateChanged;
            _slidePanel.Disposed += OnSlidePanelDisposed;

            Control.Controls.Add(_panel);
        }
Beispiel #4
0
        /// <summary>
        /// Initialize a new instance of the KryptonDockingEdgeAutoHidden class.
        /// </summary>
        /// <param name="name">Initial name of the element.</param>
        /// <param name="control">Reference to control that is being managed.</param>
        /// <param name="edge">Docking edge being managed.</param>
        public KryptonDockingEdgeAutoHidden(string name, Control control, DockingEdge edge)
            : base(name)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            _control         = control;
            _edge            = edge;
            _panelEventFired = false;

            // Create and add the panel used to host auto hidden groups
            _panel              = new KryptonAutoHiddenPanel(edge);
            _panel.AutoSize     = true;
            _panel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            _panel.Dock         = DockingHelper.DockStyleFromDockEdge(edge, false);
            _panel.Disposed    += new EventHandler(OnPanelDisposed);

            // Create the panel that slides into/out of view to show selected auto host entry
            _slidePanel = new KryptonAutoHiddenSlidePanel(control, edge, _panel);
            _slidePanel.SplitterMoveRect              += new EventHandler <SplitterMoveRectMenuArgs>(OnSlidePanelSeparatorMoveRect);
            _slidePanel.SplitterMoved                 += new SplitterEventHandler(OnSlidePanelSeparatorMoved);
            _slidePanel.SplitterMoving                += new SplitterCancelEventHandler(OnSlidePanelSeparatorMoving);
            _slidePanel.PageCloseClicked              += new EventHandler <UniqueNameEventArgs>(OnSlidePanelPageCloseClicked);
            _slidePanel.PageAutoHiddenClicked         += new EventHandler <UniqueNameEventArgs>(OnSlidePanelPageAutoHiddenClicked);
            _slidePanel.PageDropDownClicked           += new EventHandler <CancelDropDownEventArgs>(OnSlidePanelPageDropDownClicked);
            _slidePanel.AutoHiddenShowingStateChanged += new EventHandler <AutoHiddenShowingStateEventArgs>(OnSlidePanelAutoHiddenShowingStateChanged);
            _slidePanel.Disposed += new EventHandler(OnSlidePanelDisposed);

            Control.Controls.Add(_panel);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonAutoHiddenSlidePanel class.
        /// </summary>
        /// <param name="control">Reference to control that is being managed.</param>
        /// <param name="edge">Docking edge being managed.</param>
        /// <param name="panel">Reference to auto hidden panel for this edge.</param>
        public KryptonAutoHiddenSlidePanel(Control control, DockingEdge edge, KryptonAutoHiddenPanel panel)
        {
            _control = control;
            _edge = edge;
            _panel = panel;
            _state = DockingAutoHiddenShowState.Hidden;
            _checkMakeHidden = new EventHandler(OnCheckMakeHidden);

            // We need to a timer to automate sliding in and out
            _slideTimer = new Timer();
            _slideTimer.Interval = SLIDE_INTERVAL;
            _slideTimer.Tick += new EventHandler(OnSlideTimerTick);

            // Timer used to delay between notification of need to slide inwards and performing actual slide
            _dismissTimer = new Timer();
            _dismissTimer.Interval = DISMISS_INTERVAL;
            _dismissTimer.Tick += new EventHandler(OnDismissTimerTick);
            _dismissRunning = false;

            // Create inner panel that holds the actual dockspace and separator
            _dockspaceSlide = new KryptonDockspaceSlide();
            _dockspaceSlide.Dock = DockStyle.Fill;
            _dockspaceSlide.AutoHiddenHost = true;
            _dockspaceSlide.PageCloseClicked += new EventHandler<UniqueNameEventArgs>(OnDockspacePageCloseClicked);
            _dockspaceSlide.PageAutoHiddenClicked += new EventHandler<UniqueNameEventArgs>(OnDockspacePageAutoHiddenClicked);
            _dockspaceSlide.PageDropDownClicked += new EventHandler<CancelDropDownEventArgs>(OnDockspacePageDropDownClicked);

            _separator = new KryptonDockspaceSeparator(edge, true);
            _separator.SplitterMoving += new SplitterCancelEventHandler(OnDockspaceSeparatorMoving);
            _separator.SplitterMoved += new SplitterEventHandler(OnDockspaceSeparatorMoved);
            _separator.SplitterMoveRect += new EventHandler<SplitterMoveRectMenuArgs>(OnDockspaceSeparatorMoveRect);

            _inner = new KryptonPanel();
            _inner.Controls.AddRange(new Control[] { _dockspaceSlide, _separator });
            Controls.Add(_inner);

            // Do not show ourself until we are needed
            Visible = false;

            // Add a Button that is not showing and used to push focus away from the dockspace
            _dummyTarget = new Button();
            _dummyTarget.Location = new Point(-200, -200);
            _dummyTarget.Size = new Size(100, 100);
            Controls.Add(_dummyTarget);

            // Add ourself into the target control for docking
            control.SizeChanged += new EventHandler(OnControlSizeChanged);
            control.Controls.Add(this);

            // Need to peek at windows messages so we can determine if mouse is over the slide out panel
            Application.AddMessageFilter(this);
        }
 /// <summary>
 /// Initialize a new instance of the AutoHiddenGroupPanelEventArgs class.
 /// </summary>
 /// <param name="autoHiddenPanel">Reference to auto hidden panel control instance.</param>
 /// <param name="element">Reference to docking auto hidden edge element that is managing the panel.</param>
 public AutoHiddenGroupPanelEventArgs(KryptonAutoHiddenPanel autoHiddenPanel,
                                      KryptonDockingEdgeAutoHidden element)
 {
     AutoHiddenPanelControl = autoHiddenPanel;
     EdgeAutoHiddenElement  = element;
 }
 /// <summary>
 /// Initialize a new instance of the AutoHiddenGroupPanelEventArgs class.
 /// </summary>
 /// <param name="autoHiddenPanel">Reference to auto hidden panel control instance.</param>
 /// <param name="element">Reference to docking auto hidden edge element that is managing the panel.</param>
 public AutoHiddenGroupPanelEventArgs(KryptonAutoHiddenPanel autoHiddenPanel,
                                      KryptonDockingEdgeAutoHidden element)
 {
     _autoHiddenPanel = autoHiddenPanel;
     _element         = element;
 }
 /// <summary>
 /// Initialize a new instance of the AutoHiddenGroupPanelEventArgs class.
 /// </summary>
 /// <param name="autoHiddenPanel">Reference to auto hidden panel control instance.</param>
 /// <param name="element">Reference to docking auto hidden edge element that is managing the panel.</param>
 public AutoHiddenGroupPanelEventArgs(KryptonAutoHiddenPanel autoHiddenPanel,
                                      KryptonDockingEdgeAutoHidden element)
 {
     _autoHiddenPanel = autoHiddenPanel;
     _element = element;
 }