public UndoMgr(ProjectMainForm owner, TabMgr.TabId id) { m_owner = owner; m_id = id; m_history = new List <UndoAction>(); m_nCurrent = -1; }
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); } }
public void SetCurrent(TabMgr.TabId id, int nIndex) { ListBox lb = GetListbox(id); if (nIndex >= lb.Items.Count) { return; } lb.SelectedIndex = nIndex; }
/// <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); }
public void Remove(TabMgr.TabId id, int nIndex) { ListBox lb = GetListbox(id); lb.Items.RemoveAt(nIndex); }
public void Add(TabMgr.TabId id, UndoAction action) { ListBox lb = GetListbox(id); lb.Items.Add(action.Description); }
public void SetCurrentUndo(TabMgr.TabId id, int nCurrent) { m_undoHistory.SetCurrent(id, nCurrent); }
/// <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); }
public void RemoveUndo(TabMgr.TabId id, int nIndex) { m_undoHistory.Remove(id, nIndex); }
public void AddUndo(TabMgr.TabId id, UndoAction action) { m_undoHistory.Add(id, action); }
public TabMgr GetTab(TabMgr.TabId id) { return(m_tabs[(int)id]); }
public UndoMgr(ProjectMainForm owner, TabMgr.TabId id) { m_owner = owner; m_id = id; m_history = new List<UndoAction>(); m_nCurrent = -1; }