Use event tables instead of Bind() in uiaction sample.
This should fix VC6 build broken by addition of this sample as VC6 doesn't support Bind(). Luckily, there is no need to use it here anyhow. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
229251afd8
commit
d9ffb9fdcc
@ -42,6 +42,18 @@
|
||||
#include "../sample.xpm"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// IDs for the controls and the menu commands
|
||||
enum
|
||||
{
|
||||
// menu items
|
||||
TheButton = 100,
|
||||
RunSimulation
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -69,21 +81,14 @@ public:
|
||||
private:
|
||||
bool m_buttonPressed;
|
||||
bool m_menuSelected;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// IDs for the controls and the menu commands
|
||||
enum
|
||||
{
|
||||
// menu items
|
||||
TheButton = wxID_ANY,
|
||||
RunSimulation = wxID_ANY
|
||||
};
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_BUTTON(TheButton, MyFrame::OnButtonPressed)
|
||||
EVT_MENU(RunSimulation, MyFrame::OnRunSimulation)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
@ -93,6 +98,8 @@ IMPLEMENT_APP(MyApp)
|
||||
// the application class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
if ( !wxApp::OnInit() )
|
||||
@ -134,8 +141,6 @@ MyFrame::MyFrame(const wxString& title)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user