wxcollapsiblepanea collapsible pane is a container with an embedded button-like control which can be used by the user to collapse or expand the pane's contents. once constructed you should use the getpane function to access the pane and add your controls inside it (i.e. use the getpane's returned pointer as parent for the controls which must go in the pane, not the wxcollapsiblepane itself!). note that because of its nature of control which can dynamically (and drastically) change its size at run-time under user-input, when putting wxcollapsiblepane inside a wxsizer you should be careful to add it with a proportion value of zero; this is because otherwise all other windows with non-null proportion values would automatically get resized each time the user expands or collapse the pane window resulting usually in a weird, flickering effect. usage sample:
wxcollapsiblepane *collpane = new wxcollapsiblepane(this, wxid_any, wxt("details:")); // add the pane with a zero proportion value to the 'sz' sizer which contains it sz->add(collpane, 0, wxgrow|wxall, 5); // now add a test label in the collapsible pane using a sizer to layout it: wxwindow *win = collpane->getpane(); wxsizer *panesz = new wxboxsizer(wxvertical); panesz->add(new wxstatictext(win, wxid_any, wxt("test!")), 1, wxgrow|wxall, 2); win->setsizer(panesz); panesz->setsizehints(win);it is only available if wxuse_collpane is set to 1 (the default). derived from
wxcontrol include files <wx/collpane.h> window styles
event handling to process a collapsible pane event, use these event handler macros to direct input to member functions that take a wxcollapsiblepaneevent argument.
see also
wxpanel, members
wxcollapsiblepane::wxcollapsiblepane
wxcollapsiblepane::wxcollapsiblepanewxcollapsiblepane(wxwindow *parent, wxwindowid id, const wxstring& label, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxcp_default_style, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "collapsiblepane") initializes the object and calls create with all the parameters.
wxcollapsiblepane::createbool create(wxwindow *parent, wxwindowid id, const wxstring& label, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxcp_default_style, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "collapsiblepane") parameters parent
id
label
pos
size
style
validator
name
return value true if the control was successfully created or false if creation failed.
wxcollapsiblepane::iscollapsedbool iscollapsed() const returns true if the pane window is currently hidden.
wxcollapsiblepane::isexpandedbool isexpanded() const returns true if the pane window is currently shown.
wxcollapsiblepane::collapsevoid collapse(bool collapse = true) collapses or expands the pane window.
wxcollapsiblepane::expandvoid expand() same as collapse(false).
wxcollapsiblepane::getpanewxwindow * getpane() const returns a pointer to the pane window. add controls to the returned wxwindow to make them collapsible.
|