h1(#wxcollapsiblepane). Wx::CollapsiblePane A 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 "get_pane":#CollapsiblePane_getpane function to access the pane and add your controls inside it (i.e. use the "get_pane":#CollapsiblePane_getpane's return value as parent for the controls which must go in the pane, *NOT* the CollapsiblePane 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 CollapsiblePane inside a "Sizer":sizer.html 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: coll_pane = Wx::CollapsiblePane.new(self, :label => 'Details) ==#== add the pane with a zero proportion to the sizer which contains it sizer.add(coll_pane, 0, Wx::GROW|Wx::ALL) ==#== now add a test label in the collapsible pane, using a sizer for layout win = coll_pane.pane sizer = Wx::BoxSizer(Wx::VERTICAL) s_text = Wx::StaticText.new(win, :label => 'Test!') sizer.add(s_text, 1, Wx::GROW|Wx::ALL, 2) win.sizer = sizer sizer.set_size_hints(pane) h2. Derived from "Control":control.html "Window":window.html "EvtHandler":evthandler.html "Object":object.html h2. Window styles |@CP_DEFAULT_STYLE@|The default style: 0.| h2. Event handling To process a collapsible pane event, use these event handler macros to direct input to member functions that take a "CollapsiblePaneEvent":collapsiblepaneevent.html argument. |*evt_collapsiblepane_changed(id) { | event | ... }*|The user showed or hidden the collapsible pane. | h2. See also "Panel":panel.html, "CollapsiblePaneEvent":collapsiblepaneevent.html
h2. Methods * "CollapsiblePane.new":#CollapsiblePane_new * "CollapsiblePane#create":#CollapsiblePane_create * "CollapsiblePane#is_collapsed":#CollapsiblePane_iscollapsed * "CollapsiblePane#is_expanded":#CollapsiblePane_isexpanded * "CollapsiblePane#collapse":#CollapsiblePane_collapse * "CollapsiblePane#expand":#CollapsiblePane_expand * "CollapsiblePane#get_pane":#CollapsiblePane_getpane
h3(#wxcollapsiblepane). CollapsiblePane.new *CollapsiblePane.new*(%(arg-type)"Window":window.html% parent, %(arg-type)Integer% id, %(arg-type)String% label, %(arg-type)"Point":point.html% pos = DEFAULT_POSITION, %(arg-type)"Size":size.html% size = DEFAULT_SIZE, %(arg-type)Integer% style = CP_DEFAULT_STYLE, %(arg-type)"Validator":validator.html% validator = DEFAULT_VALIDATOR, %(arg-type)String% name = "collapsiblePane") Initializes the object and calls "Create":collapsiblepanecreate.html with all the parameters. h3(#CollapsiblePane_create). CollapsiblePane#create Boolean *create*(%(arg-type)"Window":window.html% parent, %(arg-type)Integer% id, %(arg-type)String% label, %(arg-type)"Point":point.html% pos = DEFAULT_POSITION, %(arg-type)"Size":size.html% size = DEFAULT_SIZE, %(arg-type)Integer% style = CP_DEFAULT_STYLE, %(arg-type)"Validator":validator.html% validator = DEFAULT_VALIDATOR, %(arg-type)String% name = "collapsiblePane") h4. Parameters * _parent_ Parent window, must not be non-@NULL@. * _id_ The identifier for the control. * _label_ The initial label shown in the button which allows the user to expand or collapse the pane window. * _pos_ Initial position. * _size_ Initial size. * _style_ The window style, see @CP_*@ flags. * _validator_ Validator which can be used for additional date checks. * _name_ Control name. h4. Return value if the control was successfully created or if creation failed. h3(#CollapsiblePane_iscollapsed). CollapsiblePane#is_collapsed Boolean *is_collapsed*() Returns if the pane window is currently hidden. h3(#CollapsiblePane_isexpanded). CollapsiblePane#is_expanded Boolean *is_expanded*() Returns if the pane window is currently shown. h3(#CollapsiblePane_collapse). CollapsiblePane#collapse *collapse*(%(arg-type)Boolean% collapse = true) Collapses or expands the pane window. h3(#CollapsiblePane_expand). CollapsiblePane#expand *expand*() Same as @"Collapse":collapsiblepanecollapse.html@@(false)@. h3(#CollapsiblePane_getpane). CollapsiblePane#get_pane "Window":window.html *get_pane*() Returns a pointer to the pane window. Add controls to the returned "Window":window.html to make them collapsible.