]> git.saurik.com Git - wxWidgets.git/commitdiff
test ShowFullScreen() to verify that restoring menu works correctly
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 26 Jan 2009 23:17:09 +0000 (23:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 26 Jan 2009 23:17:09 +0000 (23:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/mdi/mdi.cpp
samples/mdi/mdi.h

index 047adfa6eb2c95104e2c1be2331c2153c4d00162..3c8e263f8970d7162101cda3299c2c665d9d9661 100644 (file)
@@ -66,6 +66,7 @@ IMPLEMENT_APP(MyApp)
 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)
@@ -135,6 +136,7 @@ MyFrame::MyFrame()
     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;
@@ -229,6 +231,11 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event) )
     subframe->Show(true);
 }
 
+void MyFrame::OnFullScreen(wxCommandEvent& event)
+{
+    ShowFullScreen(event.IsChecked());
+}
+
 void MyFrame::OnSize(wxSizeEvent& event)
 {
     int w, h;
@@ -379,6 +386,7 @@ MyChild::MyChild(wxMDIParentFrame *parent)
 
     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;
index d9e9afc3e3c068a065f7125a2390f3f3c0bff1d9..48f18dbf58a6446b3cacb2f5f60603e56c81a11a 100644 (file)
@@ -51,6 +51,7 @@ private:
     void OnSize(wxSizeEvent& event);
     void OnAbout(wxCommandEvent& event);
     void OnNewWindow(wxCommandEvent& event);
+    void OnFullScreen(wxCommandEvent& event);
     void OnQuit(wxCommandEvent& event);
     void OnClose(wxCloseEvent& event);
 
@@ -95,6 +96,7 @@ private:
 // menu items ids
 enum
 {
+    MDI_FULLSCREEN,
     MDI_REFRESH,
     MDI_CHANGE_TITLE,
     MDI_CHANGE_POSITION,