back to gui 

wxCollapsiblePane

generated from ../src/mod_gui/control/collpane.cpp

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 pane property to access the pane and add your controls inside it (i.e. use the pane property 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.

var collpane = new wxCollapsiblePane(dlg, wxId.ANY, "Details:");

  // add the pane with a zero proportion value to the 'sz' sizer which contains it
  sz.add(collpane, 0, wxStretch.GROW | wxDirection.ALL, 5);

  // now add a test label in the collapsible pane using a sizer to layout it:
  var win = collpane.pane;
  var paneSz = new wxBoxSizer(wxOrientation.VERTICAL);
  paneSz.add(new wxStaticText(win, wxId.ANY, "test!", 1, wxStretch.GROW | wxDirection.ALL, 2);
  win.sizer = paneSz;
  paneSz.setSizeHints(win); 
  

Constants

Style

Name Description
DEFAULT_STYLE

Constructor

wxCollapsiblePane

wxCollapsiblePane()
 
wxCollapsiblePane(Parent, 
                  Id, 
                  Label, 
                  Pos = wxDefaultPosition, 
                  Size = wxDefaultSize, 
                  Style = wxCollapsiblePane.DEFAULT_STYLE, 
                  Validator = wxDefaultValidator)
 
Name Type Default Description
Parent wxWindow The parent of the button.
Id Integer An window identifier. Use wxId.ANY or -1 when you don't need it.
Label String The initial label shown in the button which allows the user to expand or collapse the pane window.
Pos wxPoint wxDefaultPosition The position of the button on the given parent.
Size wxSize wxDefaultSize The size of the button.
Style Integer wxCollapsiblePane.DEFAULT_STYLE The button style
Validator wxValidator wxDefaultValidator

Constructs a new wxCollapsiblePane object.

Properties

Name Type Description
collapsed Boolean Get/Set collapsed.
expanded Boolean Get/Set expanded.
pane read only wxWindow Returns the pane window. Add controls to the returned wxWindow to make them collapsible.

Methods

create

create(Parent, 
       Id, 
       Label, 
       Pos = wxDefaultPosition, 
       Size = wxDefaultSize, 
       Style = wxCollapsiblePane.DEFAULT_STYLE, 
       Validator = wxDefaultValidator) : Boolean
 
Name Type Default Description
Parent wxWindow The parent of the button.
Id Integer An window identifier. Use wxId.ANY or -1 when you don't need it.
Label String The initial label shown in the button which allows the user to expand or collapse the pane window.
Pos wxPoint wxDefaultPosition The position of the button on the given parent.
Size wxSize wxDefaultSize The size of the button.
Style Integer wxCollapsiblePane.DEFAULT_STYLE The button style
Validator wxValidator wxDefaultValidator

Creates a button.

Events

onChanged The user showed or hidden the collapsible pane. The type of the argument that your handler receives is wxCollapsiblePaneEvent.


SourceForge.net Logo Support This Project

Table of Contents

Prototype

wxControl

Constructor

wxCollapsiblePane

Properties

collapsed
expanded
pane

Methods

create

Events

onChanged


Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.