]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/nativdlg/nativdlg.cpp
Patch [ 1314868 ] [wxMSW] Show MDI child menubars when ShowFullScreen(false)
[wxWidgets.git] / samples / nativdlg / nativdlg.cpp
index 1ab4ea4940163d1cb48075b1f9711fe91e7af2c7..4e52a9ad23bf0cdad791d1d01cbaa4a1811fc88e 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
 
 IMPLEMENT_APP(MyApp)
 
-// Testing of ressources
-MyApp::MyApp()
-{
-}
-
 bool MyApp::OnInit(void)
 {
   // Create the main frame window
-  MyFrame   *frame = new MyFrame(NULL, wxID_ANY, _T("wxWindows Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250));
+  MyFrame   *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250));
 
+#if wxUSE_STATUSBAR
   // Give it a status line
   frame->CreateStatusBar(2);
+#endif // wxUSE_STATUSBAR
 
   // Make a menubar
   wxMenu *file_menu = new wxMenu;
@@ -90,15 +83,13 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
 {
 #if ( defined(__WXOS2__) || defined(__WXMSW__) ) && !defined(__WXUNIVERSAL__)
-      MyDialog *dialog = new MyDialog;
-      if (dialog->LoadNativeDialog(this, _T("dialog1")))
-      {
-    dialog->SetModal(true);
-        dialog->ShowModal();
-      }
-  dialog->Close(true);
+    MyDialog dialog;
+    if (dialog.LoadNativeDialog(this, _T("dialog1")))
+    {
+        dialog.ShowModal();
+    }
 #else
-  wxMessageBox(_T("No native dialog support"),_T("Platform limitation"));
+    wxMessageBox(_T("No native dialog support"),_T("Platform limitation"));
 #endif
 }