]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/configtool/src/mainframe.cpp
added precomp-headers-exclude (DSP files only so far) and fixed dependencies for...
[wxWidgets.git] / utils / configtool / src / mainframe.cpp
index 5e967a397683124a17bba547850baacc42033aeb..bfd09b31e75010dba849b613467a6113b432f736 100644 (file)
@@ -9,6 +9,10 @@
 // Licence:
 /////////////////////////////////////////////////////////////////////////////
 
+#ifdef __GNUG__
+#pragma implementation "mainframe.h"
+#endif
+
 #include "wx/wx.h"
 
 #ifdef __BORLANDC__
@@ -42,6 +46,7 @@
 #include "bitmaps/undo.xpm"
 #include "bitmaps/redo.xpm"
 #include "bitmaps/helpcs.xpm"
+#include "bitmaps/go.xpm"
 
 IMPLEMENT_CLASS(ctMainFrame, wxDocParentFrame)
 
@@ -76,6 +81,10 @@ BEGIN_EVENT_TABLE(ctMainFrame, wxDocParentFrame)
 
     EVT_UPDATE_UI(ctID_SAVE_SETUP_FILE, ctMainFrame::OnUpdateDisable)
     EVT_UPDATE_UI(ctID_SAVE_CONFIGURE_COMMAND, ctMainFrame::OnUpdateDisable)
+
+    EVT_UPDATE_UI(wxID_FIND, ctMainFrame::OnUpdateDisable)
+
+    EVT_UPDATE_UI(ctID_GO, ctMainFrame::OnUpdateDisable)
 END_EVENT_TABLE()
 
 // Define my frame constructor
@@ -88,6 +97,7 @@ ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id,
     m_configurePage = NULL;
     m_setupPage = NULL;
     m_mainNotebook = NULL;
+    m_findDialog = NULL;
 
     m_treeSplitterWindow = new wxSplitterWindow(this, -1, wxDefaultPosition, wxSize(400, 300),
         wxSP_3DSASH|wxSP_3DBORDER);
@@ -147,6 +157,12 @@ void ctMainFrame::OnCloseWindow(wxCloseEvent& event)
         }
     }
 
+    if (m_findDialog)
+    {
+        m_findDialog->Destroy();
+        m_findDialog = NULL;
+    }
+
     Show(FALSE);
 
     if (IsMaximized())
@@ -173,7 +189,7 @@ void ctMainFrame::OnAbout(wxCommandEvent& event)
 {
     wxString msg = wxGetApp().GetSettings().GetAppName() + wxT(" (c) Julian Smart");
     wxString caption = wxT("About ") + wxGetApp().GetSettings().GetAppName();
-    wxMessageBox(msg, caption, wxID_OK|wxICON_INFORMATION);
+    wxMessageBox(msg, caption, wxOK|wxICON_INFORMATION);
 }
 
 void ctMainFrame::OnOpen(wxCommandEvent& event)
@@ -209,7 +225,7 @@ void ctMainFrame::InitToolBar(wxToolBar* toolBar)
     toolBarBitmaps[3] = wxBitmap(copy_xpm);
     toolBarBitmaps[4] = wxBitmap(cut_xpm);
     toolBarBitmaps[5] = wxBitmap(paste_xpm);
-    toolBarBitmaps[6] = wxBitmap(print_xpm);
+    toolBarBitmaps[6] = wxBitmap(go_xpm);
     toolBarBitmaps[7] = wxBitmap(help_xpm);
     toolBarBitmaps[10] = wxBitmap(undo_xpm);
     toolBarBitmaps[11] = wxBitmap(redo_xpm);
@@ -228,6 +244,8 @@ void ctMainFrame::InitToolBar(wxToolBar* toolBar)
     toolBar->AddTool(wxID_UNDO, toolBarBitmaps[10], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Undo"));
     toolBar->AddTool(wxID_REDO, toolBarBitmaps[11], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Redo"));
     toolBar->AddSeparator();
+    toolBar->AddTool(ctID_GO, toolBarBitmaps[6], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Save setup.h or configurewx.sh"));
+    toolBar->AddSeparator();
     toolBar->AddTool(ctID_ITEM_HELP, toolBarBitmaps[12], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Show help for this option"));
     toolBar->AddTool(wxID_HELP_CONTEXT, toolBarBitmaps[13], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Show help on the clicked item"));
 
@@ -253,6 +271,8 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
     fileMenu->Append(ctID_SAVE_SETUP_FILE, wxT("Save Setup.&h...\tCtrl+H"), wxT("Save the setup.h file"));
     fileMenu->Append(ctID_SAVE_CONFIGURE_COMMAND, wxT("Save Configure Script...\tCtrl+G"), wxT("Save the configure script file"));
     fileMenu->AppendSeparator();
+    fileMenu->Append(ctID_GO, wxT("&Go\tF5"), wxT("Quick-save the setup.h or configure.sh file"));
+    fileMenu->AppendSeparator();
     fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt+F4"), wxT("Exit the application"));
 
     wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
@@ -289,6 +309,8 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
     editMenu->AppendSeparator();
     editMenu->Append(ctID_DELETE_ITEM, _("&Delete Option"), _("Delete a configuration option"));
     editMenu->Append(ctID_RENAME_ITEM, _("&Rename Option"), _("Rename a configuration option"));
+    editMenu->AppendSeparator();
+    editMenu->Append(wxID_FIND, _("&Find...\tCtrl+F"), _("Search for a string in the settings document"));
 
     // Save for the command processor.
     m_editMenu = editMenu;