Added "Preferences" menu item

This commit is contained in:
2015-06-18 13:56:08 +03:00
parent 83efb62a9f
commit 32e5770be9
7 changed files with 30 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ CurrentFileName :=
CurrentFilePath := CurrentFilePath :=
CurrentFileFullPath := CurrentFileFullPath :=
User :=Aleksey Lobanov User :=Aleksey Lobanov
Date :=17/06/15 Date :=18/06/15
CodeLitePath :="/home/alex/.codelite" CodeLitePath :="/home/alex/.codelite"
LinkerName :=/usr/bin/g++-4.8 LinkerName :=/usr/bin/g++-4.8
SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC

View File

@@ -172,6 +172,21 @@
<event name="OnMenuSelection">onExportClick</event> <event name="OnMenuSelection">onExportClick</event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
<object class="wxMenuItem" expanded="1">
<property name="bitmap"></property>
<property name="checked">0</property>
<property name="enabled">1</property>
<property name="help"></property>
<property name="id">wxID_PREFERENCES</property>
<property name="kind">wxITEM_NORMAL</property>
<property name="label">&amp;Preferences </property>
<property name="name">miPreferences</property>
<property name="permission">none</property>
<property name="shortcut"></property>
<property name="unchecked_bitmap"></property>
<event name="OnMenuSelection">onPreferencesClick</event>
<event name="OnUpdateUI"></event>
</object>
<object class="wxMenuItem" expanded="1"> <object class="wxMenuItem" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="checked">0</property> <property name="checked">0</property>

View File

@@ -27,6 +27,10 @@ VMainFrame::VMainFrame( wxWindow* parent, wxWindowID id, const wxString& title,
miExport = new wxMenuItem( miFile, wxID_EXPORT, wxString( _("&Export") ) , wxEmptyString, wxITEM_NORMAL ); miExport = new wxMenuItem( miFile, wxID_EXPORT, wxString( _("&Export") ) , wxEmptyString, wxITEM_NORMAL );
miFile->Append( miExport ); miFile->Append( miExport );
wxMenuItem* miPreferences;
miPreferences = new wxMenuItem( miFile, wxID_PREFERENCES, wxString( _("&Preferences ") ) , wxEmptyString, wxITEM_NORMAL );
miFile->Append( miPreferences );
wxMenuItem* miExit; wxMenuItem* miExit;
miExit = new wxMenuItem( miFile, wxID_EXIT, wxString( _("E&xit") ) + wxT('\t') + wxT("Ctrl+Q"), wxEmptyString, wxITEM_NORMAL ); miExit = new wxMenuItem( miFile, wxID_EXIT, wxString( _("E&xit") ) + wxT('\t') + wxT("Ctrl+Q"), wxEmptyString, wxITEM_NORMAL );
miFile->Append( miExit ); 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( miOpenGrid->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onOpenGridClick ) );
this->Connect( miGenerate->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onGenerateClick ) ); this->Connect( miGenerate->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onGenerateClick ) );
this->Connect( miExport->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExportClick ) ); 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( miExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onExitClick ) );
this->Connect( miAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) ); this->Connect( miAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) );
bPath->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onOpenGridClick ), NULL, this ); 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::onOpenGridClick ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onGenerateClick ) ); 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::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::onExitClick ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( VMainFrame::onAboutClick ) );
bPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onOpenGridClick ), NULL, this ); bPath->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VMainFrame::onOpenGridClick ), NULL, this );

View File

@@ -53,6 +53,7 @@ class VMainFrame : public wxFrame
virtual void onOpenGridClick( wxCommandEvent& event ) { event.Skip(); } virtual void onOpenGridClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onGenerateClick( wxCommandEvent& event ) { event.Skip(); } virtual void onGenerateClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onExportClick( 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 onExitClick( wxCommandEvent& event ) { event.Skip(); }
virtual void onAboutClick( wxCommandEvent& event ) { event.Skip(); } virtual void onAboutClick( wxCommandEvent& event ) { event.Skip(); }

View File

@@ -23,7 +23,7 @@ void MainFrame::onOpenGridClick(wxCommandEvent &event) {
// this can be done with e.g. wxWidgets input streams: // this can be done with e.g. wxWidgets input streams:
wxFileInputStream input_stream(dlgOpen.GetPath()); wxFileInputStream input_stream(dlgOpen.GetPath());
if ( !input_stream.IsOk() ) { if ( !input_stream.IsOk() ) {
wxLogError(_("Cannot open file ")+dlgOpen.GetPath()); wxLogError(_("Cannot open file ") + dlgOpen.GetPath());
return; return;
} }
tPath->SetValue(dlgOpen.GetPath()); tPath->SetValue(dlgOpen.GetPath());
@@ -177,6 +177,10 @@ void MainFrame::onExportClick(wxCommandEvent& event) {
wxLogDebug(wxT("Exporting to ") + dlgSave.GetPath() + wxT(" is complete")); wxLogDebug(wxT("Exporting to ") + dlgSave.GetPath() + wxT(" is complete"));
} }
void MainFrame::onPreferencesClick( wxCommandEvent& event ){
}
class MyApp: public wxApp { class MyApp: public wxApp {
public: public:
bool OnInit(); bool OnInit();

View File

@@ -13,7 +13,7 @@ CurrentFileName :=
CurrentFilePath := CurrentFilePath :=
CurrentFileFullPath := CurrentFileFullPath :=
User :=Aleksey Lobanov User :=Aleksey Lobanov
Date :=17/06/15 Date :=18/06/15
CodeLitePath :="/home/alex/.codelite" CodeLitePath :="/home/alex/.codelite"
LinkerName :=/usr/bin/g++-4.8 LinkerName :=/usr/bin/g++-4.8
SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC

View File

@@ -45,6 +45,7 @@ public:
void onExitClick( wxCloseEvent& event ) { event.Skip(); } void onExitClick( wxCloseEvent& event ) { event.Skip(); }
void onOpenGridClick( wxCommandEvent& event ); void onOpenGridClick( wxCommandEvent& event );
void onGenerateClick( wxCommandEvent& event ); void onGenerateClick( wxCommandEvent& event );
void onPreferencesClick( wxCommandEvent& event );
void onExportClick( wxCommandEvent& event ); void onExportClick( wxCommandEvent& event );
void onExitClick( wxCommandEvent& event ) { event.Skip(); } void onExitClick( wxCommandEvent& event ) { event.Skip(); }
void onAboutClick( wxCommandEvent& event ) { void onAboutClick( wxCommandEvent& event ) {