Exemple #1
0
        public override void MouseMove(MouseEventArgs e)
        {
            if (FHotDomain.BeginNo >= 0)
            {
                Style.UpdateInfoRePaint();
            }

            FHotDomain.Clear();
            FDrawHotDomainRegion = false;

            base.MouseMove(e);

            if (!this.MouseMoveRestrain)
            {
                this.GetDomainFrom(this.MouseMoveItemNo, this.MouseMoveItemOffset, FHotDomain);

                HCViewData vTopData = this.GetTopLevelDataAt(e.X, e.Y) as HCViewData;
                if ((vTopData == this) || (!vTopData.FDrawHotDomainRegion))
                {
                    if (FHotDomain.BeginNo >= 0)
                    {
                        FDrawHotDomainRegion = true;
                        Style.UpdateInfoRePaint();
                    }
                }
            }
        }
Exemple #2
0
        public HCEdit()
        {
            HCUnitConversion.Initialization();
            //this.DoubleBuffered = true;
            //Create();  // 便于子类在构造函数前执行
            FHCExtFormat = DataFormats.GetFormat(HC.HC_EXT);
            SetStyle(ControlStyles.Selectable, true);  // 可接收焦点

            FStyle = new HCStyle(true, true);

            FUndoList                  = new HCUndoList();
            FUndoList.OnUndo           = DoUndo;
            FUndoList.OnRedo           = DoRedo;
            FUndoList.OnUndoNew        = DoUndoNew;
            FUndoList.OnUndoGroupStart = DoUndoGroupBegin;
            FUndoList.OnUndoGroupEnd   = DoUndoGroupEnd;

            FData                      = new HCViewData(FStyle);
            FData.Width                = 200;
            FData.OnGetUndoList        = DoGetUndoList;
            FData.OnCreateItemByStyle  = DoDataCreateStyleItem;
            FData.OnDrawItemPaintBefor = DoDrawItemPaintBefor;
            FData.OnInsertItem         = DoDataInsertItem;
            FData.OnRemoveItem         = DoDataRemoveItem;

            // 垂直滚动条,范围在Resize中设置
            FVScrollBar             = new HCScrollBar();
            FVScrollBar.Orientation = Orientation.oriVertical;
            FVScrollBar.OnScroll    = DoVScrollChange;
            // 水平滚动条,范围在Resize中设置
            FHScrollBar             = new HCScrollBar();
            FHScrollBar.Orientation = Orientation.oriHorizontal;
            FHScrollBar.OnScroll    = DoVScrollChange;

            this.Controls.Add(FHScrollBar);
            this.Controls.Add(FVScrollBar);

            FChanged = false;
            this.ResumeLayout();
        }
Exemple #3
0
        public override void MouseMove(MouseEventArgs e)
        {
            bool vRePaint = this.Style.DrawHotDomainRegion && (FHotDomain.BeginNo >= 0);

            FHotDomain.Clear();
            base.MouseMove(e);
            if (!this.MouseMoveRestrain)
            {
                this.GetDomainFrom(this.MouseMoveItemNo, this.MouseMoveItemOffset, FHotDomain);
                HCViewData vTopData = this.GetTopLevelDataAt(e.X, e.Y) as HCViewData;
                if ((vTopData == this) || (vTopData.HotDomain.BeginNo < 0))
                {
                    if (this.Style.DrawHotDomainRegion && (FHotDomain.BeginNo >= 0))
                    {
                        vRePaint = true;
                    }
                }
            }

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