]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/event/event.cpp
compilation fix for gcc (closes bug 996701)
[wxWidgets.git] / samples / event / event.cpp
index ee1b87c5e77dd35c64d9d2b9439a4294046d3e70..5b21599ec9a9ca03bbbac2b9df8b05c0e5563832 100644 (file)
@@ -180,7 +180,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 
     EVT_MY_CUSTOM_COMMAND(wxID_ANY, MyFrame::OnProcessCustom)
 
-    // this would also work:
+    // the line below would also work if OnProcessCustom() were defined as
+    // taking a wxEvent (as required by EVT_CUSTOM) and not wxCommandEvent
     //EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, wxID_ANY, MyFrame::OnProcessCustom)
 END_EVENT_TABLE()
 
@@ -322,15 +323,19 @@ void MyFrame::OnConnect(wxCommandEvent& event)
                 (wxEventFunction)
                 (wxCommandEventFunction)&MyFrame::OnDynamic);
 
+#if wxUSE_STATUSBAR
         SetStatusText(_T("You can now use \"Dynamic\" item in the menu"));
         SetStatusText(_T("Dynamic: on"), Status_Dynamic);
+#endif // wxUSE_STATUSBAR
     }
     else // connect
     {
         Disconnect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED);
 
+#if wxUSE_STATUSBAR
         SetStatusText(_T("You can no more use \"Dynamic\" item in the menu"));
         SetStatusText(_T("Dynamic: off"), Status_Dynamic);
+#endif // wxUSE_STATUSBAR
     }
 }
 
@@ -342,7 +347,9 @@ void MyFrame::OnPushEventHandler(wxCommandEvent& WXUNUSED(event))
 {
     PushEventHandler(new MyEvtHandler(++m_nPush));
 
+#if wxUSE_STATUSBAR
     SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
+#endif // wxUSE_STATUSBAR
 }
 
 void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
@@ -352,7 +359,9 @@ void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
     PopEventHandler(true /* delete handler */);
     m_nPush--;
 
+#if wxUSE_STATUSBAR
     SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);
+#endif // wxUSE_STATUSBAR
 }
 
 void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event))