// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// handlers) which process them. It can be also done at run-time, but for the
// simple menu events like this the static method is much simpler.
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
// handlers) which process them. It can be also done at run-time, but for the
// simple menu events like this the static method is much simpler.
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
EVT_BUTTON(Except_ThrowInt, MyDialog::OnThrowInt)
EVT_BUTTON(Except_ThrowObject, MyDialog::OnThrowObject)
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
EVT_BUTTON(Except_ThrowInt, MyDialog::OnThrowInt)
EVT_BUTTON(Except_ThrowObject, MyDialog::OnThrowObject)
// the application object during program execution (it's better than using a
// static object for many reasons) and also implements the accessor function
// wxGetApp() which will return the reference of the right type (i.e. MyApp and
// the application object during program execution (it's better than using a
// static object for many reasons) and also implements the accessor function
// wxGetApp() which will return the reference of the right type (i.e. MyApp and
wxPoint(50, 50), wxSize(450, 340));
// and show it (the frames, unlike simple controls, are not shown when
wxPoint(50, 50), wxSize(450, 340));
// and show it (the frames, unlike simple controls, are not shown when
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
- : wxFrame(NULL, -1, title, pos, size, style)
+ : wxFrame(NULL, wxID_ANY, title, pos, size, style)
#if wxUSE_STATUSBAR && !defined(__WXWINCE__)
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
#if wxUSE_STATUSBAR && !defined(__WXWINCE__)
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
// ============================================================================
MyDialog::MyDialog(wxFrame *parent)
// ============================================================================
MyDialog::MyDialog(wxFrame *parent)
0, wxCENTRE | wxALL, 5);
sizerTop->Add(new wxButton(this, Except_ThrowObject, _T("Throw &object")),
0, wxCENTRE | wxALL, 5);
0, wxCENTRE | wxALL, 5);
sizerTop->Add(new wxButton(this, Except_ThrowObject, _T("Throw &object")),
0, wxCENTRE | wxALL, 5);
sizerTop->Add(new wxButton(this, wxID_CANCEL, _T("&Cancel")),
0, wxCENTRE | wxALL, 5);
sizerTop->Add(new wxButton(this, wxID_CANCEL, _T("&Cancel")),
0, wxCENTRE | wxALL, 5);