Exemplo n.º 1
0
        public override bool InsertItem(HCCustomItem aItem)
        {
            bool Result = base.InsertItem(aItem);

            if (Result)
            {
                Style.UpdateInfoRePaint();
                Style.UpdateInfoReCaret();
                Style.UpdateInfoReScroll();
            }

            return(Result);
        }
Exemplo n.º 2
0
        public HCViewTool() : base()
        {
            FToolOffset = -4;
            FActiveItem = null;
            FHotToolBar = null;

            FTableToolBar = new HCTableToolBar();
            FTableToolBar.OnUpdateView = DoTableToolBarUpdateView;

            FImageToolBar = new HCImageToolBar();
            FImageToolBar.OnUpdateView   = DoImageToolBarUpdateView;
            FImageToolBar.OnControlPaint = DoImageToolBarControlPaint;
        }
Exemplo n.º 3
0
        protected override void DoRemoveItem(HCCustomItem aItem)
        {
            if (aItem.StyleNo == HCStyle.Annotate && (aItem as HCAnnotateItem).MarkType == MarkType.cmtBeg)
            {
                FAnnotateCount--;
                if (FOnRemoveAnnotate != null)
                {
                    FOnRemoveAnnotate(this, aItem as HCAnnotateItem);
                }
            }

            base.DoRemoveItem(aItem);
        }
Exemplo n.º 4
0
        public override bool InsertItem(int aIndex, HCCustomItem aItem, bool aOffsetBefor = true)
        {
            bool Result = base.InsertItem(aIndex, aItem, aOffsetBefor);

            if (Result)
            {
                Style.UpdateInfoRePaint();
                Style.UpdateInfoReCaret();
                Style.UpdateInfoReScroll();
            }

            return(Result);
        }
Exemplo n.º 5
0
        private void UndoRedoItemProperty(HCCustomUndoAction aAction, bool aIsUndo, ref int aCaretItemNo, ref int aCaretOffset)
        {
            HCItemPropertyUndoAction vAction = aAction as HCItemPropertyUndoAction;

            aCaretItemNo = vAction.ItemNo;
            aCaretOffset = vAction.Offset;
            HCCustomItem vItem = Items[vAction.ItemNo];

            switch (vAction.ItemProperty)
            {
            case ItemProperty.uipStyleNo:
            {
                if (aIsUndo)
                {
                    vItem.StyleNo = (vAction as HCItemStyleUndoAction).OldStyleNo;
                }
                else
                {
                    vItem.StyleNo = (vAction as HCItemStyleUndoAction).NewStyleNo;
                }
            }
            break;

            case ItemProperty.uipParaNo:
            {
                if (aIsUndo)
                {
                    vItem.ParaNo = (vAction as HCItemParaUndoAction).OldParaNo;
                }
                else
                {
                    vItem.ParaNo = (vAction as HCItemParaUndoAction).NewParaNo;
                }
            }
            break;

            case ItemProperty.uipParaFirst:
            {
                if (aIsUndo)
                {
                    vItem.ParaFirst = (vAction as HCItemParaFirstUndoAction).OldParaFirst;
                }
                else
                {
                    vItem.ParaFirst = (vAction as HCItemParaFirstUndoAction).NewParaFirst;
                }
            }
            break;
            }
        }
Exemplo n.º 6
0
        /// <summary> 复制前,便于控制是否允许复制 </summary>
        protected virtual bool DoCopyRequest(int aFormat)
        {
            HCCustomItem vTopItem = FData.GetTopLevelItem();

            if (vTopItem is HCEditItem)
            {
                if ((vTopItem as HCEditItem).SelectTextExists())
                {
                    return((aFormat == User.CF_TEXT) || (aFormat == User.CF_UNICODETEXT));
                }
            }

            return(true);
        }
