]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/tab.tex
Added 'Include files' section to class references
[wxWidgets.git] / docs / latex / wx / tab.tex
1 \section{\class{wxTabbedDialog}}\label{wxtabbeddialog}
2
3 A dialog suitable for handling tabs.
4
5 \wxheading{Derived from}
6
7 \helpref{wxDialog}{wxdialog}\\
8 \helpref{wxEvtHandler}{wxevthandler}\\
9 \helpref{wxObject}{wxobject}
10
11 \wxheading{Include files}
12
13 <wx/tab.h>
14
15 \wxheading{See also}
16
17 \helpref{Tab classes overview}{wxtaboverview}
18
19 \latexignore{\rtfignore{\wxheading{Members}}}
20
21 \membersection{wxTabbedDialog::wxTabbedDialog}
22
23 \func{}{wxTabbedDialog}{\param{wxWindow *}{parent}, \param{wxWindowID }{id},
24 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
25 \param{long}{ style=wxDEFAULT\_DIALOG\_STYLE}, \param{const wxString\& }{name="dialogBox"}}
26
27 Constructor.
28
29 \membersection{wxTabbedDialog::\destruct{wxTabbedDialog}}
30
31 \func{}{\destruct{wxTabbedDialog}}{\void}
32
33 Destructor. This destructor deletes the tab view associated with the dialog box.
34 If you do not wish this to happen, set the tab view to NULL before destruction (for example,
35 in the OnCloseWindow event handler).
36
37 \membersection{wxTabbedDialog::SetTabView}
38
39 \func{void}{SetTabView}{\param{wxTabView *}{view}}
40
41 Sets the tab view associated with the dialog box.
42
43 \membersection{wxTabbedDialog::GetTabView}
44
45 \func{wxTabView *}{GetTabView}{\void}
46
47 Returns the tab view associated with the dialog box.
48
49 \section{\class{wxTabbedPanel}}\label{wxtabbedpanel}
50
51 A panel suitable for handling tabs.
52
53 \wxheading{Derived from}
54
55 \helpref{wxPanel}{wxpanel}\\
56 \helpref{wxEvtHandler}{wxevthandler}\\
57 \helpref{wxObject}{wxobject}
58
59 \wxheading{Include files}
60
61 <wx/tab.h>
62
63 \wxheading{See also}
64
65 \helpref{Tab classes overview}{wxtaboverview}
66
67 \latexignore{\rtfignore{\wxheading{Members}}}
68
69 \membersection{wxTabbedPanel::wxTabbedPanel}
70
71 \func{}{wxTabbedPanel}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},
72 \param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
73 \param{long}{ style=0}, \param{const wxString\& }{name="panel"}}
74
75 Constructor.
76
77 \membersection{wxTabbedPanel::SetTabView}
78
79 \func{void}{SetTabView}{\param{wxTabView *}{view}}
80
81 Sets the tab view associated with the panel.
82
83 \membersection{wxTabbedPanel::GetTabView}
84
85 \func{wxTabView *}{GetTabView}{\void}
86
87 Returns the tab view associated with the panel.
88
89 \section{\class{wxTabControl}}\label{wxtabcontrol}
90
91 You will rarely need to use this class directly.
92
93 \wxheading{Derived from}
94
95 \helpref{wxObject}{wxobject}
96
97 \wxheading{Include files}
98
99 <wx/tab.h>
100
101 \wxheading{See also}
102
103 \overview{Tab classes overview}{wxtaboverview}
104
105 \latexignore{\rtfignore{\wxheading{Members}}}
106
107 \membersection{wxTabControl::wxTabControl}
108
109 \func{void}{wxTabControl}{\param{wxTabView *}{view = NULL}}
110
111 Constructor.
112
113 \membersection{wxTabControl::GetColPosition}
114
115 \func{int}{GetColPosition}{\void}
116
117 Returns the position of the tab in the tab column.
118
119 \membersection{wxTabControl::GetFont}
120
121 \func{wxFont *}{GetFont}{\void}
122
123 Returns the font to be used for this tab.
124
125 \membersection{wxTabControl::GetHeight}
126
127 \func{int}{GetHeight}{\void}
128
129 Returns the tab height.
130
131 \membersection{wxTabControl::GetId}
132
133 \func{int}{GetId}{\void}
134
135 Returns the tab identifier.
136
137 \membersection{wxTabControl::GetLabel}
138
139 \func{wxString}{GetLabel}{\void}
140
141 Returns the tab label.
142
143 \membersection{wxTabControl::GetRowPosition}
144
145 \func{int}{GetRowPosition}{\void}
146
147 Returns the position of the tab in the layer or row.
148
149 \membersection{wxTabControl::GetSelected}
150
151 \func{bool}{GetSelected}{\void}
152
153 Returns the selected flag.
154
155 \membersection{wxTabControl::GetWidth}
156
157 \func{int}{GetWidth}{\void}
158
159 Returns the tab width.
160
161 \membersection{wxTabControl::GetX}
162
163 \func{int}{GetX}{\void}
164
165 Returns the x offset from the top-left of the view area.
166
167 \membersection{wxTabControl::GetY}
168
169 \func{int}{GetY}{\void}
170
171 Returns the y offset from the top-left of the view area.
172
173 \membersection{wxTabControl::HitTest}
174
175 \func{bool}{HitTest}{\param{int}{ x}, \param{int}{ y}}
176
177 Returns TRUE if the point x, y is within the tab area.
178
179 \membersection{wxTabControl::OnDraw}
180
181 \func{void}{OnDraw}{\param{wxDC\& }{dc}, \param{bool}{ lastInRow}}
182
183 Draws the tab control on the given device context.
184
185 \membersection{wxTabControl::SetColPosition}
186
187 \func{void}{SetColPosition}{\param{int}{ pos}}
188
189 Sets the position in the column.
190
191 \membersection{wxTabControl::SetFont}
192
193 \func{void}{SetFont}{\param{wxFont *}{font}}
194
195 Sets the font to be used for this tab.
196
197 \membersection{wxTabControl::SetId}
198
199 \func{void}{SetId}{\param{int}{ id}}
200
201 Sets the tab identifier.
202
203 \membersection{wxTabControl::SetLabel}
204
205 \func{void}{SetLabel}{\param{const wxString\& }{str}}
206
207 Sets the label for the tab.
208
209 \membersection{wxTabControl::SetPosition}
210
211 \func{void}{SetPosition}{\param{int}{ x}, \param{int}{ y}}
212
213 Sets the x and y offsets for this tab, measured from the top-left of the view area.
214
215 \membersection{wxTabControl::SetRowPosition}
216
217 \func{void}{SetRowPosition}{\param{int}{ pos}}
218
219 Sets the position on the layer (row).
220
221 \membersection{wxTabControl::SetSelected}
222
223 \func{void}{SetSelected}{\param{bool }{selected}}
224
225 Sets the selection flag for this tab (does not set the current tab for the view;
226 use wxTabView::SetSelectedTab for that).
227
228 \membersection{wxTabControl::SetSize}
229
230 \func{void}{SetSize}{\param{int}{ width}, \param{int}{ height}}
231
232 Sets the width and height for this tab.
233
234 \section{\class{wxTabView}}\label{wxtabview}
235
236 Responsible for drawing tabs onto a window, and dealing with input.
237
238 \wxheading{Derived from}
239
240 \helpref{wxObject}{wxobject}
241
242 \wxheading{Include files}
243
244 <wx/tab.h>
245
246 \wxheading{See also}
247
248 \helpref{wxTabView overview}{wxtabviewoverview}, \helpref{wxPanelTabView}{wxpaneltabview}
249
250 \latexignore{\rtfignore{\wxheading{Members}}}
251
252 \membersection{wxTabView::wxTabView}
253
254 \func{}{wxTabView}{\param{long }{style = wxTAB\_STYLE\_DRAW\_BOX \pipe wxTAB\_STYLE\_COLOUR\_INTERIOR}}
255
256 Constructor.
257
258 {\it style} may be a bit list of the following:
259
260 \begin{twocollist}\itemsep=0pt
261 \twocolitem{wxTAB\_STYLE\_DRAW\_BOX}{Draw a box around the view area. Most commonly used for dialogs.}
262 \twocolitem{wxTAB\_STYLE\_COLOUR\_INTERIOR}{Draw tab backgrounds in the specified colour. Omitting this style
263 will ensure that the tab background matches the dialog background.}
264 \end{twocollist}
265
266 \membersection{wxTabView::AddTab}\label{wxtabviewaddtab}
267
268 \func{wxTabControl *}{AddTab}{\param{int}{ id}, \param{const wxString\& }{label}, \param{wxTabControl *}{existingTab=NULL}}
269
270 Adds a tab to the view.
271
272 {\it id} is the application-chosen identifier for the tab, which will be used in subsequent tab operations.
273
274 {\it label} is the label to give the tab.
275
276 {\it existingTab} maybe NULL to specify a new tab, or non-NULL to indicate that an existing tab should be used.
277
278 A new layer (row) is started when the current layer has been filled up with tabs.
279
280 \membersection{wxTabView::CalculateTabWidth}\label{wxtabviewcalculatetabwidth}
281
282 \func{int}{CalculateTabWidth}{\param{int}{ noTabs}, \param{bool}{ adjustView = FALSE}}
283
284 The application can specify the tab width using this function, in terms
285 of the number of tabs per layer (row) which will fit the view area, which
286 should have been set previously with SetViewRect.
287
288 {\it noTabs} is the number of tabs which should take up the full width
289 of the view area.
290
291 {\it adjustView} can be set to TRUE in order to readjust the view width
292 to exactly fit the given number of tabs.
293
294 The new tab width is returned.
295
296 \membersection{wxTabView::ClearTabs}
297
298 \func{void}{ClearTabs}{\param{bool }{deleteTabs=TRUE}}
299
300 Clears the tabs, deleting them if {\it deleteTabs} is TRUE.
301
302 \membersection{wxTabView::Draw}
303
304 \func{void}{Draw}{\param{wxDC\& }{dc}}
305
306 Draws the tabs and (optionally) a box around the view area.
307
308 \membersection{wxTabView::FindTabControlForId}
309
310 \func{wxTabControl *}{FindTabControlForId}{\param{int}{ id}}
311
312 Finds the wxTabControl corresponding to {\it id}.
313
314 \membersection{wxTabView::FindTabControlForPosition}
315
316 \func{wxTabControl *}{FindTabControlForPosition}{\param{int}{ layer}, \param{int}{ position}}
317
318 Finds the wxTabControl at layer {\it layer}, position in layer {\it position}, both starting from
319 zero. Note that tabs change layer as they are selected or deselected.
320
321 \membersection{wxTabView::GetBackgroundBrush}
322
323 \func{wxBrush *}{GetBackgroundBrush}{\void}
324
325 Returns the brush used to draw in the background colour. It is set when
326 SetBackgroundColour is called.
327
328 \membersection{wxTabView::GetBackgroundColour}
329
330 \func{wxColour}{GetBackgroundColour}{\void}
331
332 Returns the colour used for each tab background. By default, this is
333 light grey. To ensure a match with the dialog or panel background, omit
334 the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
335
336 \membersection{wxTabView::GetBackgroundPen}
337
338 \func{wxPen *}{GetBackgroundPen}{\void}
339
340 Returns the pen used to draw in the background colour. It is set when
341 SetBackgroundColour is called.
342
343 \membersection{wxTabView::GetHighlightColour}
344
345 \func{wxColour}{GetHighlightColour}{\void}
346
347 Returns the colour used for bright highlights on the left side of `3D' surfaces. By default, this is white.
348
349 \membersection{wxTabView::GetHighlightPen}
350
351 \func{wxPen *}{GetHighlightPen}{\void}
352
353 Returns the pen used to draw 3D effect highlights. This is set when
354 SetHighlightColour is called.
355
356 \membersection{wxTabView::GetHorizontalTabOffset}
357
358 \func{int}{GetHorizontalTabOffset}{\void}
359
360 Returns the horizontal spacing by which each tab layer is offset from the one below.
361
362 \membersection{wxTabView::GetNumberOfLayers}
363
364 \func{int}{GetNumberOfLayers}{\void}
365
366 Returns the number of layers (rows of tabs).
367
368 \membersection{wxTabView::GetSelectedTabFont}
369
370 \func{wxFont *}{GetSelectedTabFont}{\void}
371
372 Returns the font to be used for the selected tab label.
373
374 \membersection{wxTabView::GetShadowColour}
375
376 \func{wxColour}{GetShadowColour}{\void}
377
378 Returns the colour used for shadows on the right-hand side of `3D' surfaces. By default, this is dark grey.
379
380 \membersection{wxTabView::GetTabHeight}
381
382 \func{int}{GetTabHeight}{\void}
383
384 Returns the tab default height.
385
386 \membersection{wxTabView::GetTabFont}
387
388 \func{wxFont *}{GetTabFont}{\void}
389
390 Returns the tab label font.
391
392 \membersection{wxTabView::GetTabSelectionHeight}
393
394 \func{int}{GetTabSelectionHeight}{\void}
395
396 Returns the height to be used for the currently selected tab; normally a few pixels
397 higher than the other tabs.
398
399 \membersection{wxTabView::GetTabStyle}
400
401 \func{long}{GetTabStyle}{\void}
402
403 Returns the tab style. See constructor documentation for details of valid styles.
404
405 \membersection{wxTabView::GetTabWidth}
406
407 \func{int}{GetTabWidth}{\void}
408
409 Returns the tab default width.
410
411 \membersection{wxTabView::GetTextColour}
412
413 \func{wxColour}{GetTextColour}{\void}
414
415 Returns the colour used to draw label text. By default, this is
416 black.
417
418 \membersection{wxTabView::GetTopMargin}
419
420 \func{int}{GetTopMargin}{\void}
421
422 Returns the height between the top of the view area and the bottom of the first
423 row of tabs.
424
425 \membersection{wxTabView::GetShadowPen}
426
427 \func{wxPen *}{GetShadowPen}{\void}
428
429 Returns the pen used to draw 3D effect shadows. This is set when
430 SetShadowColour is called.
431
432 \membersection{wxTabView::GetViewRect}
433
434 \func{wxRectangle}{GetViewRect}{\void}
435
436 Returns the rectangle specifying the view area (above which tabs are
437 placed).
438
439 \membersection{wxTabView::GetVerticalTabTextSpacing}
440
441 \func{int}{GetVerticalTabTextSpacing}{\void}
442
443 Returns the vertical spacing between the top of an unselected tab, and the tab label.
444
445 \membersection{wxTabView::GetWindow}
446
447 \func{wwxWindow *}{GetWindow}{\void}
448
449 Returns the window for the view.
450
451 \membersection{wxTabView::OnCreateTabControl}
452
453 \func{wxTabControl *}{OnCreateTabControl}{\void}
454
455 Creates a new tab control. By default, this returns a wxTabControl object, but the application may wish
456 to define a derived class, in which case the tab view should be subclassed and this function overridden.
457
458 \membersection{wxTabView::Layout}
459
460 \func{void}{Layout}{\void}
461
462 Recalculates the positions of the tabs, and adjusts the layer of the selected tab if necessary.
463
464 You may want to call this function if the view width has changed (for example, from an OnSize handler).
465
466 \membersection{wxTabView::OnEvent}
467
468 \func{bool}{OnEvent}{\param{wxMouseEvent\& }{event}}
469
470 Processes mouse events sent from the panel or dialog. Returns TRUE if the event was processed,
471 FALSE otherwise.
472
473 \membersection{wxTabView::OnTabActivate}
474
475 \func{void}{OnTabActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}
476
477 Called when a tab is activated, with the new active tab id, and the former active tab id.
478
479 \membersection{wxTabView::OnTabPreActivate}
480
481 \func{bool}{OnTabPreActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}
482
483 Called just before a tab is activated, with the new active tab id, and the former active tab id.
484
485 If the function returns FALSE, the tab is not activated.
486
487 \membersection{wxTabView::SetBackgroundColour}
488
489 \func{void}{SetBackgroundColour}{\param{const wxColour\&}{ col}}
490
491 Sets the colour to be used for each tab background. By default, this is
492 light grey. To ensure a match with the dialog or panel background, omit
493 the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
494
495 \membersection{wxTabView::SetHighlightColour}
496
497 \func{void}{SetHighlightColour}{\param{const wxColour\&}{ col}}
498
499 Sets the colour to be used for bright highlights on the left side of `3D' surfaces. By default, this is white.
500
501 \membersection{wxTabView::SetHorizontalTabOffset}
502
503 \func{void}{SetHorizontalTabOffset}{\param{int}{ offset}}
504
505 Sets the horizontal spacing by which each tab layer is offset from the one below.
506
507 \membersection{wxTabView::SetSelectedTabFont}
508
509 \func{void}{SetSelectedTabFont}{\param{wxFont *}{font}}
510
511 Sets the font to be used for the selected tab label.
512
513 \membersection{wxTabView::SetShadowColour}
514
515 \func{void}{SetShadowColour}{\param{const wxColour\&}{ col}}
516
517 Sets the colour to be used for shadows on the right-hand side of `3D' surfaces. By default, this is dark grey.
518
519 \membersection{wxTabView::SetTabFont}
520
521 \func{void}{SetTabFont}{\param{wxFont *}{font}}
522
523 Sets the tab label font.
524
525 \membersection{wxTabView::SetTabStyle}
526
527 \func{void}{SetTabStyle}{\param{long}{ tabStyle}}
528
529 Sets the tab style. See constructor documentation for details of valid styles.
530
531 \membersection{wxTabView::SetTabSize}
532
533 \func{void}{SetTabSize}{\param{int}{ width}, \param{int}{ height}}
534
535 Sets the tab default width and height.
536
537 \membersection{wxTabView::SetTabSelectionHeight}
538
539 \func{void}{SetTabSelectionHeight}{\param{int}{ height}}
540
541 Sets the height to be used for the currently selected tab; normally a few pixels
542 higher than the other tabs.
543
544 \membersection{wxTabView::SetTabSelection}
545
546 \func{void}{SetTabSelection}{\param{int}{ sel}, \param{bool}{ activateTool=TRUE}}
547
548 Sets the selected tab, calling the application's OnTabActivate function.
549
550 If {\it activateTool} is FALSE, OnTabActivate will not be called.
551
552 \membersection{wxTabView::SetTextColour}
553
554 \func{void}{SetTextColour}{\param{const wxColour\&}{ col}}
555
556 Sets the colour to be used to draw label text. By default, this is
557 black.
558
559 \membersection{wxTabView::SetTopMargin}
560
561 \func{void}{SetTopMargin}{\param{int}{ margin}}
562
563 Sets the height between the top of the view area and the bottom of the first
564 row of tabs.
565
566 \membersection{wxTabView::SetVerticalTabTextSpacing}
567
568 \func{void}{SetVerticalTabTextSpacing}{\param{int}{ spacing}}
569
570 Sets the vertical spacing between the top of an unselected tab, and the tab label.
571
572 \membersection{wxTabView::SetViewRect}\label{wxtabviewsetviewrect}
573
574 \func{void}{SetViewRect}{\param{const wxRectangle\& }{rect}}
575
576 Sets the rectangle specifying the view area (above which tabs are
577 placed). This must be set by the application.
578
579 \membersection{wxTabView::SetWindow}
580
581 \func{void}{SetWindow}{\param{wxWindow *}{window}}
582
583 Set the window that the tab view will use for drawing onto.
584