1wxChoicebook(3) Erlang Module Definition wxChoicebook(3)
2
3
4
6 wxChoicebook - Functions for wxChoicebook class
7
9 wxChoicebook is a class similar to wxNotebook, but uses a wxChoice con‐
10 trol to show the labels instead of the tabs.
11
12 For usage documentation of this class, please refer to the base ab‐
13 stract class wxBookCtrl. You can also use the page_samples_notebook to
14 see wxChoicebook in action.
15
16 wxChoicebook allows the use of wxBookCtrlBase::GetControlSizer(), al‐
17 lowing a program to add other controls next to the choice control. This
18 is particularly useful when screen space is restricted, as it often is
19 when wxChoicebook is being employed.
20
21 Styles
22
23 This class supports the following styles:
24
25 See: Overview bookctrl, wxNotebook, Examples
26
27 This class is derived (and can use functions) from: wxBookCtrlBase wx‐
28 Control wxWindow wxEvtHandler
29
30 wxWidgets docs: wxChoicebook
31
33 Event types emitted from this class: choicebook_page_changed, choice‐
34 book_page_changing
35
37 wxChoicebook() = wx:wx_object()
38
40 new() -> wxChoicebook()
41
42 Constructs a choicebook control.
43
44 new(Parent, Id) -> wxChoicebook()
45
46 Types:
47
48 Parent = wxWindow:wxWindow()
49 Id = integer()
50
51 new(Parent, Id, Options :: [Option]) -> wxChoicebook()
52
53 Types:
54
55 Parent = wxWindow:wxWindow()
56 Id = integer()
57 Option =
58 {pos, {X :: integer(), Y :: integer()}} |
59 {size, {W :: integer(), H :: integer()}} |
60 {style, integer()}
61
62 addPage(This, Page, Text) -> boolean()
63
64 Types:
65
66 This = wxChoicebook()
67 Page = wxWindow:wxWindow()
68 Text = unicode:chardata()
69
70 addPage(This, Page, Text, Options :: [Option]) -> boolean()
71
72 Types:
73
74 This = wxChoicebook()
75 Page = wxWindow:wxWindow()
76 Text = unicode:chardata()
77 Option = {bSelect, boolean()} | {imageId, integer()}
78
79 Adds a new page.
80
81 The page must have the book control itself as the parent and
82 must not have been added to this control previously.
83
84 The call to this function will generate the page changing and
85 page changed events if select is true, but not when inserting
86 the very first page (as there is no previous page selection to
87 switch from in this case and so it wouldn't make sense to e.g.
88 veto such event).
89
90 Return: true if successful, false otherwise.
91
92 Remark: Do not delete the page, it will be deleted by the book
93 control.
94
95 See: insertPage/5
96
97 advanceSelection(This) -> ok
98
99 Types:
100
101 This = wxChoicebook()
102
103 advanceSelection(This, Options :: [Option]) -> ok
104
105 Types:
106
107 This = wxChoicebook()
108 Option = {forward, boolean()}
109
110 Cycles through the tabs.
111
112 The call to this function generates the page changing events.
113
114 assignImageList(This, ImageList) -> ok
115
116 Types:
117
118 This = wxChoicebook()
119 ImageList = wxImageList:wxImageList()
120
121 Sets the image list for the page control and takes ownership of
122 the list.
123
124 See: wxImageList, setImageList/2
125
126 create(This, Parent, Id) -> boolean()
127
128 Types:
129
130 This = wxChoicebook()
131 Parent = wxWindow:wxWindow()
132 Id = integer()
133
134 create(This, Parent, Id, Options :: [Option]) -> boolean()
135
136 Types:
137
138 This = wxChoicebook()
139 Parent = wxWindow:wxWindow()
140 Id = integer()
141 Option =
142 {pos, {X :: integer(), Y :: integer()}} |
143 {size, {W :: integer(), H :: integer()}} |
144 {style, integer()}
145
146 Create the choicebook control that has already been constructed
147 with the default constructor.
148
149 deleteAllPages(This) -> boolean()
150
151 Types:
152
153 This = wxChoicebook()
154
155 Deletes all pages.
156
157 getCurrentPage(This) -> wxWindow:wxWindow()
158
159 Types:
160
161 This = wxChoicebook()
162
163 Returns the currently selected page or NULL.
164
165 getImageList(This) -> wxImageList:wxImageList()
166
167 Types:
168
169 This = wxChoicebook()
170
171 Returns the associated image list, may be NULL.
172
173 See: wxImageList, setImageList/2
174
175 getPage(This, Page) -> wxWindow:wxWindow()
176
177 Types:
178
179 This = wxChoicebook()
180 Page = integer()
181
182 Returns the window at the given page position.
183
184 getPageCount(This) -> integer()
185
186 Types:
187
188 This = wxChoicebook()
189
190 Returns the number of pages in the control.
191
192 getPageImage(This, NPage) -> integer()
193
194 Types:
195
196 This = wxChoicebook()
197 NPage = integer()
198
199 Returns the image index for the given page.
200
201 getPageText(This, NPage) -> unicode:charlist()
202
203 Types:
204
205 This = wxChoicebook()
206 NPage = integer()
207
208 Returns the string for the given page.
209
210 getSelection(This) -> integer()
211
212 Types:
213
214 This = wxChoicebook()
215
216 Returns the currently selected page, or wxNOT_FOUND if none was
217 selected.
218
219 Note that this method may return either the previously or newly
220 selected page when called from the EVT_BOOKCTRL_PAGE_CHANGED
221 handler depending on the platform and so wxBookCtrlEvent:getSe‐
222 lection/1 should be used instead in this case.
223
224 hitTest(This, Pt) -> Result
225
226 Types:
227
228 Result = {Res :: integer(), Flags :: integer()}
229 This = wxChoicebook()
230 Pt = {X :: integer(), Y :: integer()}
231
232 Returns the index of the tab at the specified position or
233 wxNOT_FOUND if none.
234
235 If flags parameter is non-NULL, the position of the point inside
236 the tab is returned as well.
237
238 Return: Returns the zero-based tab index or wxNOT_FOUND if there
239 is no tab at the specified position.
240
241 insertPage(This, Index, Page, Text) -> boolean()
242
243 Types:
244
245 This = wxChoicebook()
246 Index = integer()
247 Page = wxWindow:wxWindow()
248 Text = unicode:chardata()
249
250 insertPage(This, Index, Page, Text, Options :: [Option]) ->
251 boolean()
252
253 Types:
254
255 This = wxChoicebook()
256 Index = integer()
257 Page = wxWindow:wxWindow()
258 Text = unicode:chardata()
259 Option = {bSelect, boolean()} | {imageId, integer()}
260
261 Inserts a new page at the specified position.
262
263 Return: true if successful, false otherwise.
264
265 Remark: Do not delete the page, it will be deleted by the book
266 control.
267
268 See: addPage/4
269
270 setImageList(This, ImageList) -> ok
271
272 Types:
273
274 This = wxChoicebook()
275 ImageList = wxImageList:wxImageList()
276
277 Sets the image list to use.
278
279 It does not take ownership of the image list, you must delete it
280 yourself.
281
282 See: wxImageList, assignImageList/2
283
284 setPageSize(This, Size) -> ok
285
286 Types:
287
288 This = wxChoicebook()
289 Size = {W :: integer(), H :: integer()}
290
291 Sets the width and height of the pages.
292
293 Note: This method is currently not implemented for wxGTK.
294
295 setPageImage(This, Page, Image) -> boolean()
296
297 Types:
298
299 This = wxChoicebook()
300 Page = Image = integer()
301
302 Sets the image index for the given page.
303
304 image is an index into the image list which was set with setIm‐
305 ageList/2.
306
307 setPageText(This, Page, Text) -> boolean()
308
309 Types:
310
311 This = wxChoicebook()
312 Page = integer()
313 Text = unicode:chardata()
314
315 Sets the text for the given page.
316
317 setSelection(This, Page) -> integer()
318
319 Types:
320
321 This = wxChoicebook()
322 Page = integer()
323
324 Sets the selection to the given page, returning the previous se‐
325 lection.
326
327 Notice that the call to this function generates the page chang‐
328 ing events, use the changeSelection/2 function if you don't want
329 these events to be generated.
330
331 See: getSelection/1
332
333 changeSelection(This, Page) -> integer()
334
335 Types:
336
337 This = wxChoicebook()
338 Page = integer()
339
340 Changes the selection to the given page, returning the previous
341 selection.
342
343 This function behaves as setSelection/2 but does not generate
344 the page changing events.
345
346 See overview_events_prog for more information.
347
348 destroy(This :: wxChoicebook()) -> ok
349
350 Destroys the object.
351
352
353
354wxWidgets team. wx 2.2.1 wxChoicebook(3)