From eb2a7883df16d45e476efd12d601b56e0ef1429f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 15 Apr 2004 22:26:09 +0000 Subject: [PATCH] show/hide static box when the wxStaticBoxSizer is shown/hidden (replaces patch 897020) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26817 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/sizer.h | 5 ++++- src/common/sizer.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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 // ----------------------------------------------------------------------------