Exemplo n.º 7
0
 // 当前RectItem格式化时所属的Data(为松耦合请传入TCustomRichData类型)
 public override void FormatToDrawItem(HCCustomData aRichData, int aItemNo)
 {
     this.Width  = 0;
     this.Height = aRichData.Style.TextStyles[0].FontHeight;  // 默认大小
     if (this.MarkType == MarkType.cmtBeg)
     {
         if (aItemNo < aRichData.Items.Count - 1)
         {
             HCCustomItem vItem = aRichData.Items[aItemNo + 1];
             if ((vItem.StyleNo == this.StyleNo) && // 下一个是组标识
                 ((vItem as HCDomainItem).MarkType == MarkType.cmtEnd)) // 下一个是结束标识
             {
                 this.Width = 10;                                       // 增加宽度以便输入时光标可方便点击
             }
             else
             if (vItem.ParaFirst)  // 下一个是段首,我是段尾
             {
                 this.Width = 10;  // 增加宽度以便输入时光标可方便点击
             }
             else
             if (vItem.StyleNo > HCStyle.Null)  // 后面是文本,跟随后面的高度
             {
                 this.Height = aRichData.Style.TextStyles[vItem.StyleNo].FontHeight;
             }
         }
         else
         {
             this.Width = 10;
         }
     }
     else  // 域结束标识
     {
         HCCustomItem vItem = aRichData.Items[aItemNo - 1];
         if ((vItem.StyleNo == this.StyleNo) && ((vItem as HCDomainItem).MarkType == MarkType.cmtBeg))
         {
             this.Width = 10;
         }
         else
         if (this.ParaFirst)  // 结束标识是段首,增加宽度
         {
             this.Width = 10;
         }
         else
         if (vItem.StyleNo > HCStyle.Null)  // 前面是文本,距离前面的高度
         {
             this.Height = aRichData.Style.TextStyles[vItem.StyleNo].FontHeight;
         }
     }
 }
Exemplo n.º 8
0
 private void CalcItemFormatHeigh(HCCustomItem AItem)
 {
     if (Style.TempStyleNo != AItem.StyleNo)
     {
         Style.ApplyTempStyle(AItem.StyleNo);
         FLastFormatParaNo = AItem.ParaNo;
         FItemFormatHeight = CalculateLineHeight(Style.TextStyles[AItem.StyleNo], Style.ParaStyles[AItem.ParaNo]);
     }
     else
     if (FLastFormatParaNo != AItem.ParaNo)
     {
         FLastFormatParaNo = AItem.ParaNo;
         FItemFormatHeight = CalculateLineHeight(Style.TextStyles[AItem.StyleNo], Style.ParaStyles[AItem.ParaNo]);
     }
 }
Exemplo n.º 9
0
        private void CancelActiveToolItem()
        {
            if (FActiveItem is HCImageItem)
            {
                (FActiveItem as HCImageItem).ShapeManager.DisActive();
                FImageToolBar.Visible = false;
            }
            else
            if (FActiveItem is HCTableItem)  // 是表格
            {
                FTableToolBar.Visible = false;
            }

            FActiveItem = null;
        }
Exemplo n.º 10
0
        private void UndoRedoInsertItem(HCCustomUndo aUndo, HCCustomUndoAction aAction, bool aIsUndo, ref int aCaretItemNo, ref int aCaretOffset, ref int aCaretDrawItemNo)
        {
            HCItemUndoAction vAction = aAction as HCItemUndoAction;

            aCaretItemNo = vAction.ItemNo;

            if (aIsUndo)
            {
                Items.RemoveAt(vAction.ItemNo);
                FItemAddCount--;

                if (aCaretItemNo > 0)
                {
                    aCaretItemNo--;
                    if (Items[aCaretItemNo].StyleNo > HCStyle.Null)
                    {
                        aCaretOffset = Items[aCaretItemNo].Length;
                    }
                    else
                    {
                        aCaretOffset = HC.OffsetAfter;
                    }
                }
                else
                {
                    aCaretOffset = 0;
                }
            }
            else  // 重做
            {
                HCCustomItem vItem = null;
                LoadItemFromStreamAlone(vAction.ItemStream, ref vItem);
                Items.Insert(vAction.ItemNo, vItem);
                FItemAddCount++;

                aCaretItemNo = vAction.ItemNo;
                if (Items[aCaretItemNo].StyleNo > HCStyle.Null)
                {
                    aCaretOffset = Items[aCaretItemNo].Length;
                }
                else
                {
                    aCaretOffset = HC.OffsetAfter;
                }

                aCaretDrawItemNo = (aUndo as HCDataUndo).CaretDrawItemNo + 1;
            }
        }
