X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/13cd17453c3019708591605f91ea3b218e329ccc..f332a5a0f83caabe02e82508402c5f8096a04ea3:/samples/widgets/static.cpp diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index ba1b4d0ca9..98b8d5803d 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -28,6 +28,7 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/bitmap.h" #include "wx/button.h" #include "wx/checkbox.h" #include "wx/radiobox.h" @@ -166,6 +167,7 @@ protected: *m_radioVAlign; // the controls and the sizer containing them + wxStaticBox *m_staticBox; wxStaticBoxSizer *m_sizerStatBox; wxStaticText *m_statText; wxStaticLine *m_statLine; @@ -215,6 +217,7 @@ StaticWidgetsPage::StaticWidgetsPage(wxNotebook *notebook, m_statLine = (wxStaticLine *)NULL; m_statText = (wxStaticText *)NULL; + m_staticBox = (wxStaticBox *)NULL; m_sizerStatBox = (wxStaticBoxSizer *)NULL; m_sizerStatic = (wxSizer *)NULL; @@ -319,9 +322,9 @@ void StaticWidgetsPage::CreateStatic() if ( m_sizerStatBox ) { - m_sizerStatic->Remove(m_sizerStatBox); - + delete m_staticBox; // delete m_sizerStatBox; -- deleted by Remove() + m_sizerStatic->Remove(m_sizerStatBox); delete m_statText; delete m_statLine; } @@ -376,11 +379,11 @@ void StaticWidgetsPage::CreateStatic() flagsText |= align; flagsBox |= align; - wxStaticBox *box = new MyStaticBox(this, -1, m_textBox->GetValue(), - wxDefaultPosition, wxDefaultSize, - flagsBox); - m_sizerStatBox = new wxStaticBoxSizer(box, isVert ? wxHORIZONTAL - : wxVERTICAL); + m_staticBox = new MyStaticBox(this, -1, m_textBox->GetValue(), + wxDefaultPosition, wxDefaultSize, + flagsBox); + m_sizerStatBox = new wxStaticBoxSizer(m_staticBox, isVert ? wxHORIZONTAL + : wxVERTICAL); m_statText = new MyStaticText(this, -1, m_textLabel->GetValue(), wxDefaultPosition, wxDefaultSize,