#include "../sample.xpm"
#endif
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// IDs for the controls and the menu commands
+enum
+{
+ // menu items
+ TheButton = 100,
+ RunSimulation
+};
+
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
private:
bool m_buttonPressed;
bool m_menuSelected;
-};
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-// IDs for the controls and the menu commands
-enum
-{
- // menu items
- TheButton = wxID_ANY,
- RunSimulation = wxID_ANY
+ DECLARE_EVENT_TABLE()
};
-IMPLEMENT_APP(MyApp)
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+ EVT_BUTTON(TheButton, MyFrame::OnButtonPressed)
+ EVT_MENU(RunSimulation, MyFrame::OnRunSimulation)
+END_EVENT_TABLE()
// ============================================================================
// implementation
// the application class
// ----------------------------------------------------------------------------
+IMPLEMENT_APP(MyApp)
+
bool MyApp::OnInit()
{
if ( !wxApp::OnInit() )
wxButton* button = new wxButton(this, TheButton, "Button");
button->SetName("TheButton");
- Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MyFrame::OnButtonPressed, this, button->GetId());
- Bind(wxEVT_COMMAND_MENU_SELECTED, &MyFrame::OnRunSimulation, this, RunSimulation);
}