Exemplo n.º 11
0
        public override HCCustomItem BreakByOffset(int aOffset)
        {
            HCCustomItem Result = null;

            if ((aOffset >= Length) || (aOffset <= 0))
            {
            }
            else
            {
                Result      = base.BreakByOffset(aOffset);
                Result.Text = this.SubString(aOffset + 1, Length - aOffset);
                FText       = FText.Substring(0, aOffset); // 当前Item减去光标后的字符串
            }

            return(Result);
        }
Exemplo n.º 12
0
        public override HCCustomItem CreateItemByStyle(int aStyleNo)
        {
            HCCustomItem Result = null;

            if (FOnCreateItemByStyle != null)
            {
                Result = FOnCreateItemByStyle(this, aStyleNo);
            }

            if (Result == null)
            {
                Result = base.CreateItemByStyle(aStyleNo);
            }

            return(Result);
        }
Exemplo n.º 13
0
        protected override HCCustomItem CreateItemByStyle(int AStyleNo)
        {
            HCCustomItem Result = null;

            if (FOnCreateItemByStyle != null)
            {
                Result = FOnCreateItemByStyle(this, AStyleNo);
            }

            if (Result == null)
            {
                Result = base.CreateItemByStyle(AStyleNo);
            }

            return(Result);
        }
Exemplo n.º 14
0
        private void UndoRedoItemMirror(HCCustomUndoAction aAction, bool aIsUndo, ref int aCaretItemNo, ref int aCaretOffset)
        {
            HCItemUndoAction vAction = aAction as HCItemUndoAction;

            aCaretItemNo = vAction.ItemNo;
            aCaretOffset = vAction.Offset;
            HCCustomItem vItem = Items[aCaretItemNo];

            if (aIsUndo)
            {
                LoadItemFromStreamAlone(vAction.ItemStream, ref vItem);
            }
            else
            {
                LoadItemFromStreamAlone(vAction.ItemStream, ref vItem);
            }
        }
Exemplo n.º 15
0
        public override void Assign(HCCustomItem Source)
        {
            base.Assign(Source);
            FItems.Clear();
            HCComboboxItem vCombobox = Source as HCComboboxItem;

            for (int i = 0; i < vCombobox.Items.Count; i++)
            {
                FItems.Add(vCombobox.Items[i]);
            }

            FItemValues.Clear();
            for (int i = 0; i < vCombobox.ItemValues.Count; i++)
            {
                FItemValues.Add(vCombobox.ItemValues[i]);
            }
        }
Exemplo n.º 16
0
        public void LoadItemFromStreamAlone(Stream aStream, ref HCCustomItem aItem)
        {
            string vFileExt     = "";
            ushort vFileVersion = 0;
            byte   vLan         = 0;

            aStream.Position = 0;
            HC._LoadFileFormatAndVersion(aStream, ref vFileExt, ref vFileVersion, ref vLan);  // 文件格式和版本
            if ((vFileExt != HC.HC_EXT) && (vFileExt != "cff."))
            {
                throw new Exception("加载失败,不是" + HC.HC_EXT + "文件!");
            }

            HCStyle vStyle = new HCStyle();

            vStyle.LoadFromStream(aStream, vFileVersion);

            int vStyleNo = HCStyle.Null;

            byte[] vBuffer = BitConverter.GetBytes(vStyleNo);
            aStream.Read(vBuffer, 0, vBuffer.Length);
            vStyleNo = BitConverter.ToInt32(vBuffer, 0);

            if (vStyleNo > HCStyle.Null)
            {
                HCTextStyle vTextStyle = vStyle.TextStyles[vStyleNo];
                vStyleNo = Style.GetStyleNo(vTextStyle, true);
            }

            if (aItem == null)
            {
                aItem = CreateItemByStyle(vStyleNo);
            }

            aItem.LoadFromStream(aStream, vStyle, vFileVersion);
            aItem.StyleNo = vStyleNo;

            int         vParaNo    = aItem.ParaNo;
            HCParaStyle vParaStyle = vStyle.ParaStyles[vParaNo];

            vParaNo      = Style.GetParaNo(vParaStyle, true);
            aItem.ParaNo = vParaNo;
        }
