Exemplo n.º 1
0
 protected virtual void DoSelfUndoDestroy(HCUndo aUndo)
 {
     if (aUndo.Data != null)
     {
         aUndo.Data.Dispose();
     }
 }
Exemplo n.º 2
0
 protected virtual void DoUndoDestroy(HCUndo Sender)
 {
     if (Sender.Data != null)
     {
         Sender.Data.Dispose();
     }
 }
Exemplo n.º 3
0
        protected void DoRedo(HCUndo sender)
        {
            if (sender is HCEditUndo)
            {
                FHScrollBar.Position = (sender as HCEditUndo).HScrollPos;
                FVScrollBar.Position = (sender as HCEditUndo).VScrollPos;
            }
            else
            if (sender is HCUndoEditGroupBegin)
            {
                FHScrollBar.Position = (sender as HCUndoEditGroupBegin).HScrollPos;
                FVScrollBar.Position = (sender as HCUndoEditGroupBegin).VScrollPos;
            }

            HCUndoList vUndoList = DoGetUndoList();

            if (!vUndoList.GroupWorking)
            {
                HCFunction vEvent = delegate()
                {
                    FData.Redo(sender);
                    return(true);
                };

                DataChangeByAction(vEvent);
            }
            else
            {
                FData.Redo(sender);
            }
        }
Exemplo n.º 4
0
        protected override void DoSelfUndoDestroy(HCUndo aUndo)
        {
            if (aUndo.Data is HCSizeUndoData)
            {
                (aUndo.Data as HCSizeUndoData).Dispose();
            }

            base.DoSelfUndoDestroy(aUndo);
        }
Exemplo n.º 5
0
        protected override void DoUndoDestroy(HCUndo Sender)
        {
            if (Sender.Data is HCUndoSize)
            {
                (Sender.Data as HCUndoSize).Dispose();
            }

            base.DoUndoDestroy(Sender);
        }
Exemplo n.º 6
0
        protected HCUndo DoUndoNew()
        {
            HCUndo Result = new HCUndo();

            (Result as HCEditUndo).HScrollPos = FHScrollBar.Position;
            (Result as HCEditUndo).VScrollPos = FVScrollBar.Position;
            Result.Data = FData;

            return(Result);
        }
Exemplo n.º 7
0
 protected override void DoRedo(HCUndo Sender)
 {
     if (Sender.Data is HCUndoSize)
     {
         HCUndoSize vSizeAction = Sender.Data as HCUndoSize;
         this.Width  = vSizeAction.NewWidth;
         this.Height = vSizeAction.NewHeight;
     }
     else
     {
         base.DoRedo(Sender);
     }
 }
Exemplo n.º 8
0
        protected void Undo_New()
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.UndoNew();
                if (vUndo is HCDataUndo)
                {
                    (vUndo as HCDataUndo).CaretDrawItemNo = CaretDrawItemNo;
                }
            }
        }
Exemplo n.º 9
0
        protected void UndoAction_ItemSelf(int aItemNo, int aOffset)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    vUndo.ActionAppend(HCAction.actItemSelf, aItemNo, aOffset, Items[aItemNo].ParaFirst);
                }
            }
        }
Exemplo n.º 10
0
 protected override void DoSelfRedo(HCUndo aRedo)
 {
     if (aRedo.Data is HCSizeUndoData)
     {
         HCSizeUndoData vSizeAction = aRedo.Data as HCSizeUndoData;
         this.Width  = vSizeAction.NewWidth;
         this.Height = vSizeAction.NewHeight;
     }
     else
     {
         base.DoSelfRedo(aRedo);
     }
 }
Exemplo n.º 11
0
        /// <summary> 插入Item到指定位置 </summary>
        /// <param name="AItemNo">操作发生时的ItemNo</param>
        /// <param name="AOffset">操作发生时的Offset</param>
        protected void UndoAction_InsertItem(int aItemNo, int aOffset)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCItemUndoAction vItemAction = vUndo.ActionAppend(UndoActionTag.uatInsertItem, aItemNo, aOffset,
                                                                      Items[aItemNo].ParaFirst) as HCItemUndoAction;
                    SaveItemToStreamAlone(Items[aItemNo], vItemAction.ItemStream);
                }
            }
        }
