示例#1
0
        protected override void OnClick(EventArgs aArgs)
        {
            base.OnClick(aArgs);

            if (HostForm != null)
            {
                switch (_hlBrIcon)
                {
                case TBorderIcon.biClose: HostForm.Close(); break;

                case TBorderIcon.biMinimize: HostForm.WindowState = FormWindowState.Minimized; break;

                case TBorderIcon.biResize:
                    if (HostForm.WindowState == FormWindowState.Maximized)
                    {
                        _windowInfo.Assigned = false;
                        HostForm.WindowState = FormWindowState.Normal;
                    }
                    else
                    {
                        _windowInfo          = new _sFormInfo(this.HostForm);
                        HostForm.WindowState = FormWindowState.Maximized;
                    }
                    break;
                }
            }

            if (_HighLighted > -1)
            {
                switch (_HlCtl)
                {
                case THighlightedCtl.ctlNext: RollLeft(); break;

                case THighlightedCtl.ctlPrev: RollRight(); break;

                default:
                    if (_CloseHLighted && HighlightedPage.CloseAble)
                    {
                        HighlightedPage.ClosePage();
                    }
                    else
                    {
                        SelectedPage = _HighLighted;
                    }
                    break;
                }

                Invalidate();
            }
        }
示例#2
0
        protected override void OnMouseMove(MouseEventArgs aMArgs)
        {
            if (!_Dragging)
            {
                base.OnMouseMove(aMArgs);
                UpdateByCursorPos(aMArgs.Location);
            }
            else
            {
                Point lPoint = this.PointToScreen(aMArgs.Location);

                if (lPoint.Y == 0)
                {
                    if (!_windowInfo.Assigned)
                    {
                        _windowInfo = new _sFormInfo(HostForm);
                    }
                    HostForm.WindowState = FormWindowState.Maximized;
                }
                else
                {
                    if (HostForm.WindowState == FormWindowState.Maximized && lPoint.Y > 24)
                    {
                        // Now restoring window size and position:
                        HostForm.WindowState = FormWindowState.Normal;
                        if (_windowInfo.Assigned)
                        {
                            _windowInfo.RestoreForm(HostForm, lPoint);
                            _windowInfo.Assigned = false;
                        }
                        startDraggingHost(lPoint);
                    }
                    else if (!_windowInfo.Assigned)
                    {
                        updateDragging(lPoint);
                    }
                }
            }
        }
示例#3
0
        protected override void OnMouseMove(MouseEventArgs aMArgs)
        {
            if (!_Dragging)
            {
                base.OnMouseMove(aMArgs);
                UpdateByCursorPos(aMArgs.Location);
            }
            else
            {
                Point lPoint = this.PointToScreen(aMArgs.Location);

                if (lPoint.Y == 0)
                {
                    if (!_windowInfo.Assigned) _windowInfo = new _sFormInfo(HostForm);
                    HostForm.WindowState = FormWindowState.Maximized;
                }
                else
                {
                    if (HostForm.WindowState == FormWindowState.Maximized && lPoint.Y > 24)
                    {
                        // Now restoring window size and position:
                        HostForm.WindowState = FormWindowState.Normal;
                        if (_windowInfo.Assigned)
                        {
                            _windowInfo.RestoreForm(HostForm, lPoint);
                            _windowInfo.Assigned = false;
                        }
                        startDraggingHost(lPoint);
                    }
                    else if (!_windowInfo.Assigned)
                    {
                        updateDragging(lPoint);
                    }
                }
            }
        }
示例#4
0
        protected override void OnClick(EventArgs aArgs)
        {
            base.OnClick(aArgs);

            if (HostForm != null)
                switch (_hlBrIcon)
                {
                    case TBorderIcon.biClose: HostForm.Close(); break;
                    case TBorderIcon.biMinimize: HostForm.WindowState = FormWindowState.Minimized; break;
                    case TBorderIcon.biResize:
                        if (HostForm.WindowState == FormWindowState.Maximized)
                        {
                            _windowInfo.Assigned = false;
                            HostForm.WindowState = FormWindowState.Normal;
                        }
                        else
                        {
                            _windowInfo = new _sFormInfo(this.HostForm);
                            HostForm.WindowState = FormWindowState.Maximized;
                        }
                        break;
                }

            if (_HighLighted > -1)
            {
                switch (_HlCtl)
                {
                    case THighlightedCtl.ctlNext: RollLeft(); break;
                    case THighlightedCtl.ctlPrev: RollRight(); break;
                    default:
                        if (_CloseHLighted && HighlightedPage.CloseAble)
                            HighlightedPage.ClosePage();
                        else
                            SelectedPage = _HighLighted;
                        break;
                }

                Invalidate();
            }
        }