Exemplo n.º 17
0
        protected override void DoSectionRemoveItem(object sender, HCCustomData aData, HCCustomItem aItem)
        {
            base.DoSectionRemoveItem(sender, aData, aItem);
            if (aItem == FActiveItem)
            {
                if (FActiveItem is HCImageItem)
                {
                    (FActiveItem as HCImageItem).ShapeManager.DisActive();
                    FImageToolBar.Visible = false;
                }
                else
                if (FActiveItem is HCTableItem)  // 是表格
                {
                    FTableToolBar.Visible = false;
                }

                FActiveItem = null;
            }
        }
Exemplo n.º 18
0
 // 当前RectItem格式化时所属的Data(为松耦合请传入TCustomRichData类型)
 public override void FormatToDrawItem(HCCustomData ARichData, int AItemNo)
 {
     this.Width  = 0;
     this.Height = 5;  // 默认大小
     if (this.MarkType == MarkType.cmtBeg)
     {
         if (AItemNo < ARichData.Items.Count - 1)
         {
             HCCustomItem vItem = ARichData.Items[AItemNo + 1];
             if ((vItem.StyleNo == this.StyleNo) && // 下一个是组标识)
                 ((vItem as HCDomainItem).MarkType == MarkType.cmtEnd)) // 下一个是结束标识
             {
                 this.Width = 10;                                       // 增加宽度以便输入时光标可方便点击
             }
             else
             if (vItem.StyleNo > HCStyle.Null)
             {
                 ARichData.Style.TextStyles[vItem.StyleNo].ApplyStyle(ARichData.Style.DefCanvas);
                 this.Height = ARichData.Style.DefCanvas.TextHeight("H");
             }
         }
         else
         {
             this.Width = 10;
         }
     }
     else  // 域结束标识
     {
         HCCustomItem vItem = ARichData.Items[AItemNo - 1];
         if ((vItem.StyleNo == this.StyleNo) &&
             ((vItem as HCDomainItem).MarkType == MarkType.cmtBeg))
         {
             this.Width = 10;
         }
         else
         if (vItem.StyleNo > HCStyle.Null)
         {
             ARichData.Style.TextStyles[vItem.StyleNo].ApplyStyle(ARichData.Style.DefCanvas);
             this.Height = ARichData.Style.DefCanvas.TextHeight("H");
         }
     }
 }
Exemplo n.º 19
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            FCaptureToolBar = null;

            if (!this.ReadOnly)
            {
                if (FUseTableTool && FTableToolBar.Visible && TableMouseDown(e))
                {
                    FCaptureToolBar = FTableToolBar;
                    return;
                }

                if (FUseImageTool && FImageToolBar.Visible && ImageMouseDown(e))
                {
                    FCaptureToolBar = FImageToolBar;
                    return;
                }
            }

            base.OnMouseDown(e);

            FTopData = this.ActiveSectionTopLevelData();
            HCCustomItem vTopItem = FTopData.GetActiveItem();

            SetActiveToolItem(vTopItem);

            HCCustomData vData = null;

            while (FActiveItem == null)
            {
                vData = FTopData.GetRootData();
                if (vData == FTopData)
                {
                    break;
                }

                FTopData = vData;
                vTopItem = FTopData.GetActiveItem();
                SetActiveToolItem(vTopItem);
            }
        }
