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 :=
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

View File

@@ -172,6 +172,21 @@
<event name="OnMenuSelection">onExportClick</event>
<event name="OnUpdateUI"></event>
</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">
<property name="bitmap"></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 );
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 );

View File

@@ -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(); }

View File

@@ -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();

View File

@@ -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

View File

@@ -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 ) {