X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ec2df6cbc126adc3a5d9e337f057327430e28c3..5bc97d1b81910a82e249f6227798b42089149f94:/samples/event/event.cpp diff --git a/samples/event/event.cpp b/samples/event/event.cpp index 6a68b78ae6..a960f5dcc0 100644 --- a/samples/event/event.cpp +++ b/samples/event/event.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) // DO NOT use event.cpp here, it breaks statics initialization in // src/common/event.cpp and nothing works at all then! #pragma implementation "eventsample.cpp" @@ -179,6 +179,9 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop) EVT_MY_CUSTOM_COMMAND(-1, MyFrame::OnProcessCustom) + + // this would also work: + //EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, -1, MyFrame::OnProcessCustom) END_EVENT_TABLE() BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler) @@ -290,9 +293,9 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Event sample shows different ways of using events\n" - "© 2001 Vadim Zeitlin"), - _T("About Event Sample"), wxOK | wxICON_INFORMATION, this); + wxMessageBox( wxT("Event sample shows different ways of using events\n") + wxT("© 2001 Vadim Zeitlin"), + wxT("About Event Sample"), wxOK | wxICON_INFORMATION, this ); } // ---------------------------------------------------------------------------- @@ -301,9 +304,12 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnDynamic(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("This is a dynamic event handler which can be connected " - "and disconnected during run-time."), - _T("Dynamic Event Handler"), wxOK | wxICON_INFORMATION, this); + wxMessageBox + ( + wxT("This is a dynamic event handler which can be connected ") + wxT("and disconnected at run-time."), + wxT("Dynamic Event Handler"), wxOK | wxICON_INFORMATION, this + ); } void MyFrame::OnConnect(wxCommandEvent& event) @@ -349,7 +355,7 @@ void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event)) SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push); } -void MyFrame::OnTest(wxCommandEvent& event) +void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event)) { wxLogMessage(_T("This is the test event handler in the main frame")); } @@ -363,14 +369,14 @@ void MyFrame::OnUpdateUIPop(wxUpdateUIEvent& event) // custom event methods // ---------------------------------------------------------------------------- -void MyFrame::OnFireCustom(wxCommandEvent& event) +void MyFrame::OnFireCustom(wxCommandEvent& WXUNUSED(event)) { wxCommandEvent eventCustom(wxEVT_MY_CUSTOM_COMMAND); wxPostEvent(this, eventCustom); } -void MyFrame::OnProcessCustom(wxCommandEvent& event) +void MyFrame::OnProcessCustom(wxCommandEvent& WXUNUSED(event)) { wxLogMessage(_T("Got a custom event!")); }