]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/uiaction/uiaction.cpp
m_id was already set, don't set it to the passed in value again as then we lose the...
[wxWidgets.git] / samples / uiaction / uiaction.cpp
index 86a6729d4057d0cc5991129853deb84e4f4d9110..63a5bb627103575244367c19dc7fb60942dbf4ac 100644 (file)
@@ -30,7 +30,9 @@
     #include "wx/wx.h"
 #endif
 
-#include "wx/uiaction.h"
+#if wxUSE_UIACTIONSIMULATOR
+    #include "wx/uiaction.h"
+#endif
 
 // ----------------------------------------------------------------------------
 // resources
@@ -65,6 +67,8 @@ public:
     virtual bool OnInit();
 };
 
+#if wxUSE_UIACTIONSIMULATOR
+
 // Define a new frame type: this is going to be our main frame
 class MyFrame : public wxFrame
 {
@@ -90,6 +94,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(RunSimulation, MyFrame::OnRunSimulation)
 END_EVENT_TABLE()
 
+#endif // wxUSE_UIACTIONSIMULATOR
+
 // ============================================================================
 // implementation
 // ============================================================================
@@ -105,16 +111,23 @@ bool MyApp::OnInit()
     if ( !wxApp::OnInit() )
         return false;
 
+#if wxUSE_UIACTIONSIMULATOR
     MyFrame *frame = new MyFrame("wxUIActionSimulator sample application");
     frame->Show(true);
     
     return true;
+#else // !wxUSE_UIACTIONSIMULATOR
+    wxLogError("wxUSE_UIACTIONSIMULATOR must be 1 for this sample");
+    return false;
+#endif // wxUSE_UIACTIONSIMULATOR/!wxUSE_UIACTIONSIMULATOR
 }
 
 // ----------------------------------------------------------------------------
 // main frame
 // ----------------------------------------------------------------------------
 
+#if wxUSE_UIACTIONSIMULATOR
+
 // frame constructor
 MyFrame::MyFrame(const wxString& title)
        : wxFrame(NULL, wxID_ANY, title)
@@ -164,3 +177,5 @@ void MyFrame::OnButtonPressed(wxCommandEvent&)
 {
     m_buttonPressed = true;
 }
+
+#endif // wxUSE_UIACTIONSIMULATOR