]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/statbar/statbar.cpp
don't use deprecated toolbar API
[wxWidgets.git] / samples / statbar / statbar.cpp
index f17d9e7e412b804b6d27da1224d17f14bc2a2661..91cf5c9c90755e599ea8cdafc6e5b4d0f62f6d2f 100644 (file)
@@ -267,6 +267,9 @@ IMPLEMENT_APP(MyApp)
 // `Main program' equivalent: the program execution "starts" here
 bool MyApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
     // create the main application window
     MyFrame *frame = new MyFrame(_T("wxStatusBar sample"),
                                  wxPoint(50, 50), wxSize(450, 340));
@@ -452,7 +455,7 @@ void MyFrame::OnSetStatusFields(wxCommandEvent& WXUNUSED(event))
 
 void MyFrame::OnUpdateStatusBarToggle(wxUpdateUIEvent& event)
 {
-    event.Check(GetStatusBar() != 0);
+    event.Check(GetStatusBar() != NULL);
 }
 
 void MyFrame::OnStatusBarToggle(wxCommandEvent& WXUNUSED(event))
@@ -461,17 +464,12 @@ void MyFrame::OnStatusBarToggle(wxCommandEvent& WXUNUSED(event))
     if ( statbarOld )
     {
         statbarOld->Hide();
-        SetStatusBar(0);
+        SetStatusBar(NULL);
     }
     else
     {
         DoCreateStatusBar(m_statbarKind);
     }
-#ifdef __WXMSW__
-    // The following is a kludge suggested by Vadim Zeitlin (one of the wxWidgets
-    // authors) while we look for a proper fix..
-//    SendSizeEvent();
-#endif
 }
 
 void MyFrame::OnRecreateStatusBar(wxCommandEvent& WXUNUSED(event))
@@ -578,10 +576,7 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent)
     sizerTop->Add(-1, 10, 1, wxGROW);
     sizerTop->Add(statbarBottom, 0, wxGROW);
 
-    SetSizer(sizerTop);
-
-    sizerTop->Fit(this);
-    sizerTop->SetSizeHints(this);
+    SetSizerAndFit(sizerTop);
 }
 
 // ----------------------------------------------------------------------------