File: collpane.tex

package info (click to toggle)
wxwidgets2.8 2.8.10.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 239,052 kB
  • ctags: 289,550
  • sloc: cpp: 1,838,857; xml: 396,717; python: 282,506; ansic: 126,171; makefile: 51,406; sh: 14,581; asm: 299; sql: 258; lex: 194; perl: 139; yacc: 128; pascal: 95; php: 39; lisp: 38; tcl: 24; haskell: 20; java: 18; cs: 18; erlang: 17; ruby: 16; ada: 9; ml: 9; csh: 9
file content (229 lines) | stat: -rw-r--r-- 7,248 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name:        collpane.tex
%% Purpose:     wxCollapsiblePane documentation
%% Author:      Francesco Montorsi
%% Created:     2006-10-14
%% RCS-ID:      $Id: collpane.tex 48887 2007-09-21 17:53:07Z JS $
%% Copyright:   (c) 2006 Francesco Montorsi
%% License:     wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{\class{wxCollapsiblePane}}\label{wxcollapsiblepane}

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 \helpref{GetPane}{wxcollapsiblepanegetpane}
function to access the pane and add your controls inside it (i.e. use the
\helpref{GetPane}{wxcollapsiblepanegetpane}'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 \helpref{wxSizer}{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:

\begin{verbatim}
    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);

\end{verbatim}


It is only available if \texttt{wxUSE\_COLLPANE} is set to $1$ (the default).

\wxheading{Derived from}

\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/collpane.h>

\wxheading{Window styles}

\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxCP\_DEFAULT\_STYLE}}{The default style: 0.}
\end{twocollist}

\wxheading{Event handling}

To process a collapsible pane event, use these event handler macros to direct input to member
functions that take a \helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent} argument.

\twocolwidtha{7cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane. }
\end{twocollist}


\wxheading{See also}

\helpref{wxPanel}{wxpanel},\\
\helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent}

\latexignore{\rtfignore{\wxheading{Members}}}



\membersection{wxCollapsiblePane::wxCollapsiblePane}\label{wxcollapsiblepanector}

\func{}{wxCollapsiblePane}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxString\& }{label},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``collapsiblePane"}}

Initializes the object and calls \helpref{Create}{wxcollapsiblepanecreate} with
all the parameters.


\membersection{wxCollapsiblePane::Create}\label{wxcollapsiblepanecreate}

\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxString\& }{label},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``collapsiblePane"}}

\wxheading{Parameters}

\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}

\docparam{id}{The identifier for the control.}

\docparam{label}{The initial label shown in the button which allows the user to expand or collapse the pane window.}

\docparam{pos}{Initial position.}

\docparam{size}{Initial size.}

\docparam{style}{The window style, see {\tt wxCP\_*} flags.}

\docparam{validator}{Validator which can be used for additional date checks.}

\docparam{name}{Control name.}

\wxheading{Return value}

\true if the control was successfully created or \false if creation failed.


\membersection{wxCollapsiblePane::IsCollapsed}\label{wxcollapsiblepaneiscollapsed}

\constfunc{bool}{IsCollapsed}{\void}

Returns \true if the pane window is currently hidden.


\membersection{wxCollapsiblePane::IsExpanded}\label{wxcollapsiblepaneisexpanded}

\constfunc{bool}{IsExpanded}{\void}

Returns \true if the pane window is currently shown.


\membersection{wxCollapsiblePane::Collapse}\label{wxcollapsiblepanecollapse}

\func{void}{Collapse}{\param{bool }{collapse = true}}

Collapses or expands the pane window.


\membersection{wxCollapsiblePane::Expand}\label{wxcollapsiblepaneexpand}

\func{void}{Expand}{\void}

Same as \texttt{\helpref{Collapse}{wxcollapsiblepanecollapse}(false)}.


\membersection{wxCollapsiblePane::GetPane}\label{wxcollapsiblepanegetpane}

\constfunc{wxWindow *}{GetPane}{\void}

Returns a pointer to the pane window. Add controls to the returned \helpref{wxWindow}{wxwindow}
to make them collapsible.





%% wxCollapsiblePaneEvent documentation

\section{\class{wxCollapsiblePaneEvent}}\label{wxcollapsiblepaneevent}

This event class is used for the events generated by
\helpref{wxCollapsiblePane}{wxcollapsiblepane}.

\wxheading{Derived from}

\helpref{wxCommandEvent}{wxcommandevent}\\
\helpref{wxEvent}{wxevent}\\
\helpref{wxObject}{wxobject}

\wxheading{Include files}

<wx/collpane.h>

\wxheading{Event handling}

To process input from a wxCollapsiblePane, use one of these event handler macros to
direct input to member function that take a
\helpref{wxCollapsiblePaneEvent}{wxcollapsiblepaneevent} argument:

\twocolwidtha{7cm}
\begin{twocollist}
\twocolitem{{\bf EVT\_COLLAPSIBLEPANE\_CHANGED(id, func)}}{The user showed or hidden the collapsible pane.}
\end{twocollist}%


\wxheading{See also}

\helpref{wxCollapsiblePane}{wxcollapsiblepane}

\latexignore{\rtfignore{\wxheading{Members}}}

\membersection{wxCollapsiblePaneEvent::wxCollapsiblePaneEvent}\label{wxcollapsiblepaneeventctor}

\func{}{wxCollapsiblePaneEvent}{\param{wxObject *}{ generator}, \param{int}{ id}, \param{bool}{ collapsed}}

The constructor is not normally used by the user code.


\membersection{wxCollapsiblePaneEvent::GetCollapsed}\label{wxcollapsiblepaneeventgetcollapsed}

\constfunc{bool}{GetCollapsed}{\void}

Returns \true if the pane has been collapsed.


\membersection{wxCollapsiblePaneEvent::SetCollapsed}\label{wxcollapsiblepaneeventsetcollapsed}

\func{void}{SetCollapsed}{\param{bool}{ collapsed}}

Sets this as a collapsed pane event (if \arg{collapsed} is \true) or as an expanded
pane event (if \arg{collapsed} is \false).