Exemplo n.º 20
0
        public override void FormatToDrawItem(HCCustomData aRichData, int aItemNo)
        {
            this.Width  = 0;
            this.Height = aRichData.Style.TextStyles[0].FontHeight - aRichData.Style.LineSpaceMin;

            if (this.MarkType == MarkType.cmtBeg)
            {
                if (aItemNo < aRichData.Items.Count - 1)
                {
                    HCCustomItem vItem = aRichData.Items[aItemNo + 1];
                    if (vItem.StyleNo == this.StyleNo &&
                        (vItem as HCAnnotateItem).MarkType == MarkType.cmtEnd)
                    {
                        this.Width = 10;
                    }
                    else
                    if (vItem.ParaFirst)
                    {
                        this.Width = 10;
                    }
                }
                else
                {
                    this.Width = 10;
                }
            }
            else
            {
                HCCustomItem vItem = aRichData.Items[aItemNo - 1];
                if (vItem.StyleNo == this.StyleNo && (vItem as HCAnnotateItem).MarkType == MarkType.cmtBeg)
                {
                    this.Width = 10;
                }
                else
                if (this.ParaFirst)
                {
                    this.Width = 10;
                }
            }
        }
Exemplo n.º 21
0
        protected override void OnMouseDown(MouseEventArgs e)
        {
            if (!this.ReadOnly)
            {
                if (FTableToolBar.Visible && TableMouseDown(e))
                {
                    return;
                }

                if (FImageToolBar.Visible && ImageMouseDown(e))
                {
                    return;
                }
            }

            base.OnMouseDown(e);

            FTopData = this.ActiveSectionTopLevelData();
            HCCustomItem vTopItem = this.GetTopLevelItem();

            SetActiveItem(vTopItem);
        }
Exemplo n.º 22
0
        private void _FormatBreakTextDrawItem(int aItemNo, int aFmtLeft, int aFmtRight, ref int aDrawItemNo,
                                              ref POINT aPos, ref RECT vRect, ref int vRemainderWidth, ref bool vParaFirst)
        {
            HCCanvas vCanvas = HCStyle.CreateStyleCanvas();

            try
            {
                HCCustomDrawItem vDrawItem = DrawItems[aDrawItemNo];
                HCCustomItem     vItemBK   = Items[vDrawItem.ItemNo];
                int vLen = vItemBK.Text.Length;

                CalcItemFormatHeigh(vItemBK);

                int vWidth = Style.TempCanvas.TextWidth(vItemBK.Text[vLen - 1]);
                // 分裂前
                vDrawItem.CharLen    = vDrawItem.CharLen - 1;
                vDrawItem.Rect.Right = vDrawItem.Rect.Right - vWidth;
                vRemainderWidth      = aFmtRight - vDrawItem.Rect.Right;
                FinishLine(aItemNo, aDrawItemNo, vRemainderWidth);
                // 分裂后
                aPos.X       = aFmtLeft;
                aPos.Y       = vDrawItem.Rect.Bottom;
                vRect.Left   = aPos.X;
                vRect.Top    = aPos.Y;
                vRect.Right  = vRect.Left + vWidth;
                vRect.Bottom = vRect.Top + FItemFormatHeight;
                NewDrawItem(vDrawItem.ItemNo, vLen - 1, 1, vRect, false, true, ref aDrawItemNo);
                vParaFirst = false;
                aPos.X     = vRect.Right;

                vRemainderWidth = aFmtRight - vRect.Right;  // 放入最多后的剩余量
            }
            finally
            {
                HCStyle.DestroyStyleCanvas(vCanvas);
            }
        }
Exemplo n.º 23
0
 public override void Assign(HCCustomItem source)
 {
     base.Assign(source);
     FFormat   = (source as HCDateTimePicker).Format;
     FDateTime = (source as HCDateTimePicker).DateTime;
 }
