]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/button.cpp
Fixed the code to actually work.
[wxWidgets.git] / samples / widgets / button.cpp
index eee43761952a1ed2de4ddc3c248e9000e35c6e23..d4c000977d2d32b5bdfcbc8393258f1ac071daf8 100644 (file)
@@ -36,6 +36,7 @@
     #include "wx/textctrl.h"
 #endif
 
+#include "wx/artprov.h"
 #include "wx/sizer.h"
 
 #include "widgets.h"
@@ -112,8 +113,8 @@ protected:
     wxTextCtrl *m_textLabel;
 
 private:
-    DECLARE_EVENT_TABLE();
-    DECLARE_WIDGETS_PAGE(ButtonWidgetsPage);
+    DECLARE_EVENT_TABLE()
+    DECLARE_WIDGETS_PAGE(ButtonWidgetsPage)
 };
 
 // ----------------------------------------------------------------------------
@@ -220,7 +221,7 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
     sizerRight->Add(0, 0, 1, wxCENTRE);
     sizerRight->Add(m_button, 1, wxCENTRE);
     sizerRight->Add(0, 0, 1, wxCENTRE);
-    sizerRight->SetMinSize(250, 0);
+    sizerRight->SetMinSize(150, 0);
     m_sizerButton = sizerRight; // save it to modify it later
 
     // the 3 panes panes compose the window
@@ -265,7 +266,7 @@ void ButtonWidgetsPage::CreateButton()
         size_t count = m_sizerButton->GetChildren().GetCount();
         for ( size_t n = 0; n < count; n++ )
         {
-            m_sizerButton->Remove(0);
+            m_sizerButton->Remove( 0 );
         }
 
         delete m_button;
@@ -279,7 +280,7 @@ void ButtonWidgetsPage::CreateButton()
     switch ( m_radioHAlign->GetSelection() )
     {
         case ButtonHAlign_Left:
-            flags |= wxALIGN_LEFT;
+            flags |= wxBU_LEFT;
             break;
 
         default:
@@ -287,18 +288,17 @@ void ButtonWidgetsPage::CreateButton()
             // fall through
 
         case ButtonHAlign_Centre:
-            flags |= wxALIGN_CENTRE_HORIZONTAL;
             break;
 
         case ButtonHAlign_Right:
-            flags |= wxALIGN_RIGHT;
+            flags |= wxBU_RIGHT;
             break;
     }
 
     switch ( m_radioVAlign->GetSelection() )
     {
         case ButtonVAlign_Top:
-            flags |= wxALIGN_TOP;
+            flags |= wxBU_TOP;
             break;
 
         default:
@@ -310,7 +310,7 @@ void ButtonWidgetsPage::CreateButton()
             break;
 
         case ButtonVAlign_Bottom:
-            flags |= wxALIGN_BOTTOM;
+            flags |= wxBU_BOTTOM;
             break;
     }
 
@@ -321,7 +321,7 @@ void ButtonWidgetsPage::CreateButton()
 #ifdef __WXUNIVERSAL__
     if ( m_chkImage->GetValue() )
     {
-        m_button->SetImageLabel(wxTheApp->GetStdIcon(wxICON_INFORMATION));
+        m_button->SetImageLabel(wxArtProvider::GetIcon(wxART_INFORMATION));
     }
 #endif // wxUniv
 
@@ -355,7 +355,7 @@ void ButtonWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
     CreateButton();
 }
 
-void ButtonWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)
+void ButtonWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
 {
     CreateButton();
 }
@@ -365,7 +365,7 @@ void ButtonWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event))
     m_button->SetLabel(m_textLabel->GetValue());
 }
 
-void ButtonWidgetsPage::OnButton(wxCommandEvent& event)
+void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event))
 {
     wxLogMessage(_T("Test button clicked."));
 }