Beispiel #1
0
 public UndoMgr(ProjectMainForm owner, TabMgr.TabId id)
 {
     m_owner    = owner;
     m_id       = id;
     m_history  = new List <UndoAction>();
     m_nCurrent = -1;
 }
Beispiel #2
0
        public void RemoveRange(TabMgr.TabId id, int nStart, int nCount)
        {
            ListBox lb = GetListbox(id);

            for (int i = 0; i < nCount; i++)
            {
                lb.Items.RemoveAt(nStart);
            }
        }
Beispiel #3
0
        public void SetCurrent(TabMgr.TabId id, int nIndex)
        {
            ListBox lb = GetListbox(id);

            if (nIndex >= lb.Items.Count)
            {
                return;
            }
            lb.SelectedIndex = nIndex;
        }
Beispiel #4
0
        /// <summary>
        /// Get the listbox associated with the given tab id.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        private ListBox GetListbox(TabMgr.TabId id)
        {
            switch (id)
            {
            case TabMgr.TabId.Sprites:
                return(lbSprites);

            case TabMgr.TabId.BackgroundMaps:
                return(lbBackgroundMaps);

            case TabMgr.TabId.BackgroundImages:
                return(lbBackgroundImages);
            }
            return(null);
        }
Beispiel #5
0
        public void Remove(TabMgr.TabId id, int nIndex)
        {
            ListBox lb = GetListbox(id);

            lb.Items.RemoveAt(nIndex);
        }
Beispiel #6
0
        public void Add(TabMgr.TabId id, UndoAction action)
        {
            ListBox lb = GetListbox(id);

            lb.Items.Add(action.Description);
        }
Beispiel #7
0
 public void SetCurrentUndo(TabMgr.TabId id, int nCurrent)
 {
     m_undoHistory.SetCurrent(id, nCurrent);
 }
Beispiel #8
0
 /// <summary>
 /// Remove a range of undo actions.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="nStart">Index of the first undo action to remove</param>
 /// <param name="nCount">Number of undo actions to remove</param>
 public void RemoveUndoRange(TabMgr.TabId id, int nStart, int nCount)
 {
     m_undoHistory.RemoveRange(id, nStart, nCount);
 }
Beispiel #9
0
 public void RemoveUndo(TabMgr.TabId id, int nIndex)
 {
     m_undoHistory.Remove(id, nIndex);
 }
Beispiel #10
0
 public void AddUndo(TabMgr.TabId id, UndoAction action)
 {
     m_undoHistory.Add(id, action);
 }
Beispiel #11
0
 public TabMgr GetTab(TabMgr.TabId id)
 {
     return(m_tabs[(int)id]);
 }
Beispiel #12
0
 public UndoMgr(ProjectMainForm owner, TabMgr.TabId id)
 {
     m_owner = owner;
     m_id = id;
     m_history = new List<UndoAction>();
     m_nCurrent = -1;
 }