Esempio n. 1
0
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
     _hlBrIcon      = TBorderIcon.biNone;
     _HighLighted   = -1;
     _CloseHLighted = false;
     _HlCtl         = THighlightedCtl.ctlPage;
     Invalidate();
 }
Esempio n. 2
0
        protected void UpdateByCursorPos(Point aLocation)
        {
            _HlCtl    = THighlightedCtl.ctlPage;
            _hlBrIcon = TBorderIcon.biNone;

            // Determine if mouse cursor is over Window control button:
            if (HostForm != null)
            {
                int lLeft   = this.Width - (3 * (_BORDERICON_SIZE * 2 + 4));
                int lTop    = 0;
                int lWidth  = 2 * _BORDERICON_SIZE;
                int lHeight = _BORDERICON_SIZE;

                if (aLocation.Y >= lTop && aLocation.Y <= lTop + lHeight && lLeft <= aLocation.X)
                {
                    int lIndex = (aLocation.X - lLeft) / (lWidth + 4);
                    lIndex = ((lIndex + 1) * (lWidth + 4)) - 4 >= aLocation.X - lLeft ? lIndex : -1;

                    if (lIndex == 0)
                    {
                        _hlBrIcon = TBorderIcon.biMinimize;
                    }
                    else
                    if (lIndex == 1)
                    {
                        _hlBrIcon = TBorderIcon.biResize;
                    }
                    else
                    if (lIndex == 2)
                    {
                        _hlBrIcon = TBorderIcon.biClose;
                    }
                }
            }

            if (aLocation.Y < this.Height - _PageHeight)
            {
                _HighLighted = -1;
                return;
            }

            _HighLighted = getPageAtPoint(aLocation);



            // Determine if mouse cursor is over prev/next button
            if (aLocation.X > this.ClientSize.Width - (_ARCRAD + 8))
            {
                _HlCtl = THighlightedCtl.ctlPrev;
                if (aLocation.X > this.ClientSize.Width - (_ARCRAD / 2 + 4))
                {
                    _HlCtl = THighlightedCtl.ctlNext;
                }
            }

            // Determine if close is highlighted:
            if (_HighLighted > -1 && _HighLighted < _Pages.Count)
            {
                CPageSelectorPage lPage = (CPageSelectorPage)(_Pages[_HighLighted]);
                int lClLeft             = lPage.CurrentLeft + getVisibleWidth(lPage) - _PageHeight;

                _CloseHLighted = (aLocation.X > lClLeft) && (aLocation.X < (lPage.CurrentLeft + getVisibleWidth(lPage)));
            }
            else
            {
                _CloseHLighted = false;
            }

            Invalidate();
        }
Esempio n. 3
0
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
     _hlBrIcon = TBorderIcon.biNone;
     _HighLighted = -1;
     _CloseHLighted = false;
     _HlCtl = THighlightedCtl.ctlPage;
     Invalidate();
 }
Esempio n. 4
0
        protected void UpdateByCursorPos(Point aLocation)
        {
            _HlCtl = THighlightedCtl.ctlPage;
            _hlBrIcon = TBorderIcon.biNone;

            // Determine if mouse cursor is over Window control button:
            if (HostForm != null)
            {
                int lLeft = this.Width - (3 * (_BORDERICON_SIZE * 2 + 4));
                int lTop = 0;
                int lWidth = 2 * _BORDERICON_SIZE;
                int lHeight = _BORDERICON_SIZE;

                if (aLocation.Y >= lTop && aLocation.Y <= lTop + lHeight && lLeft <= aLocation.X)
                {
                    int lIndex = (aLocation.X - lLeft) / (lWidth + 4);
                    lIndex = ((lIndex + 1) * (lWidth + 4)) - 4 >= aLocation.X - lLeft ? lIndex : -1;

                    if (lIndex == 0) _hlBrIcon = TBorderIcon.biMinimize;
                    else
                    if (lIndex == 1) _hlBrIcon = TBorderIcon.biResize;
                    else
                    if (lIndex == 2) _hlBrIcon = TBorderIcon.biClose;
                }
            }

            if (aLocation.Y < this.Height - _PageHeight)
            {
                _HighLighted = -1;
                return;
            }

            _HighLighted = getPageAtPoint(aLocation);

            // Determine if mouse cursor is over prev/next button
            if (aLocation.X > this.ClientSize.Width - (_ARCRAD + 8))
            {
                _HlCtl = THighlightedCtl.ctlPrev;
                if (aLocation.X > this.ClientSize.Width - (_ARCRAD / 2 + 4))
                    _HlCtl = THighlightedCtl.ctlNext;
            }

            // Determine if close is highlighted:
            if (_HighLighted > -1 && _HighLighted < _Pages.Count)
            {
                CPageSelectorPage lPage = (CPageSelectorPage)(_Pages[_HighLighted]);
                int lClLeft = lPage.CurrentLeft + getVisibleWidth(lPage) - _PageHeight;

                _CloseHLighted = (aLocation.X > lClLeft) && (aLocation.X < (lPage.CurrentLeft + getVisibleWidth(lPage)));
            }
            else
                _CloseHLighted = false;

            Invalidate();
        }