Exemplo n.º 24
0
        private void UndoRedoItemProperty(HCCustomUndoAction aAction, bool aIsUndo, ref int aCaretItemNo, ref int aCaretOffset)
        {
            HCItemPropertyUndoAction vAction = aAction as HCItemPropertyUndoAction;

            aCaretItemNo = vAction.ItemNo;
            aCaretOffset = vAction.Offset;
            HCCustomItem vItem = Items[vAction.ItemNo];

            switch (vAction.ItemProperty)
            {
            case ItemProperty.uipStyleNo:
            {
                if (aIsUndo)
                {
                    vItem.StyleNo = (vAction as HCItemStyleUndoAction).OldStyleNo;
                }
                else
                {
                    vItem.StyleNo = (vAction as HCItemStyleUndoAction).NewStyleNo;
                }
            }
            break;

            case ItemProperty.uipParaNo:
            {
                int vParaLastItemNo = GetParaLastItemNo(vAction.ItemNo);
                if (aIsUndo)
                {
                    for (int i = vAction.ItemNo; i <= vParaLastItemNo; i++)
                    {
                        Items[i].ParaNo = (vAction as HCItemParaUndoAction).OldParaNo;
                    }
                }
                else
                {
                    for (int i = vAction.ItemNo; i <= vParaLastItemNo; i++)
                    {
                        Items[i].ParaNo = (vAction as HCItemParaUndoAction).NewParaNo;
                    }
                }
            }
            break;

            case ItemProperty.uipParaFirst:
            {
                if (aIsUndo)
                {
                    vItem.ParaFirst = (vAction as HCItemParaFirstUndoAction).OldParaFirst;
                }
                else
                {
                    vItem.ParaFirst = (vAction as HCItemParaFirstUndoAction).NewParaFirst;
                }
            }
            break;

            case ItemProperty.uipPageBreak:
            {
                FForceClearExtra = true;

                if (aIsUndo)
                {
                    vItem.PageBreak = (vAction as HCItemPageBreakUndoAction).OldPageBreak;
                }
                else
                {
                    vItem.PageBreak = (vAction as HCItemPageBreakUndoAction).NewPageBreak;
                }
            }
            break;
            }
        }
Exemplo n.º 25
0
        private void UndoRedoInsertItem(HCCustomUndo aUndo, HCCustomUndoAction aAction, bool aIsUndo, ref int aCaretItemNo, ref int aCaretOffset, ref int aCaretDrawItemNo)
        {
            HCItemUndoAction vAction = aAction as HCItemUndoAction;

            aCaretItemNo = vAction.ItemNo;

            if (aIsUndo)
            {
                if (aCaretItemNo < Items.Count - 1)    // 不是最后一个
                {
                    if (Items[aCaretItemNo].ParaFirst) // 段首删除了,光标为下一个开始
                    {
                        aCaretOffset     = 0;
                        aCaretDrawItemNo = Items[aCaretItemNo + 1].FirstDItemNo;
                    }
                    else  // 删除的不是段首
                    //if (Items[aCaretItemNo + 1].ParaFirst)  // 下一个是段首,光标保持在同段最后
                    {
                        aCaretItemNo--;
                        if (Items[aCaretItemNo].StyleNo > HCStyle.Null)
                        {
                            aCaretOffset = Items[aCaretItemNo].Length;
                        }
                        else
                        {
                            aCaretOffset = HC.OffsetAfter;
                        }

                        aCaretDrawItemNo = (aUndo as HCDataUndo).CaretDrawItemNo;// - 1;
                    }
                }
                else
                if (aCaretItemNo > 0)  // 不是第一个
                {
                    aCaretItemNo--;
                    if (Items[aCaretItemNo].StyleNo > HCStyle.Null)
                    {
                        aCaretOffset = Items[aCaretItemNo].Length;
                    }
                    else
                    {
                        aCaretOffset = HC.OffsetAfter;
                    }

                    aCaretDrawItemNo = (aUndo as HCDataUndo).CaretDrawItemNo - 1;
                }
                else
                {
                    aCaretOffset = 0;
                }

                Items.RemoveAt(vAction.ItemNo);
                FItemAddCount--;
            }
            else  // 重做
            {
                HCCustomItem vItem = null;
                LoadItemFromStreamAlone(vAction.ItemStream, ref vItem);
                Items.Insert(vAction.ItemNo, vItem);
                FItemAddCount++;

                aCaretItemNo = vAction.ItemNo;
                if (Items[aCaretItemNo].StyleNo > HCStyle.Null)
                {
                    aCaretOffset = Items[aCaretItemNo].Length;
                }
                else
                {
                    aCaretOffset = HC.OffsetAfter;
                }

                aCaretDrawItemNo = (aUndo as HCDataUndo).CaretDrawItemNo + 1;
            }
        }
