Esempio n. 1
0
        public override void MouseDown(MouseEventArgs e)
        {
            base.MouseDown(e);
            FMouseLBDowning = (e.Button == MouseButtons.Left);
            FOutSelectInto  = false;

            if (FMouseMoveArea != FActiveArea)
            {
                FActiveArea = FMouseMoveArea;
                OwnerData.Style.UpdateInfoReCaret();
            }

            string vS = "";
            int    vX = 0;

            switch (FActiveArea)
            {   //ceaNone: ;
            case ExpressArea.ceaLeft:
                vS = FLeftText;
                vX = e.X - FLeftRect.Left;
                break;

            case ExpressArea.ceaTop:
                vS = TopText;
                vX = e.X - TopRect.Left;
                break;

            case ExpressArea.ceaRight:
                vS = FRightText;
                vX = e.X - FRightRect.Left;
                break;

            case ExpressArea.ceaBottom:
                vS = BottomText;
                vX = e.X - BottomRect.Left;
                break;
            }

            int vOffset = 0;

            if (FActiveArea != ExpressArea.ceaNone)
            {
                OwnerData.Style.TextStyles[TextStyleNo].ApplyStyle(OwnerData.Style.DefCanvas);
                vOffset = HC.GetCharOffsetByX(OwnerData.Style.DefCanvas, vS, vX);
            }
            else
            {
                vOffset = -1;
            }

            if (vOffset != FCaretOffset)
            {
                FCaretOffset = (short)vOffset;
                OwnerData.Style.UpdateInfoReCaret();
            }
        }
Esempio n. 2
0
        public override void MouseDown(MouseEventArgs e)
        {
            base.MouseDown(e);
            OwnerData.Style.TextStyles[TextStyleNo].ApplyStyle(OwnerData.Style.DefCanvas);
            int   vX      = e.X - FMargin;// - (Width - FMargin - OwnerData.Style.DefCanvas.TextWidth(FText) - FMargin) div 2;
            short vOffset = (short)HC.GetCharOffsetByX(OwnerData.Style.DefCanvas, FText, vX);

            if (vOffset != FCaretOffset)
            {
                FCaretOffset = vOffset;
                OwnerData.Style.UpdateInfoReCaret();
            }
        }
Esempio n. 3
0
        public override void MouseDown(MouseEventArgs e)
        {
            base.MouseDown(e);
            FMouseLBDowning = (e.Button == MouseButtons.Left);
            FOutSelectInto  = false;
            if (FMouseMoveArea != FActiveArea)
            {
                FActiveArea = FMouseMoveArea;
                OwnerData.Style.UpdateInfoReCaret();
            }

            string vS = "";
            int    vX = 0;

            if (FActiveArea == ExpressArea.ceaTop)
            {
                vS = FSupText;
                vX = e.X - FSupRect.Left;
            }
            else
            if (FActiveArea == ExpressArea.ceaBottom)
            {
                vS = FSubText;
                vX = e.X - FSubRect.Left;
            }

            int vOffset = 0;

            if (FActiveArea != ExpressArea.ceaNone)
            {
                ApplySupSubStyle(OwnerData.Style.TextStyles[TextStyleNo], OwnerData.Style.DefCanvas);
                vOffset = HC.GetCharOffsetByX(OwnerData.Style.DefCanvas, vS, vX);
            }
            else
            {
                vOffset = -1;
            }

            if (vOffset != FCaretOffset)
            {
                FCaretOffset = (short)vOffset;
                OwnerData.Style.UpdateInfoReCaret();
            }
        }