Recursive wxSizer::Show for subsizer and return value if element was found.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -207,7 +207,6 @@ All:
|
||||
- added wxMicroSleep() and wxMilliSleep() replacing deprecated wxUsleep()
|
||||
- basic UDP sockets support (Lenny Maiorani)
|
||||
- fixed wxDateTime::GetWeekDayName() for some dates (Daniel Kaps)
|
||||
- support for comma in contrib gizmo wxLEDNumberCtrl (Grant Likely)
|
||||
- deprecated wxDateTime::SetToTheWeek() in favour of SetToWeekOfYear()
|
||||
|
||||
All (GUI):
|
||||
@@ -226,6 +225,8 @@ All (GUI):
|
||||
- added samples/splash
|
||||
- added support for stock buttons
|
||||
- added wxTopLevelWindow::RequestUserAttention()
|
||||
- support for comma in contrib gizmo wxLEDNumberCtrl (Grant Likely)
|
||||
- recursive wxSizer::Show for subsizer and return value if element was found
|
||||
|
||||
Unix:
|
||||
|
||||
|
@@ -391,14 +391,17 @@ minimal size. For windows with managed scrollbars this will set them appropriate
|
||||
|
||||
\membersection{wxSizer::Show}\label{wxsizershow}
|
||||
|
||||
\func{void}{Show}{\param{wxWindow* }{window}, \param{bool }{show = true}}
|
||||
\func{bool}{Show}{\param{wxWindow* }{window}, \param{bool }{show = true}, \param{bool }{recursive = false}}
|
||||
|
||||
\func{void}{Show}{\param{wxSizer* }{sizer}, \param{bool }{show = true}}
|
||||
\func{bool}{Show}{\param{wxSizer* }{sizer}, \param{bool }{show = true}, \param{bool }{recursive = false}}
|
||||
|
||||
\func{void}{Show}{\param{size\_t }{index}, \param{bool }{show = true}}
|
||||
\func{bool}{Show}{\param{size\_t }{index}, \param{bool }{show = true}}
|
||||
|
||||
Shows or hides the {\it window}, {\it sizer}, or item at {\it index}.
|
||||
To make a sizer item disappear or reappear, use Show() followed by Layout().
|
||||
Use parameter {\it recursive} to show or hide elements found in subsizers.
|
||||
|
||||
Returns true if the child item was found, false otherwise.
|
||||
|
||||
Note that this only works with wxBoxSizer and wxFlexGridSizer, since they
|
||||
are the only two sizer classes that can size rows/columns independently.
|
||||
|
@@ -308,16 +308,16 @@ public:
|
||||
|
||||
// Manage whether individual scene items are considered
|
||||
// in the layout calculations or not.
|
||||
void Show( wxWindow *window, bool show = true );
|
||||
void Show( wxSizer *sizer, bool show = true );
|
||||
void Show( size_t index, bool show = true );
|
||||
bool Show( wxWindow *window, bool show = true, bool recursive = false );
|
||||
bool Show( wxSizer *sizer, bool show = true, bool recursive = false );
|
||||
bool Show( size_t index, bool show = true );
|
||||
|
||||
void Hide( wxSizer *sizer )
|
||||
{ Show( sizer, false ); }
|
||||
void Hide( wxWindow *window )
|
||||
{ Show( window, false ); }
|
||||
void Hide( size_t index )
|
||||
{ Show( index, false ); }
|
||||
bool Hide( wxSizer *sizer, bool recursive = false )
|
||||
{ return Show( sizer, false, recursive ); }
|
||||
bool Hide( wxWindow *window, bool recursive = false )
|
||||
{ return Show( window, false, recursive ); }
|
||||
bool Hide( size_t index )
|
||||
{ return Show( index, false ); }
|
||||
|
||||
bool IsShown( wxWindow *window ) const;
|
||||
bool IsShown( wxSizer *sizer ) const;
|
||||
|
@@ -858,7 +858,7 @@ bool wxSizer::DoSetItemMinSize( size_t index, int width, int height )
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSizer::Show( wxWindow *window, bool show )
|
||||
bool wxSizer::Show( wxWindow *window, bool show, bool recursive )
|
||||
{
|
||||
wxASSERT_MSG( window, _T("Show for NULL window") );
|
||||
|
||||
@@ -870,13 +870,22 @@ void wxSizer::Show( wxWindow *window, bool show )
|
||||
if (item->GetWindow() == window)
|
||||
{
|
||||
item->Show( show );
|
||||
break;
|
||||
}
|
||||
node = node->GetNext();
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (recursive && item->IsSizer())
|
||||
{
|
||||
if (item->GetSizer()->Show(window, show, recursive))
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSizer::Show( wxSizer *sizer, bool show )
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSizer::Show( wxSizer *sizer, bool show, bool recursive )
|
||||
{
|
||||
wxASSERT_MSG( sizer, _T("Show for NULL sizer") );
|
||||
|
||||
@@ -888,18 +897,30 @@ void wxSizer::Show( wxSizer *sizer, bool show )
|
||||
if (item->GetSizer() == sizer)
|
||||
{
|
||||
item->Show( show );
|
||||
break;
|
||||
}
|
||||
node = node->GetNext();
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (recursive && item->IsSizer())
|
||||
{
|
||||
if (item->GetSizer()->Show(sizer, show, recursive))
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSizer::Show( size_t index, bool show )
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSizer::Show( size_t index, bool show)
|
||||
{
|
||||
wxCHECK_RET( index < m_children.GetCount(),
|
||||
wxCHECK_MSG( index < m_children.GetCount(),
|
||||
false,
|
||||
_T("Show index is out of range") );
|
||||
|
||||
m_children.Item( index )->GetData()->Show( show );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxSizer::ShowItems( bool show )
|
||||
|
Reference in New Issue
Block a user