-
- The wxWindow to be added can be slightly indented from left and right so it is more visibly placed
- in the wxFoldPanel. Use ySpacing > 0 to give the control an y offset from the previous wxWindow added,
- use leftSpacing to give it a slight indent from the left, and rightSpacing also reserves a little space
- on the right so the wxWindow can be properly placed in the wxFoldPanel.
-
- The following example adds a wxFoldPanel to the wxFoldPanelBar and adds two wxWindow derived controls
- to the wxFoldPanel:
-
- \code
-
- // create the wxFoldPanelBar
- _pnl = new wxFoldPanelBar(this, -1, wxDefaultPosition, wxDefaultSize, wxFPB_DEFAULT_STYLE, wxFPB_COLLAPSE_TO_BOTTOM);
-
- // add a foldpanel to the control. "Test me" is the caption and it is initially not collapsed.
- wxFoldPanel item = _pnl->AddFoldPanel("Test me", false);
-
- // now add a button to the fold panel. Mind that the button should be made child of the
- // wxFoldPanel and not of the main form.
- _pnl->AddFoldPanelWindow(item, new wxButton(item.GetParent(), ID_COLLAPSEME, "Collapse Me"));
-
- // add a separator between the two controls. This is purely a visual line that can have a certain
- // color and also the indents and width alligning like a control.
- _pnl->AddFoldPanelSeperator(item);
-
- // now add a text ctrl. Also very easy. Allign this on width so that when the control gets wider
- // the text control also sizes along.
- _pnl->AddFoldPanelWindow(item, new wxTextCtrl(item.GetParent(), -1, "Comment"), wxFPB_ALIGN_WIDTH, wxFPB_DEFAULT_YSPACING, 20);
-
- \endcode
- */
- int AddFoldPanelWindow(const wxFoldPanel &panel, wxWindow *window, int flags = wxFPB_ALIGN_WIDTH,
- int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTSPACING,
- int rightSpacing = wxFPB_DEFAULT_RIGHTSPACING);
-
- /** Adds a seperator line to the current wxFoldPanel. The seperator is a simple line which is drawn and is no
- real component. It can be used to seperate groups of controls which belong to eachother. The colour is
- adjustable, and it takes the same ySpacing, leftSpacing and rightSpacing as AddFoldPanelWindow(). */
- int AddFoldPanelSeperator(const wxFoldPanel &panel, const wxColour &color = wxColour(167,167,167),
- int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTLINESPACING,
- int rightSpacing = wxFPB_DEFAULT_RIGHTLINESPACING);
-
- /** Returns the number of panels currently present in the wxFoldPanelBar. This is independent if they are
- visible or hidden. */
- size_t GetCount() const {
- return _panels.GetCount();
- };
-
- /** Returns the wxFoldPanel reference belonging to the current index. An empty panel is returned when the
- index is out of bounds. Use GetCount() to get the amount of panels present. Collapsing and folding the
- panel does not change the order in which they are indexed. So it is safe enough to keep a reference
- to the panel by number. */
- wxFoldPanel Item(size_t i) {
- wxCHECK(i >= 0 && i < GetCount(), wxFoldPanel(0));
- return wxFoldPanel(_panels.Item(i));
- };
-
- /** Collapses the given wxFoldPanel reference, and updates the foldpanel bar. In the wxFPB_COLLAPSE_TO_BOTTOM
- style, all collapsed captions are put at the bottom of the control. In the normal mode, they stay where
- they are */
- void Collapse(const wxFoldPanel &item) {
- wxCHECK2(item.IsOk(), return);
- item.GetItem()->Collapse();
-
- RefreshPanelsFrom(item.GetItem());
- };
-
- /** Expands the given wxFoldPanel reference, and updates the foldpanel bar. In the wxFPB_COLLAPSE_TO_BOTTOM
- they will be removed from the bottom and the order where the panel originally was placed is restored. */
- void Expand(const wxFoldPanel &item) {
- wxCHECK2(item.IsOk(), return);
- item.GetItem()->Expand();
-
- RefreshPanelsFrom(item.GetItem());
- };
+
+ The wxWindow to be added can be slightly indented from left and right so it is more visibly placed
+ in the wxFoldPanel. Use ySpacing > 0 to give the control an y offset from the previous wxWindow added,
+ use leftSpacing to give it a slight indent from the left, and rightSpacing also reserves a little space
+ on the right so the wxWindow can be properly placed in the wxFoldPanel.
+
+ The following example adds a wxFoldPanel to the wxFoldPanelBar and adds two wxWindow derived controls
+ to the wxFoldPanel:
+
+ \code
+
+ // create the wxFoldPanelBar
+ _pnl = new wxFoldPanelBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFPB_DEFAULT_STYLE, wxFPB_COLLAPSE_TO_BOTTOM);
+
+ // add a foldpanel to the control. "Test me" is the caption and it is initially not collapsed.
+ wxFoldPanel item = _pnl->AddFoldPanel(wxT("Test me"), false);
+
+ // now add a button to the fold panel. Mind that the button should be made child of the
+ // wxFoldPanel and not of the main form.
+ _pnl->AddFoldPanelWindow(item, new wxButton(item.GetParent(), ID_COLLAPSEME, wxT("Collapse Me")));
+
+ // add a separator between the two controls. This is purely a visual line that can have a certain
+ // color and also the indents and width alligning like a control.
+ _pnl->AddFoldPanelSeperator(item);
+
+ // now add a text ctrl. Also very easy. Allign this on width so that when the control gets wider
+ // the text control also sizes along.
+ _pnl->AddFoldPanelWindow(item, new wxTextCtrl(item.GetParent(), wxID_ANY, wxT("Comment")), wxFPB_ALIGN_WIDTH, wxFPB_DEFAULT_YSPACING, 20);
+
+ \endcode
+ */
+ int AddFoldPanelWindow(const wxFoldPanel &panel, wxWindow *window, int flags = wxFPB_ALIGN_WIDTH,
+ int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTSPACING,
+ int rightSpacing = wxFPB_DEFAULT_RIGHTSPACING);
+
+ /** Adds a seperator line to the current wxFoldPanel. The seperator is a simple line which is drawn and is no
+ real component. It can be used to seperate groups of controls which belong to eachother. The colour is
+ adjustable, and it takes the same ySpacing, leftSpacing and rightSpacing as AddFoldPanelWindow(). */
+ int AddFoldPanelSeperator(const wxFoldPanel &panel, const wxColour &color = wxColour(167,167,167),
+ int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTLINESPACING,
+ int rightSpacing = wxFPB_DEFAULT_RIGHTLINESPACING);
+
+ /** Returns the number of panels currently present in the wxFoldPanelBar. This is independent if they are
+ visible or hidden. */
+ size_t GetCount() const {
+ return _panels.GetCount();
+ };
+
+ /** Returns the wxFoldPanel reference belonging to the current index. An empty panel is returned when the
+ index is out of bounds. Use GetCount() to get the amount of panels present. Collapsing and folding the
+ panel does not change the order in which they are indexed. So it is safe enough to keep a reference
+ to the panel by number. */
+ wxFoldPanel Item(size_t i) {
+ wxCHECK((int)i >= 0 && i < GetCount(), wxFoldPanel(0));
+ return wxFoldPanel(_panels.Item(i));
+ };
+
+ /** Collapses the given wxFoldPanel reference, and updates the foldpanel bar. In the wxFPB_COLLAPSE_TO_BOTTOM
+ style, all collapsed captions are put at the bottom of the control. In the normal mode, they stay where
+ they are */
+ void Collapse(const wxFoldPanel &item) {
+ wxCHECK2(item.IsOk(), return);
+ item.GetItem()->Collapse();
+
+ RefreshPanelsFrom(item.GetItem());
+ };
+
+ /** Expands the given wxFoldPanel reference, and updates the foldpanel bar. In the wxFPB_COLLAPSE_TO_BOTTOM
+ they will be removed from the bottom and the order where the panel originally was placed is restored. */
+ void Expand(const wxFoldPanel &item) {
+ wxCHECK2(item.IsOk(), return);
+ item.GetItem()->Expand();
+
+ RefreshPanelsFrom(item.GetItem());
+ };