コード例 #1
0
        protected override ExpressArea GetExpressArea(int x, int y)
        {
            ExpressArea Result = base.GetExpressArea(x, y);

            if (Result == ExpressArea.ceaNone)
            {
                POINT vPt = new POINT(x, y);
                if (HC.PtInRect(FLeftRect, vPt))
                {
                    return(ExpressArea.ceaLeft);
                }
                else
                if (HC.PtInRect(FRightRect, vPt))
                {
                    return(ExpressArea.ceaRight);
                }
                else
                {
                    return(Result);
                }
            }
            else
            {
                return(Result);
            }
        }
コード例 #2
0
 protected override void SetActive(bool value)
 {
     base.SetActive(value);
     if (!value)
     {
         FActiveArea = ExpressArea.ceaNone;
     }
 }
コード例 #3
0
 public HCFractionItem(HCCustomData AOwnerData, string ATopText, string ABottomText) : base(AOwnerData)
 {
     this.StyleNo = HCStyle.Fraction;
     FPadding     = 5;
     FActiveArea  = ExpressArea.ceaNone;
     FCaretOffset = -1;
     FLineHide    = false;
     FTopText     = ATopText;
     FBottomText  = ABottomText;
 }
コード例 #4
0
        public HCSupSubScriptItem(HCCustomData aOwnerData, string aSupText, string aSubText) : base(aOwnerData)
        {
            this.StyleNo = HCStyle.SupSubScript;
            FPadding     = 1;
            FActiveArea  = ExpressArea.ceaNone;
            FCaretOffset = -1;

            FSupText = aSupText;
            FSubText = aSubText;
        }
コード例 #5
0
        public override bool MouseDown(MouseEventArgs e)
        {
            bool vResult = base.MouseDown(e);

            FMouseLBDowning = (e.Button == MouseButtons.Left) && (Control.ModifierKeys == Keys.None);
            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.TempCanvas);
                vOffset = HC.GetNorAlignCharOffsetAt(OwnerData.Style.TempCanvas, vS, vX);
            }
            else
            {
                vOffset = -1;
            }

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

            return(vResult);
        }
コード例 #6
0
        protected virtual ExpressArea GetExpressArea(int x, int y)
        {
            ExpressArea Result = ExpressArea.ceaNone;
            POINT       vPt    = new POINT(x, y);

            if (HC.PtInRect(FSupRect, vPt))
            {
                Result = ExpressArea.ceaTop;
            }
            else
            if (HC.PtInRect(FSubRect, vPt))
            {
                Result = ExpressArea.ceaBottom;
            }

            return(Result);
        }
コード例 #7
0
        public override bool MouseDown(MouseEventArgs e)
        {
            bool vResult = 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 = FTopText;
                vX = e.X - FTopRect.Left;
            }
            else
            if (FActiveArea == ExpressArea.ceaBottom)
            {
                vS = FBottomText;
                vX = e.X - FBottomRect.Left;
            }

            int vOffset = -1;

            if (FActiveArea != ExpressArea.ceaNone)
            {
                OwnerData.Style.ApplyTempStyle(TextStyleNo);
                vOffset = HC.GetNorAlignCharOffsetAt(OwnerData.Style.TempCanvas, vS, vX);
            }

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

            return(vResult);
        }
コード例 #8
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();
            }
        }
コード例 #9
0
        public override void MouseMove(MouseEventArgs e)
        {
            if ((!FMouseLBDowning) && (e.Button == MouseButtons.Left))
            {
                FOutSelectInto = true;
            }

            if (!FOutSelectInto)
            {
                ExpressArea vArea = GetExpressArea(e.X, e.Y);
                if (vArea != FMouseMoveArea)
                {
                    FMouseMoveArea = vArea;
                    OwnerData.Style.UpdateInfoRePaint();
                }
            }
            else
            {
                FMouseMoveArea = ExpressArea.ceaNone;
            }

            base.MouseMove(e);
        }
コード例 #10
0
        public override bool MouseMove(MouseEventArgs e)
        {
            if ((!FMouseLBDowning) && (e.Button == MouseButtons.Left) && (Control.ModifierKeys == Keys.None))
            {
                FOutSelectInto = true;
            }

            if (!FOutSelectInto)
            {
                ExpressArea vArea = GetExpressArea(e.X, e.Y);
                if (vArea != FMouseMoveArea)
                {
                    FMouseMoveArea = vArea;
                    OwnerData.Style.UpdateInfoRePaint();
                }
            }
            else
            {
                FMouseMoveArea = ExpressArea.ceaNone;
            }

            return(base.MouseMove(e));
        }