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