]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/static.cpp
Support using GetTextExtent() with empty string to get descent in wxOSX.
[wxWidgets.git] / samples / widgets / static.cpp
index a2a363c6d5e60c95223eb508d2524b4358a0ca25..3307ae047bf1bdb8ed81f653971c9aede99990d0 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "wx/statline.h"
 #include "wx/generic/stattextg.h"
+#include "wx/wupdlock.h"
 
 #include "widgets.h"
 #include "icons/statbox.xpm"
@@ -298,7 +299,7 @@ void StaticWidgetsPage::CreateContent()
 
     m_textBox = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
     wxButton *b1 = new wxButton(this, wxID_ANY, "Change &box label");
-    b1->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
+    b1->Connect(wxEVT_BUTTON,
                 wxCommandEventHandler(StaticWidgetsPage::OnButtonBoxText),
                 NULL, this);
     sizerMiddle->Add(m_textBox, 0, wxEXPAND|wxALL, 5);
@@ -308,7 +309,7 @@ void StaticWidgetsPage::CreateContent()
                                  wxDefaultPosition, wxDefaultSize,
                                  wxTE_MULTILINE|wxHSCROLL);
     wxButton *b2 = new wxButton(this, wxID_ANY, "Change &text label");
-    b2->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
+    b2->Connect(wxEVT_BUTTON,
                 wxCommandEventHandler(StaticWidgetsPage::OnButtonLabelText),
                 NULL, this);
     sizerMiddle->Add(m_textLabel, 0, wxEXPAND|wxALL, 5);
@@ -320,16 +321,14 @@ void StaticWidgetsPage::CreateContent()
                                            wxTE_MULTILINE|wxHSCROLL);
 
     wxButton *b3 = new wxButton(this, wxID_ANY, "Change decorated text label");
-    b3->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
+    b3->Connect(wxEVT_BUTTON,
                 wxCommandEventHandler(StaticWidgetsPage::OnButtonLabelWithMarkupText),
                 NULL, this);
     sizerMiddle->Add(m_textLabelWithMarkup, 0, wxEXPAND|wxALL, 5);
     sizerMiddle->Add(b3, 0, wxLEFT|wxBOTTOM, 5);
 
-    m_chkGreen = CreateCheckBoxAndAddToSizer(sizerLeft,
+    m_chkGreen = CreateCheckBoxAndAddToSizer(sizerMiddle,
                                              "Decorated label on g&reen");
-
-    sizerMiddle->Add(m_chkGreen, 0, wxALL, 5);
 #endif // wxUSE_MARKUP
 
     // final initializations
@@ -378,6 +377,8 @@ void StaticWidgetsPage::Reset()
 
 void StaticWidgetsPage::CreateStatic()
 {
+    wxWindowUpdateLocker lock(this);
+
     bool isVert = m_chkVert->GetValue();
 
     if ( m_sizerStatBox )