BEGIN_EVENT_TABLE(MyFrame, wxMDIParentFrame)
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU(wxID_NEW, MyFrame::OnNewWindow)
+ EVT_MENU(MDI_FULLSCREEN, MyFrame::OnFullScreen)
EVT_MENU(wxID_EXIT, MyFrame::OnQuit)
EVT_CLOSE(MyFrame::OnClose)
wxMenu *file_menu = new wxMenu;
file_menu->Append(wxID_NEW, "&New window\tCtrl-N", "Create a new child window");
+ file_menu->AppendCheckItem(MDI_FULLSCREEN, "Show &fullscreen\tCtrl-F");
file_menu->Append(wxID_EXIT, "&Exit\tAlt-X", "Quit the program");
wxMenu *help_menu = new wxMenu;
subframe->Show(true);
}
+void MyFrame::OnFullScreen(wxCommandEvent& event)
+{
+ ShowFullScreen(event.IsChecked());
+}
+
void MyFrame::OnSize(wxSizeEvent& event)
{
int w, h;
file_menu->Append(wxID_NEW, "&New window\tCtrl-N");
file_menu->Append(wxID_CLOSE, "&Close child\tCtrl-W", "Close this window");
+ file_menu->AppendCheckItem(MDI_FULLSCREEN, "Show &fullscreen\tCtrl-F");
file_menu->Append(wxID_EXIT, "&Exit\tAlt-X", "Quit the program");
wxMenu *option_menu = new wxMenu;
void OnSize(wxSizeEvent& event);
void OnAbout(wxCommandEvent& event);
void OnNewWindow(wxCommandEvent& event);
+ void OnFullScreen(wxCommandEvent& event);
void OnQuit(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
// menu items ids
enum
{
+ MDI_FULLSCREEN,
MDI_REFRESH,
MDI_CHANGE_TITLE,
MDI_CHANGE_POSITION,