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