Exemplo n.º 26
0
 public void SaveItemToStreamAlone(Stream aStream, HCCustomItem aItem)
 {
     HC._SaveFileFormatAndVersion(aStream);
     Style.SaveToStream(aStream);
     aItem.SaveToStream(aStream);
 }
Exemplo n.º 27
0
        private void SetActiveToolItem(HCCustomItem aItem)
        {
            // MouseDown里会触发重绘,此时ToolBar并未确定显示,处理ToolBar的Visible属性
            // 会重新触发重绘,重绘是通过DoImageToolBarUpdateView(Rect),需要先计算区域参数
            // 然后触发UpdateView,所以需要提前计算ToolBar的坐标vPt位置
            if (FActiveItem != aItem)
            {
                if (FUseTableTool && (FActiveItem is HCTableItem))
                {
                    FTableToolBar.Visible = false;
                }
                else
                if (FUseImageTool && (FActiveItem is HCImageItem))
                {
                    FImageToolBar.Visible = false;
                }

                if ((aItem != null) && (aItem.Active))
                {
                    POINT vPt = this.GetTopLevelRectDrawItemViewCoord();

                    if (FUseTableTool && (aItem is HCTableItem) && (FTableToolBar.Controls.Count > 0))
                    {
                        FActiveItem           = aItem;
                        FTableToolBar.Left    = vPt.X - FTableToolBar.Width + FToolOffset;
                        FTableToolBar.Top     = vPt.Y;// - FTableToolBar.Height + FToolOffset;
                        FTableToolBar.Visible = true;
                    }
                    else
                    if (FUseImageTool && (aItem is HCImageItem) && (FImageToolBar.Controls.Count > 0))
                    {
                        FActiveItem = aItem;
                        (FActiveItem as HCImageItem).ShapeManager.OnStructOver = DoImageShapeStructOver;
                        FImageToolBar.Left    = vPt.X;
                        FImageToolBar.Top     = vPt.Y - FImageToolBar.Height + FToolOffset;
                        FImageToolBar.Visible = true;
                    }
                    else
                    {
                        FActiveItem = null;
                    }
                }
                else
                {
                    FActiveItem = null;
                }
            }
            else
            if ((FActiveItem != null) && (!FActiveItem.Active))
            {
                if (FUseTableTool && (FActiveItem is HCTableItem))
                {
                    FTableToolBar.Visible = false;
                }
                else
                if (FUseImageTool && (FActiveItem is HCImageItem))
                {
                    FImageToolBar.Visible = false;
                }

                FActiveItem = null;
            }
        }
Exemplo n.º 28
0
 public override void Assign(HCCustomItem source)
 {
     base.Assign(source);
     FText = (source as HCTextItem).Text;
 }
Exemplo n.º 29
0
 protected override void DoSectionRemoveItem(object sender, HCCustomData aData, HCCustomItem aItem)
 {
     base.DoSectionRemoveItem(sender, aData, aItem);
     if (aItem == FActiveItem)
     {
         FState = HCToolState.hcsRemoveItem;
         try
         {
             CancelActiveToolItem();
         }
         finally
         {
             FState = HCToolState.hcsNone;
         }
     }
 }
Exemplo n.º 30
0
 public override void Assign(HCCustomItem source)
 {
     base.Assign(source);
     FImage = new Bitmap((source as HCImageItem).Image);
 }