]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/button.cpp
use wxDC::GetMultiLineTextExtent() instead of duplicating its code in wxButton::DoGet...
[wxWidgets.git] / samples / widgets / button.cpp
index 1fd14bf6a320f7a055dac1e9a3a8bf87ebc8f996..11e0e9e6e5a3ad9abec34cb9c321e0177ed44268 100644 (file)
@@ -77,8 +77,10 @@ enum
 class ButtonWidgetsPage : public WidgetsPage
 {
 public:
 class ButtonWidgetsPage : public WidgetsPage
 {
 public:
-    ButtonWidgetsPage(wxNotebook *notebook, wxImageList *imaglist);
-    virtual ~ButtonWidgetsPage();
+    ButtonWidgetsPage(wxBookCtrl *book, wxImageList *imaglist);
+    virtual ~ButtonWidgetsPage(){};
+
+    virtual wxControl *GetWidget() const { return m_button; }
 
 protected:
     // event handlers
 
 protected:
     // event handlers
@@ -105,7 +107,7 @@ protected:
     wxRadioBox *m_radioHAlign,
                *m_radioVAlign;
 
     wxRadioBox *m_radioHAlign,
                *m_radioVAlign;
 
-    // the gauge itself and the sizer it is in
+    // the button itself and the sizer it is in
     wxButton *m_button;
     wxSizer *m_sizerButton;
 
     wxButton *m_button;
     wxSizer *m_sizerButton;
 
@@ -137,9 +139,9 @@ END_EVENT_TABLE()
 
 IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"));
 
 
 IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"));
 
-ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
-                                       wxImageList *imaglist)
-                  : WidgetsPage(notebook)
+ButtonWidgetsPage::ButtonWidgetsPage(wxBookCtrl *book,
+                                     wxImageList *imaglist)
+                  : WidgetsPage(book)
 {
     imaglist->Add(wxBitmap(button_xpm));
 
 {
     imaglist->Add(wxBitmap(button_xpm));
 
@@ -168,7 +170,7 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
     m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Default"));
 
 #ifndef __WXUNIVERSAL__
     m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Default"));
 
 #ifndef __WXUNIVERSAL__
-    // only wxUniv currently supoprts buttons with images
+    // only wxUniv currently supports buttons with images
     m_chkImage->Disable();
 #endif // !wxUniv
 
     m_chkImage->Disable();
 #endif // !wxUniv
 
@@ -237,10 +239,6 @@ ButtonWidgetsPage::ButtonWidgetsPage(wxNotebook *notebook,
     sizerTop->Fit(this);
 }
 
     sizerTop->Fit(this);
 }
 
-ButtonWidgetsPage::~ButtonWidgetsPage()
-{
-}
-
 // ----------------------------------------------------------------------------
 // operations
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // operations
 // ----------------------------------------------------------------------------