wx.Sizer.Show can be recursive

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2004-09-13 23:20:47 +00:00
parent 702723413e
commit 8f2146748b

View File

@ -820,21 +820,22 @@ as well.", "");
%extend { %extend {
DocAStr(Show, DocAStr(Show,
"Show(self, item, bool show=True)", "Show(self, item, bool show=True, bool recursive=False) -> bool",
"Shows or hides an item managed by the sizer. To make a sizer item "Shows or hides an item managed by the sizer. To make a sizer item
disappear or reappear, use Show followed by `Layout`. The *item* disappear or reappear, use Show followed by `Layout`. The *item*
parameter can be either a window, a sizer, or the zero-based index of parameter can be either a window, a sizer, or the zero-based index of
the item.", ""); the item. Use the recursive parameter to show or hide an item in a
void Show(PyObject* item, bool show = True) { subsizer. Returns True if the item was found.", "");
bool Show(PyObject* item, bool show = True, bool recursive=False) {
bool blocked = wxPyBeginBlockThreads(); bool blocked = wxPyBeginBlockThreads();
wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, False, True);
wxPyEndBlockThreads(blocked); wxPyEndBlockThreads(blocked);
if ( info.window ) if ( info.window )
self->Show(info.window, show); return self->Show(info.window, show, recursive);
else if ( info.sizer ) else if ( info.sizer )
self->Show(info.sizer, show); return self->Show(info.sizer, show, recursive);
else if ( info.gotPos ) else if ( info.gotPos )
self->Show(info.pos, show); return self->Show(info.pos, show);
} }
DocAStr(IsShown, DocAStr(IsShown,
@ -859,11 +860,11 @@ the item.", "");
} }
%pythoncode { %pythoncode {
def Hide(self, item): def Hide(self, item, recursive=False):
""" """
A convenience method for Show(item, False). A convenience method for Show(item, False, recursive).
""" """
self.Show(item, False) return self.Show(item, False, recursive)
} }