コード例 #1
0
        public override void GetCaretInfo(ref HCCaretInfo aCaretInfo)
        {
            if ((FActiveArea != ExpressArea.ceaNone) && (FCaretOffset >= 0))
            {
                OwnerData.Style.ApplyTempStyle(TextStyleNo);
                if (FActiveArea == ExpressArea.ceaTop)
                {
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = FTopRect.Bottom - FTopRect.Top;
                    aCaretInfo.X      = FTopRect.Left + OwnerData.Style.TempCanvas.TextWidth(FTopText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = FTopRect.Top;
                }
                else
                if (FActiveArea == ExpressArea.ceaBottom)
                {
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = FBottomRect.Bottom - FBottomRect.Top;
                    aCaretInfo.X      = FBottomRect.Left + OwnerData.Style.TempCanvas.TextWidth(FBottomText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = FBottomRect.Top;
                }
            }
            else
            {
                aCaretInfo.Visible = false;
            }
        }
コード例 #2
0
ファイル: HCEditItem.cs プロジェクト: HunSoft/HCView-CSharp
        public override void GetCaretInfo(ref HCCaretInfo aCaretInfo)
        {
            string vS = FText.Substring(0, FCaretOffset);

            OwnerData.Style.ApplyTempStyle(TextStyleNo);

            if (vS != "")
            {
                SIZE vSize = OwnerData.Style.TempCanvas.TextExtent(vS);
                aCaretInfo.Height = vSize.cy;
                aCaretInfo.X      = FMargin + vSize.cx;// + (Width - FMargin - OwnerData.Style.DefCanvas.TextWidth(FText) - FMargin) div 2;
            }
            else
            {
                aCaretInfo.Height = OwnerData.Style.TextStyles[TextStyleNo].FontHeight;
                aCaretInfo.X      = FMargin;// + (Width - FMargin - OwnerData.Style.DefCanvas.TextWidth(FText) - FMargin) div 2;
            }

            aCaretInfo.Y = FMargin;

            if ((!this.AutoSize) && (aCaretInfo.X > Width))
            {
                aCaretInfo.Visible = false;
            }
        }
コード例 #3
0
ファイル: HCRichData.cs プロジェクト: 15070217668/HCView-.net
        public override void GetCaretInfo(int AItemNo, int AOffset, ref HCCaretInfo ACaretInfo)
        {
            base.GetCaretInfo(AItemNo, AOffset, ref ACaretInfo);

            // 赋值激活Group信息,清除在 MouseDown
            if (this.SelectInfo.StartItemNo >= 0)
            {
                HCCustomRichData vTopData = GetTopLevelData();
                if (vTopData == this)
                {
                    if (FActiveDomain.BeginNo >= 0)
                    {
                        FActiveDomain.Clear();
                        FDrawActiveDomainRegion = false;
                        Style.UpdateInfoRePaint();
                    }
                    // 获取当前光标处ActiveDeGroup信息
                    this.GetDomainFrom(this.SelectInfo.StartItemNo, this.SelectInfo.StartItemOffset, FActiveDomain);
                    if (FActiveDomain.BeginNo >= 0)
                    {
                        FDrawActiveDomainRegion = true;
                        Style.UpdateInfoRePaint();
                    }
                }
            }
        }
コード例 #4
0
        public override void GetCaretInfo(ref HCCaretInfo ACaretInfo)
        {
            if (FActiveArea != ExpressArea.ceaNone)
            {
                ApplySupSubStyle(OwnerData.Style.TextStyles[TextStyleNo], OwnerData.Style.DefCanvas);
                if (FActiveArea == ExpressArea.ceaTop)
                {
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    ACaretInfo.Height = FSupRect.Bottom - FSupRect.Top;
                    ACaretInfo.X      = FSupRect.Left + OwnerData.Style.DefCanvas.TextWidth(FSupText.Substring(0, FCaretOffset));
                    ACaretInfo.Y      = FSupRect.Top;
                }
                else
                if (FActiveArea == ExpressArea.ceaBottom)
                {
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    ACaretInfo.Height = FSubRect.Bottom - FSubRect.Top;
                    ACaretInfo.X      = FSubRect.Left + OwnerData.Style.DefCanvas.TextWidth(FSubText.Substring(0, FCaretOffset));
                    ACaretInfo.Y      = FSubRect.Top;
                }
            }
            else
            {
                ACaretInfo.Visible = false;
            }
        }
コード例 #5
0
        public override void GetCaretInfo(ref HCCaretInfo ACaretInfo)
        {
            if (FCaretOffset < 0)
            {
                ACaretInfo.Visible = false;
                return;
            }

            string vS = FText.Substring(0, FCaretOffset);

            OwnerData.Style.TextStyles[TextStyleNo].ApplyStyle(OwnerData.Style.DefCanvas);
            if (vS != "")
            {
                SIZE vSize = OwnerData.Style.DefCanvas.TextExtent(vS);
                ACaretInfo.Height = vSize.cy;
                ACaretInfo.X      = FMargin + vSize.cx;// + (Width - FMargin - OwnerData.Style.DefCanvas.TextWidth(FText) - FMargin) div 2;
            }
            else
            {
                ACaretInfo.Height = OwnerData.Style.DefCanvas.TextHeight("H");
                ACaretInfo.X      = FMargin;// + (Width - FMargin - OwnerData.Style.DefCanvas.TextWidth(FText) - FMargin) div 2;
            }

            ACaretInfo.Y = FMargin;
            if ((!this.AutoSize) && (ACaretInfo.X > Width))
            {
                ACaretInfo.Visible = false;
            }
        }
コード例 #6
0
 /// <summary> 更新光标位置 </summary>
 public override void GetCaretInfo(ref HCCaretInfo ACaretInfo)
 {
     if (this.Active)
     {
         ACaretInfo.Visible = false;
     }
 }
コード例 #7
0
 public override void GetCaretInfo(ref HCCaretInfo ACaretInfo)
 {
     base.GetCaretInfo(ref ACaretInfo);
     if ((!this.AutoSize) && (ACaretInfo.X > Width - BTNWIDTH))
     {
         ACaretInfo.Visible = false;
     }
 }
コード例 #8
0
        public override void GetCaretInfo(ref HCCaretInfo aCaretInfo)
        {
            if (FActiveArea != ExpressArea.ceaNone)
            {
                OwnerData.Style.ApplyTempStyle(TextStyleNo);

                switch (FActiveArea)
                {
                case ExpressArea.ceaLeft:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = FLeftRect.Bottom - FLeftRect.Top;
                    aCaretInfo.X      = FLeftRect.Left + OwnerData.Style.TempCanvas.TextWidth(FLeftText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = FLeftRect.Top;
                    break;

                case ExpressArea.ceaTop:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = TopRect.Bottom - TopRect.Top;
                    aCaretInfo.X      = TopRect.Left + OwnerData.Style.TempCanvas.TextWidth(TopText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = TopRect.Top;
                    break;

                case ExpressArea.ceaRight:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = FRightRect.Bottom - FRightRect.Top;
                    aCaretInfo.X      = FRightRect.Left + OwnerData.Style.TempCanvas.TextWidth(FRightText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = FRightRect.Top;
                    break;

                case ExpressArea.ceaBottom:
                    if (FCaretOffset < 0)
                    {
                        FCaretOffset = 0;
                    }

                    aCaretInfo.Height = BottomRect.Bottom - BottomRect.Top;
                    aCaretInfo.X      = BottomRect.Left + OwnerData.Style.TempCanvas.TextWidth(BottomText.Substring(0, FCaretOffset));
                    aCaretInfo.Y      = BottomRect.Top;
                    break;
                }
            }
            else
            {
                aCaretInfo.Visible = false;
            }
        }
コード例 #9
0
        public override void GetCaretInfo(int aItemNo, int aOffset, ref HCCaretInfo aCaretInfo)
        {
            base.GetCaretInfo(aItemNo, aOffset, ref aCaretInfo);

            if (!this.Style.UpdateInfo.DragingSelected && this.SelectExists())
            {
                if (this.SelectInSameDrawItem() && (this.Items[SelectInfo.StartItemNo].StyleNo < HCStyle.Null))
                {
                }
                else
                {
                    aCaretInfo.Visible = false;
                }
            }

            int vCaretDrawItemNo = -1;

            if (this.CaretDrawItemNo < 0)
            {
                if (Style.UpdateInfo.DragingSelected)
                {
                    vCaretDrawItemNo = GetDrawItemNoByOffset(this.MouseMoveItemNo, this.MouseMoveItemOffset);
                }
                else
                {
                    vCaretDrawItemNo = GetDrawItemNoByOffset(SelectInfo.StartItemNo, SelectInfo.StartItemOffset);
                }
            }
            else
            {
                vCaretDrawItemNo = CaretDrawItemNo;
            }

            HCDataAnnotate vDataAnnotate = null;

            if (Style.UpdateInfo.DragingSelected)
            {
                vDataAnnotate = GetDrawItemFirstDataAnnotateAt(vCaretDrawItemNo,
                                                               GetDrawItemOffsetWidth(vCaretDrawItemNo,
                                                                                      this.MouseMoveItemOffset - DrawItems[vCaretDrawItemNo].CharOffs + 1),
                                                               DrawItems[vCaretDrawItemNo].Rect.Top + 1);
            }
            else
            {
                vDataAnnotate = GetDrawItemFirstDataAnnotateAt(vCaretDrawItemNo,
                                                               GetDrawItemOffsetWidth(vCaretDrawItemNo,
                                                                                      SelectInfo.StartItemOffset - DrawItems[vCaretDrawItemNo].CharOffs + 1),
                                                               DrawItems[vCaretDrawItemNo].Rect.Top + 1);
            }

            if (FActiveAnnotate != vDataAnnotate)
            {
                FActiveAnnotate = vDataAnnotate;
                Style.UpdateInfoRePaint();
            }
        }
コード例 #10
0
        public override void GetCaretInfo(int aItemNo, int aOffset, ref HCCaretInfo aCaretInfo)
        {
            if (FFloatItemIndex >= 0)
            {
                aCaretInfo.Visible = false;
                return;
            }

            base.GetCaretInfo(aItemNo, aOffset, ref aCaretInfo);
        }
コード例 #11
0
        public override void GetCaretInfo(int AItemNo, int AOffset, ref HCCaretInfo ACaretInfo)
        {
            if (FFloatItemIndex >= 0)
            {
                ACaretInfo.Visible = false;
                return;
            }

            base.GetCaretInfo(AItemNo, AOffset, ref ACaretInfo);
        }
コード例 #12
0
ファイル: HCRichData.cs プロジェクト: 15070217668/HCView-.net
 public void GetCaretInfoCur(ref HCCaretInfo ACaretInfo)
 {
     if (Style.UpdateInfo.Draging)
     {
         this.GetCaretInfo(this.MouseMoveItemNo, this.MouseMoveItemOffset, ref ACaretInfo);
     }
     else
     {
         this.GetCaretInfo(SelectInfo.StartItemNo, SelectInfo.StartItemOffset, ref ACaretInfo);
     }
 }
コード例 #13
0
        public override void GetCaretInfo(int aItemNo, int aOffset, ref HCCaretInfo aCaretInfo)
        {
            if (FAnnotateCount > 0 && this.SelectInfo.StartItemNo >= 0)
            {
                HCCustomData vTopData = GetTopLevelData();
                if (vTopData == this)
                {
                    GetAnnotateFrom(SelectInfo.StartItemNo, SelectInfo.StartItemOffset, FActiveAnnotate);
                }
            }

            base.GetCaretInfo(aItemNo, aOffset, ref aCaretInfo);
        }
コード例 #14
0
ファイル: HCViewData.cs プロジェクト: ganjiayi/HCView-CSharp
        public override void GetCaretInfo(int aItemNo, int aOffset, ref HCCaretInfo aCaretInfo)
        {
            base.GetCaretInfo(aItemNo, aOffset, ref aCaretInfo);

            bool vRePaint = false;

            // 赋值激活Group信息,清除在 MouseDown
            if (this.SelectInfo.StartItemNo >= 0)
            {
                HCCustomData vTopData = GetTopLevelData();
                if (vTopData == this)
                {
                    if (this.Style.DrawActiveDomainRegion && (FActiveDomain.BeginNo >= 0))
                    {
                        vRePaint = true;
                    }

                    // 获取当前光标处ActiveDeGroup信息
                    GetDomainFrom(SelectInfo.StartItemNo, SelectInfo.StartItemOffset, FActiveDomain);

                    if (this.Style.DrawActiveDomainRegion && (FActiveDomain.BeginNo >= 0))
                    {
                        vRePaint = true;
                    }
                }
            }
            else
            if (this.Style.DrawActiveDomainRegion && (FActiveDomain.BeginNo >= 0))
            {
                FActiveDomain.Clear();
                vRePaint = true;
            }

            if (vRePaint)
            {
                Style.UpdateInfoRePaint();
            }

            if (FCaretItemChanged)
            {
                FCaretItemChanged = false;
                if (FOnCaretItemChanged != null)
                {
                    FOnCaretItemChanged(this, Items[SelectInfo.StartItemNo]);
                }
            }
        }
コード例 #15
0
        public override void GetCaretInfo(int aItemNo, int aOffset, ref HCCaretInfo aCaretInfo)
        {
            base.GetCaretInfo(aItemNo, aOffset, ref aCaretInfo);

            int vCaretDrawItemNo = -1;

            if (this.CaretDrawItemNo < 0)
            {
                if (Style.UpdateInfo.Draging)
                {
                    vCaretDrawItemNo = GetDrawItemNoByOffset(this.MouseMoveItemNo, this.MouseMoveItemOffset);
                }
                else
                {
                    vCaretDrawItemNo = GetDrawItemNoByOffset(SelectInfo.StartItemNo, SelectInfo.StartItemOffset);
                }
            }
            else
            {
                vCaretDrawItemNo = CaretDrawItemNo;
            }

            HCDataAnnotate vDataAnnotate = null;

            if (Style.UpdateInfo.Draging)
            {
                vDataAnnotate = GetDrawItemFirstDataAnnotateAt(vCaretDrawItemNo,
                                                               GetDrawItemOffsetWidth(vCaretDrawItemNo,
                                                                                      this.MouseMoveItemOffset - DrawItems[vCaretDrawItemNo].CharOffs + 1),
                                                               DrawItems[vCaretDrawItemNo].Rect.Top + 1);
            }
            else
            {
                vDataAnnotate = GetDrawItemFirstDataAnnotateAt(vCaretDrawItemNo,
                                                               GetDrawItemOffsetWidth(vCaretDrawItemNo,
                                                                                      SelectInfo.StartItemOffset - DrawItems[vCaretDrawItemNo].CharOffs + 1),
                                                               DrawItems[vCaretDrawItemNo].Rect.Top + 1);
            }

            if (FActiveAnnotate != vDataAnnotate)
            {
                FActiveAnnotate = vDataAnnotate;
                Style.UpdateInfoRePaint();
            }
        }
コード例 #16
0
 public void GetCaretInfo(int AItemNo, int AOffset, ref HCCaretInfo ACaretInfo)
 {
     if (FCellData != null)
     {
         FCellData.GetCaretInfo(AItemNo, AOffset, ref ACaretInfo);
         if (ACaretInfo.Visible)
         {
             if (FAlignVert == AlignVert.cavBottom)
             {
                 ACaretInfo.Y = ACaretInfo.Y + FHeight - FCellData.Height;
             }
             else
             if (FAlignVert == AlignVert.cavCenter)
             {
                 ACaretInfo.Y = ACaretInfo.Y + (FHeight - FCellData.Height) / 2;
             }
         }
     }
     else
     {
         ACaretInfo.Visible = false;
     }
 }
コード例 #17
0
 public override void GetCaretInfo(ref HCCaretInfo aCaretInfo)
 {
     //base.GetCaretInfo(ref aCaretInfo);
     aCaretInfo.Visible = false;
 }
コード例 #18
0
ファイル: HCTableCell.cs プロジェクト: HunSoft/HCView-CSharp
 public void GetCaretInfo(int aItemNo, int aOffset, byte aCellHPadding, byte aCellVPadding, ref HCCaretInfo aCaretInfo)
 {
     if (FCellData != null)
     {
         FCellData.GetCaretInfo(aItemNo, aOffset, ref aCaretInfo);
         if (aCaretInfo.Visible)
         {
             aCaretInfo.X += aCellHPadding;
             aCaretInfo.Y += GetCellDataTop(aCellVPadding);
         }
     }
     else
     {
         aCaretInfo.Visible = false;
     }
 }
コード例 #19
0
 /// <summary> 更新光标位置 </summary>
 public virtual void GetCaretInfo(ref HCCaretInfo aCaretInfo)
 {
     aCaretInfo.Visible = false;
 }
コード例 #20
0
ファイル: HCEdit.cs プロジェクト: jianxiaonan/HCView-CSharp
        private void ReBuildCaret(bool aScrollBar = false)
        {
            if (FCaret == null)
            {
                return;
            }

            if ((!this.Focused) || (!FStyle.UpdateInfo.Draging && FData.SelectExists()))
            {
                FCaret.Hide();
                return;
            }

            HCCaretInfo vCaretInfo = new HCCaretInfo();

            vCaretInfo.X       = 0;
            vCaretInfo.Y       = 0;
            vCaretInfo.Height  = 0;
            vCaretInfo.Visible = true;

            FData.GetCaretInfo(FData.SelectInfo.StartItemNo, FData.SelectInfo.StartItemOffset, ref vCaretInfo);

            if (!vCaretInfo.Visible)
            {
                FCaret.Hide();
                return;
            }

            FCaret.X      = vCaretInfo.X - FHScrollBar.Position + this.Padding.Left;
            FCaret.Y      = vCaretInfo.Y - FVScrollBar.Position + this.Padding.Top;
            FCaret.Height = vCaretInfo.Height;

            int vViewHeight = GetViewHeight();

            if (aScrollBar)
            {
                if ((FCaret.X < 0) || (FCaret.X > GetViewWidth()))
                {
                    FCaret.Hide();
                    return;
                }

                if ((FCaret.Y + FCaret.Height < 0) || (FCaret.Y > vViewHeight))
                {
                    FCaret.Hide();
                    return;
                }
            }
            else  // 非滚动条(方向键、点击等)引起的光标位置变化
            {
                if (FCaret.Height < vViewHeight)
                {
                    if (FCaret.Y < 0)
                    {
                        FVScrollBar.Position = FVScrollBar.Position + FCaret.Y - this.Padding.Top;
                    }
                    else
                    if (FCaret.Y + FCaret.Height + this.Padding.Top > vViewHeight)
                    {
                        FVScrollBar.Position = FVScrollBar.Position + FCaret.Y + FCaret.Height + this.Padding.Top - vViewHeight;
                    }
                }
            }


            if (FCaret.Y + FCaret.Height > vViewHeight)
            {
                FCaret.Height = vViewHeight - FCaret.Y;
            }

            FCaret.Show();
            DoCaretChange();
        }
コード例 #21
0
 /// <summary> 更新光标位置 </summary>
 public virtual void GetCaretInfo(ref HCCaretInfo aCaretInfo)
 {
 }
コード例 #22
0
 public override void GetCaretInfo(ref HCCaretInfo aCaretInfo)
 {
     aCaretInfo.Visible = false;
 }