Exemplo n.º 12
0
        protected void UndoAction_ItemMirror(int aItemNo, int aOffset)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCItemUndoAction vItemAction = vUndo.ActionAppend(HCAction.actItemMirror, aItemNo, aOffset,
                                                                      Items[aItemNo].ParaFirst) as HCItemUndoAction;
                    SaveItemToStreamAlone(vItemAction.ItemStream, Items[aItemNo]);
                }
            }
        }
Exemplo n.º 13
0
        protected void UndoAction_SetItemText(int aItemNo, int aOffset, string aNewText)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCSetItemTextUndoAction vTextAction = vUndo.ActionAppend(UndoActionTag.uatSetItemText, aItemNo, aOffset,
                                                                             Items[aItemNo].ParaFirst) as HCSetItemTextUndoAction;
                    vTextAction.NewText = aNewText;
                }
            }
        }
Exemplo n.º 14
0
        protected void UndoAction_InsertText(int aItemNo, int aOffset, string aText)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCTextUndoAction vTextAction = vUndo.ActionAppend(HCAction.actInsertText, aItemNo, aOffset,
                                                                      Items[aItemNo].ParaFirst) as HCTextUndoAction;
                    vTextAction.Text = aText;
                }
            }
        }
Exemplo n.º 15
0
 // 撤销恢复相关方法
 protected void Undo_Resize(int ANewWidth, int ANewHeight)
 {
     if (OwnerData.Style.EnableUndo)
     {
         Undo_StartRecord();
         HCUndoList vUndoList = GetSelfUndoList();
         HCUndo     vUndo     = vUndoList[vUndoList.Count - 1];
         if (vUndo != null)
         {
             HCUndoSize vUndoSize = new HCUndoSize();
             vUndoSize.OldWidth  = this.Width;
             vUndoSize.OldHeight = this.Height;
             vUndoSize.NewWidth  = ANewWidth;
             vUndoSize.NewHeight = ANewHeight;
             vUndo.Data          = vUndoSize;
         }
     }
 }
Exemplo n.º 16
0
        /// <summary> 修改Item的分页属性(修改前调用) </summary>
        protected void UndoAction_ItemPageBreak(int aItemNo, int aOffset, bool aNewPageBreak)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCItemPageBreakUndoAction vItemAction = new HCItemPageBreakUndoAction();
                    vItemAction.ItemNo       = aItemNo;
                    vItemAction.Offset       = aOffset;
                    vItemAction.OldPageBreak = Items[aItemNo].PageBreak;
                    vItemAction.NewPageBreak = aNewPageBreak;

                    vUndo.Actions.Add(vItemAction);
                }
            }
        }
Exemplo n.º 17
0
        protected void UndoAction_ItemStyle(int aItemNo, int aOffset, int aNewStyleNo)
        {
            HCUndoList vUndoList = GetUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCItemStyleUndoAction vItemAction = new HCItemStyleUndoAction();
                    vItemAction.ItemNo     = aItemNo;
                    vItemAction.Offset     = aOffset;
                    vItemAction.OldStyleNo = Items[aItemNo].StyleNo;
                    vItemAction.NewStyleNo = aNewStyleNo;

                    vUndo.Actions.Add(vItemAction);
                }
            }
        }
Exemplo n.º 18
0
        // 撤销恢复相关方法
        protected void SelfUndo_Resize(int aNewWidth, int aNewHeight)
        {
            HCUndoList vUndoList = GetSelfUndoList();

            if ((vUndoList != null) && vUndoList.Enable)
            {
                SelfUndo_New();
                HCUndo vUndo = vUndoList.Last;
                if (vUndo != null)
                {
                    HCSizeUndoData vSizeUndoData = new HCSizeUndoData();
                    vSizeUndoData.OldWidth  = this.Width;
                    vSizeUndoData.OldHeight = this.Height;
                    vSizeUndoData.NewWidth  = aNewWidth;
                    vSizeUndoData.NewHeight = aNewHeight;

                    vUndo.Data = vSizeUndoData;
                }
            }
        }
Exemplo n.º 19
0
 protected virtual void DoSelfUndo(HCUndo aUndo)
 {
 }
Exemplo n.º 20
0
 protected virtual void DoUndo(HCUndo Sender)
 {
 }
Exemplo n.º 21
0
 protected virtual void DoRedo(HCUndo Sende)
 {
 }
Exemplo n.º 22
0
 protected virtual void DoSelfRedo(HCUndo aRedo)
 {
 }