diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 5f7738dce2..ce907346bb 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -313,7 +313,7 @@ public: bool IsShown( size_t index ) const; // Recursively call wxWindow::Show () on all sizer items. - void ShowItems (bool show); + virtual void ShowItems (bool show); protected: wxSize m_size; @@ -505,6 +505,9 @@ public: wxStaticBox *GetStaticBox() const { return m_staticBox; } + // override to hide/show the static box as well + virtual void ShowItems (bool show); + protected: wxStaticBox *m_staticBox; diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 2fd2d9f854..1d9073891f 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -1624,6 +1624,12 @@ wxSize wxStaticBoxSizer::CalcMin() return ret; } +void wxStaticBoxSizer::ShowItems( bool show ) +{ + m_staticBox->Show( show ); + wxBoxSizer::ShowItems( show ); +} + #endif // wxUSE_STATBOX // ----------------------------------------------------------------------------