From 32e5770be9fe51c4046a63527475eb8f062bc931 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Thu, 18 Jun 2015 13:56:08 +0300 Subject: [PATCH] Added "Preferences" menu item --- CrossBench/CrossBench.mk | 2 +- wxCrossGen/FormBuilderGUI.fbp | 15 +++++++++++++++ wxCrossGen/fbgui/fbgui.cpp | 6 ++++++ wxCrossGen/fbgui/fbgui.h | 1 + wxCrossGen/main.cpp | 6 +++++- wxCrossGen/wxCrossGen.mk | 2 +- wxCrossGen/wxgui.hpp | 1 + 7 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CrossBench/CrossBench.mk b/CrossBench/CrossBench.mk index 12fa393..7e7e00e 100644 --- a/CrossBench/CrossBench.mk +++ b/CrossBench/CrossBench.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Aleksey Lobanov -Date :=17/06/15 +Date :=18/06/15 CodeLitePath :="/home/alex/.codelite" LinkerName :=/usr/bin/g++-4.8 SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC diff --git a/wxCrossGen/FormBuilderGUI.fbp b/wxCrossGen/FormBuilderGUI.fbp index 5018954..417ffa4 100644 --- a/wxCrossGen/FormBuilderGUI.fbp +++ b/wxCrossGen/FormBuilderGUI.fbp @@ -172,6 +172,21 @@ onExportClick + + + 0 + 1 + + wxID_PREFERENCES + wxITEM_NORMAL + &Preferences + miPreferences + none + + + onPreferencesClick + + 0 diff --git a/wxCrossGen/fbgui/fbgui.cpp b/wxCrossGen/fbgui/fbgui.cpp index f5f449f..143de9c 100644 --- a/wxCrossGen/fbgui/fbgui.cpp +++ b/wxCrossGen/fbgui/fbgui.cpp @@ -27,6 +27,10 @@ VMainFrame::VMainFrame( wxWindow* parent, wxWindowID id, const wxString& title, miExport = new wxMenuItem( miFile, wxID_EXPORT, wxString( _("&Export") ) , wxEmptyString, wxITEM_NORMAL ); miFile->Append( miExport ); + wxMenuItem* miPreferences; + miPreferences = new wxMenuItem( miFile, wxID_PREFERENCES, wxString( _("&Preferences ") ) , wxEmptyString, wxITEM_NORMAL ); + miFile->Append( miPreferences ); + wxMenuItem* miExit; miExit = new wxMenuItem( miFile, wxID_EXIT, wxString( _("E&xit") ) + wxT('\t') + wxT("Ctrl+Q"), wxEmptyString, wxITEM_NORMAL ); miFile->Append( miExit ); @@ -86,6 +90,7 @@ VMainFrame::VMainFrame( wxWindow* parent, wxWindowID id, const wxString& title, this->Connect( miOpenGrid->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onOpenGridClick ) ); this->Connect( miGenerate->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onGenerateClick ) ); this->Connect( miExport->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExportClick ) ); + this->Connect( miPreferences->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onPreferencesClick ) ); this->Connect( miExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExitClick ) ); this->Connect( miAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) ); bPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onOpenGridClick ), NULL, this ); @@ -99,6 +104,7 @@ VMainFrame::~VMainFrame() this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onOpenGridClick ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onGenerateClick ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExportClick ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onPreferencesClick ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExitClick ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) ); bPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onOpenGridClick ), NULL, this ); diff --git a/wxCrossGen/fbgui/fbgui.h b/wxCrossGen/fbgui/fbgui.h index c73374d..f95d629 100644 --- a/wxCrossGen/fbgui/fbgui.h +++ b/wxCrossGen/fbgui/fbgui.h @@ -53,6 +53,7 @@ class VMainFrame : public wxFrame virtual void onOpenGridClick( wxCommandEvent& event ) { event.Skip(); } virtual void onGenerateClick( wxCommandEvent& event ) { event.Skip(); } virtual void onExportClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onPreferencesClick( wxCommandEvent& event ) { event.Skip(); } virtual void onExitClick( wxCommandEvent& event ) { event.Skip(); } virtual void onAboutClick( wxCommandEvent& event ) { event.Skip(); } diff --git a/wxCrossGen/main.cpp b/wxCrossGen/main.cpp index 5953d2d..077cc4c 100644 --- a/wxCrossGen/main.cpp +++ b/wxCrossGen/main.cpp @@ -23,7 +23,7 @@ void MainFrame::onOpenGridClick(wxCommandEvent &event) { // this can be done with e.g. wxWidgets input streams: wxFileInputStream input_stream(dlgOpen.GetPath()); if ( !input_stream.IsOk() ) { - wxLogError(_("Cannot open file ")+dlgOpen.GetPath()); + wxLogError(_("Cannot open file ") + dlgOpen.GetPath()); return; } tPath->SetValue(dlgOpen.GetPath()); @@ -177,6 +177,10 @@ void MainFrame::onExportClick(wxCommandEvent& event) { wxLogDebug(wxT("Exporting to ") + dlgSave.GetPath() + wxT(" is complete")); } +void MainFrame::onPreferencesClick( wxCommandEvent& event ){ + +} + class MyApp: public wxApp { public: bool OnInit(); diff --git a/wxCrossGen/wxCrossGen.mk b/wxCrossGen/wxCrossGen.mk index 9b84faa..e9fa56b 100644 --- a/wxCrossGen/wxCrossGen.mk +++ b/wxCrossGen/wxCrossGen.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Aleksey Lobanov -Date :=17/06/15 +Date :=18/06/15 CodeLitePath :="/home/alex/.codelite" LinkerName :=/usr/bin/g++-4.8 SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC diff --git a/wxCrossGen/wxgui.hpp b/wxCrossGen/wxgui.hpp index 079fdb5..503299d 100644 --- a/wxCrossGen/wxgui.hpp +++ b/wxCrossGen/wxgui.hpp @@ -45,6 +45,7 @@ public: void onExitClick( wxCloseEvent& event ) { event.Skip(); } void onOpenGridClick( wxCommandEvent& event ); void onGenerateClick( wxCommandEvent& event ); + void onPreferencesClick( wxCommandEvent& event ); void onExportClick( wxCommandEvent& event ); void onExitClick( wxCommandEvent& event ) { event.Skip(); } void onAboutClick( wxCommandEvent& event ) {