示例#1
0
        public bool PreFilterMessage(ref Message m)
        {
            // Has a key been pressed?
            if (m.Msg == (int)Win32.Msgs.WM_KEYDOWN)
            {
                // Is it the ESCAPE key?
                if ((int)m.WParam == (int)Win32.VirtualKeys.VK_ESCAPE)
                {
                    // Are we in a redocking activity?
                    if (_intercept)
                    {
                        // Quite redocking
                        _redocker.QuitTrackingMode(null);

                        // Release capture
                        this.Capture = false;

                        // Reset state
                        _intercept = false;

                        return(true);
                    }
                }
            }

            return(false);
        }
示例#2
0
        protected void OnPageDragQuit(object sender, MouseEventArgs e)
        {
            // Are we currently in a redocking state?
            if (_redocker != null)
            {
                // Get redocker to quit
                _redocker.QuitTrackingMode(e);

                // Put back the page that was removed when dragging started
                RestoreDraggingPage();

                // No longer need the object
                _redocker = null;
            }
        }
示例#3
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            // The double click event will cause the control to be destroyed as
            // the Contents are restored to their alternative positions, so need to
            // double check the control is not already dead
            if (!IsDisposed)
            {
                // Always quit when new another button pressed and already docking
                if (_redocker != null)
                {
                    _redocker.QuitTrackingMode(e);

                    // No longer need the object
                    _redocker = null;
                }
                else
                {
                    // Left mouse down begins a redocking action
                    if (e.Button == MouseButtons.Left)
                    {
                        if (this.ParentWindow.RedockAllowed)
                        {
                            WindowContent wc = this.ParentWindow as WindowContent;

                            // Is our parent a WindowContent instance?
                            if (wc != null)
                            {
                                // Start redocking activity for the whole WindowContent
                                _redocker = new RedockerContent(this, wc, new Point(e.X, e.Y));
                            }
                        }
                    }

                    this.Focus();
                }
            }

            base.OnMouseDown(e);
        }