-MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h):
- wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
-{}
+MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
+ wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
+{
+ // Give it an icon
+#ifdef __WXMSW__
+ SetIcon(wxIcon(_T("mondrian")));
+#else
+ SetIcon(wxIcon(mondrian_xpm));
+#endif
+
+ // Make a menubar
+ wxMenu *file_menu = new wxMenu;
+
+ file_menu->Append(DYNAMIC_ABOUT, _T("&About"));
+ file_menu->Append(DYNAMIC_TEST, _T("&Test"));
+ file_menu->Append(DYNAMIC_QUIT, _T("E&xit"));
+ wxMenuBar *menu_bar = new wxMenuBar;
+ menu_bar->Append(file_menu, _T("&File"));
+ SetMenuBar(menu_bar);
+
+ // Make a panel with a message
+ wxPanel *panel = new wxPanel(this, wxID_ANY, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL);
+
+ (void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxDefaultSize, 0);
+
+ // You used to have to do some casting for param 4, but now there are type-safe handlers
+ Connect( DYNAMIC_QUIT, wxID_ANY,
+ wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnQuit) );
+ Connect( DYNAMIC_TEST, wxID_ANY,
+ wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnTest) );
+ Connect( DYNAMIC_ABOUT, wxID_ANY,
+ wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnAbout) );
+
+ CreateStatusBar();
+ m_shadow.AddMethod( wxT("OnTest"), &cb_MyFrame_InitStatusbar );
+}