Esempio n. 1
0
        private void ProjectMainForm_Load(object sender, EventArgs e)
        {
            TabMgr.ResizeMainForm(this);

            m_tabs = new TabMgr[(int)TabMgr.TabId.MAX];

            TabMgr tabSprites = new TabMgr(this, TabMgr.TabId.Sprites);

            m_tabs[(int)TabMgr.TabId.Sprites] = tabSprites;

            TabMgr tabBackgroundMaps = new TabMgr(this, TabMgr.TabId.BackgroundMaps);

            m_tabs[(int)TabMgr.TabId.BackgroundMaps] = tabBackgroundMaps;

            TabMgr tabBackgroundImages = new TabMgr(this, TabMgr.TabId.BackgroundImages);

            m_tabs[(int)TabMgr.TabId.BackgroundImages] = tabBackgroundImages;

            m_tabCurrent         = tabSprites;
            tabSet.SelectedIndex = (int)m_tabCurrent.Id;

            AddProjectMenuItems();
            AddSubwindowsToTabs();
            HandleEverythingChanged();

            m_undoHistory      = new UndoHistoryForm(this);
            UndoHistoryVisible = false;
            ClearUndo();

            m_doc.HasUnsavedChanges = false;

            // Add an
            Application.Idle += new EventHandler(OnIdle);
        }
Esempio n. 2
0
        public void SetCurrent(TabMgr.TabId id, int nIndex)
        {
            ListBox lb = GetListbox(id);

            if (nIndex >= lb.Items.Count)
                return;
            lb.SelectedIndex = nIndex;
        }
Esempio n. 3
0
        private void tabSet_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Hide windows from old tab.
            m_tabCurrent.HideWindows();

            // Show windws for new tab.
            m_tabCurrent = m_tabs[tabSet.SelectedIndex];
            m_tabCurrent.ShowWindows();
        }
Esempio n. 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;
 }
Esempio n. 5
0
        public void AddSubwindowsToTabs()
        {
            TabMgr tabSprites = GetTab(TabMgr.TabId.Sprites);

            tabSprites.AddSpritesetWindow(m_doc.Spritesets.Current.SpritesetWindow);
            tabSprites.AddSpriteWindow(m_doc.Spritesets.Current.SpriteWindow);
            tabSprites.AddPaletteWindow(m_doc.Palettes.CurrentPalette.PaletteWindowForm());
            tabSprites.ArrangeWindows();

            TabMgr tabBackgroundMaps = GetTab(TabMgr.TabId.BackgroundMaps);

            tabBackgroundMaps.AddSpritesetWindow(m_doc.BackgroundSpritesets.Current.SpritesetWindow);
            tabBackgroundMaps.AddSpriteWindow(m_doc.BackgroundSpritesets.Current.SpriteWindow);
            tabBackgroundMaps.AddPaletteWindow(m_doc.BackgroundPalettes.CurrentPalette.PaletteWindowForm());
            tabBackgroundMaps.AddMapWindow(m_doc.BackgroundMaps.CurrentMap.MapWindow);
            tabBackgroundMaps.ArrangeWindows();

            TabMgr tabBackgroundImages = GetTab(TabMgr.TabId.BackgroundImages);

            tabBackgroundImages.AddBgImageListWindow(m_doc.BackgroundImages.BgImageListWindow);
            tabBackgroundImages.AddBgImageWindow(m_doc.BackgroundImages.BgImageWindow);
            tabBackgroundImages.ArrangeWindows();
        }
Esempio n. 6
0
 public void Remove(TabMgr.TabId id, int nIndex)
 {
     ListBox lb = GetListbox(id);
     lb.Items.RemoveAt(nIndex);
 }
Esempio n. 7
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);
 }
Esempio n. 8
0
        private void tabSet_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Hide windows from old tab.
            m_tabCurrent.HideWindows();

            // Show windws for new tab.
            m_tabCurrent = m_tabs[tabSet.SelectedIndex];
            m_tabCurrent.ShowWindows();
        }
Esempio n. 9
0
 public void Add(TabMgr.TabId id, UndoAction action)
 {
     ListBox lb = GetListbox(id);
     lb.Items.Add(action.Description);
 }
Esempio n. 10
0
 public void SetCurrentUndo(TabMgr.TabId id, int nCurrent)
 {
     m_undoHistory.SetCurrent(id, nCurrent);
 }
Esempio n. 11
0
        private void ProjectMainForm_Load(object sender, EventArgs e)
        {
            TabMgr.ResizeMainForm(this);

            m_tabs = new TabMgr[(int)TabMgr.TabId.MAX];

            TabMgr tabSprites = new TabMgr(this, TabMgr.TabId.Sprites);
            m_tabs[(int)TabMgr.TabId.Sprites] = tabSprites;

            TabMgr tabBackgroundMaps = new TabMgr(this, TabMgr.TabId.BackgroundMaps);
            m_tabs[(int)TabMgr.TabId.BackgroundMaps] = tabBackgroundMaps;

            TabMgr tabBackgroundImages = new TabMgr(this, TabMgr.TabId.BackgroundImages);
            m_tabs[(int)TabMgr.TabId.BackgroundImages] = tabBackgroundImages;

            m_tabCurrent = tabSprites;
            tabSet.SelectedIndex = (int)m_tabCurrent.Id;

            AddProjectMenuItems();
            AddSubwindowsToTabs();
            HandleEverythingChanged();

            m_undoHistory = new UndoHistoryForm(this);
            UndoHistoryVisible = false;
            ClearUndo();

            m_doc.HasUnsavedChanges = false;

            // Add an
            Application.Idle += new EventHandler(OnIdle);
        }
Esempio n. 12
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);
 }
Esempio n. 13
0
 public void RemoveUndo(TabMgr.TabId id, int nIndex)
 {
     m_undoHistory.Remove(id, nIndex);
 }
Esempio n. 14
0
 public TabMgr GetTab(TabMgr.TabId id)
 {
     return m_tabs[(int)id];
 }
Esempio n. 15
0
 public void AddUndo(TabMgr.TabId id, UndoAction action)
 {
     m_undoHistory.Add(id, action);
 }
Esempio n. 16
0
 public UndoMgr(ProjectMainForm owner, TabMgr.TabId id)
 {
     m_owner = owner;
     m_id = id;
     m_history = new List<UndoAction>();
     m_nCurrent = -1;
 }