Patch #945 2006-03-19 23:16

thenullinator

Added "Swap header/source" to editor tab context menu
Download
945-Added_Swap_head.patch (2.2 KB)
Category
Application::FeatureAdd
Status
Accepted
Close date
2006-03-22 13:13
Assigned to
 
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp    (revision 2215)
+++ src/sdk/editormanager.cpp    (working copy)
@@ -100,6 +100,7 @@
 static const int idNBTabCloseAllOthers = wxNewId();
 static const int idNBTabSave = wxNewId();
 static const int idNBTabSaveAll = wxNewId();
+static const int idNBSwapHeaderSource = wxNewId();
 static const int idNBTabTop = wxNewId();
 static const int idNBTabBottom = wxNewId();
 static const int idNB = wxNewId();
@@ -173,6 +174,7 @@
     EVT_MENU(idNBTabCloseAllOthers, EditorManager::OnCloseAllOthers)
     EVT_MENU(idNBTabSave, EditorManager::OnSave)
     EVT_MENU(idNBTabSaveAll, EditorManager::OnSaveAll)
+    EVT_MENU(idNBSwapHeaderSource, EditorManager::OnSwapHeaderSource)
     EVT_MENU(idEditorManagerCheckFiles, EditorManager::OnCheckForModifiedFiles)
 #ifdef USE_OPENFILES_TREE
     EVT_UPDATE_UI(ID_EditorManager, EditorManager::OnUpdateUI)
@@ -1752,6 +1754,8 @@
     pop->Append(idNBTabSave, _("Save"));
     pop->Append(idNBTabSaveAll, _("Save all"));
     pop->AppendSeparator();
+    pop->Append(idNBSwapHeaderSource, _("Swap header/source"));
+    pop->AppendSeparator();
     pop->Append(idNBTabTop, _("Tabs at top"));
     pop->Append(idNBTabBottom, _("Tabs at bottom"));
 
@@ -1799,6 +1803,11 @@
     Manager::Get()->GetEditorManager()->SaveAll();
 }
 
+void EditorManager::OnSwapHeaderSource(wxCommandEvent& event)
+{
+    Manager::Get()->GetEditorManager()->SwapActiveHeaderSource();
+}
+
 void EditorManager::OnTabPosition(wxCommandEvent& event)
 {
     long style = m_pNotebook->GetWindowStyleFlag();
Index: src/sdk/editormanager.h
===================================================================
--- src/sdk/editormanager.h    (revision 2215)
+++ src/sdk/editormanager.h    (working copy)
@@ -140,6 +140,7 @@
         void OnCloseAllOthers(wxCommandEvent& event);
         void OnSave(wxCommandEvent& event);
         void OnSaveAll(wxCommandEvent& event);
+        void OnSwapHeaderSource(wxCommandEvent& event);
         void OnTabPosition(wxCommandEvent& event);
         void OnAppDoneStartup(wxCommandEvent& event);
         void OnAppStartShutdown(wxCommandEvent& event);