]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/tab.tex
more wxConfig and xwLog docs (sorry for the delay)
[wxWidgets.git] / docs / latex / wx / tab.tex
CommitLineData
a660d684
KB
1\section{\class{wxTabbedDialog}}\label{wxtabbeddialog}
2
3A 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
eaaa6a06 19\func{}{wxTabbedDialog}{\param{wxWindow *}{parent}, \param{wxWindowID }{id},
a660d684 20 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
eaaa6a06 21 \param{long}{ style=wxDEFAULT\_DIALOG\_STYLE}, \param{const wxString\& }{name="dialogBox"}}
a660d684
KB
22
23Constructor.
24
25\membersection{wxTabbedDialog::\destruct{wxTabbedDialog}}
26
27\func{}{\destruct{wxTabbedDialog}}{\void}
28
29Destructor. This destructor deletes the tab view associated with the dialog box.
30If you do not wish this to happen, set the tab view to NULL before destruction (for example,
31in the OnCloseWindow event handler).
32
33\membersection{wxTabbedDialog::SetTabView}
34
35\func{void}{SetTabView}{\param{wxTabView *}{view}}
36
37Sets the tab view associated with the dialog box.
38
39\membersection{wxTabbedDialog::GetTabView}
40
41\func{wxTabView *}{GetTabView}{\void}
42
43Returns the tab view associated with the dialog box.
44
45\section{\class{wxTabbedPanel}}\label{wxtabbedpanel}
46
47A 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
eaaa6a06 63\func{}{wxTabbedPanel}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},
a660d684 64 \param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
eaaa6a06 65 \param{long}{ style=0}, \param{const wxString\& }{name="panel"}}
a660d684
KB
66
67Constructor.
68
69\membersection{wxTabbedPanel::SetTabView}
70
71\func{void}{SetTabView}{\param{wxTabView *}{view}}
72
73Sets the tab view associated with the panel.
74
75\membersection{wxTabbedPanel::GetTabView}
76
77\func{wxTabView *}{GetTabView}{\void}
78
79Returns the tab view associated with the panel.
80
81\section{\class{wxTabControl}}\label{wxtabcontrol}
82
83You 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
99Constructor.
100
101\membersection{wxTabControl::GetColPosition}
102
103\func{int}{GetColPosition}{\void}
104
105Returns the position of the tab in the tab column.
106
107\membersection{wxTabControl::GetFont}
108
109\func{wxFont *}{GetFont}{\void}
110
111Returns the font to be used for this tab.
112
113\membersection{wxTabControl::GetHeight}
114
115\func{int}{GetHeight}{\void}
116
117Returns the tab height.
118
119\membersection{wxTabControl::GetId}
120
121\func{int}{GetId}{\void}
122
123Returns the tab identifier.
124
125\membersection{wxTabControl::GetLabel}
126
127\func{wxString}{GetLabel}{\void}
128
129Returns the tab label.
130
131\membersection{wxTabControl::GetRowPosition}
132
133\func{int}{GetRowPosition}{\void}
134
135Returns the position of the tab in the layer or row.
136
137\membersection{wxTabControl::GetSelected}
138
139\func{bool}{GetSelected}{\void}
140
141Returns the selected flag.
142
143\membersection{wxTabControl::GetWidth}
144
145\func{int}{GetWidth}{\void}
146
147Returns the tab width.
148
149\membersection{wxTabControl::GetX}
150
151\func{int}{GetX}{\void}
152
153Returns the x offset from the top-left of the view area.
154
155\membersection{wxTabControl::GetY}
156
157\func{int}{GetY}{\void}
158
159Returns 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
165Returns 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
171Draws the tab control on the given device context.
172
173\membersection{wxTabControl::SetColPosition}
174
175\func{void}{SetColPosition}{\param{int}{ pos}}
176
177Sets the position in the column.
178
179\membersection{wxTabControl::SetFont}
180
181\func{void}{SetFont}{\param{wxFont *}{font}}
182
183Sets the font to be used for this tab.
184
185\membersection{wxTabControl::SetId}
186
187\func{void}{SetId}{\param{int}{ id}}
188
189Sets the tab identifier.
190
191\membersection{wxTabControl::SetLabel}
192
193\func{void}{SetLabel}{\param{const wxString\& }{str}}
194
195Sets the label for the tab.
196
197\membersection{wxTabControl::SetPosition}
198
199\func{void}{SetPosition}{\param{int}{ x}, \param{int}{ y}}
200
201Sets 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
207Sets the position on the layer (row).
208
209\membersection{wxTabControl::SetSelected}
210
211\func{void}{SetSelected}{\param{bool }{selected}}
212
213Sets the selection flag for this tab (does not set the current tab for the view;
214use wxTabView::SetSelectedTab for that).
215
216\membersection{wxTabControl::SetSize}
217
218\func{void}{SetSize}{\param{int}{ width}, \param{int}{ height}}
219
220Sets the width and height for this tab.
221
222\section{\class{wxTabView}}\label{wxtabview}
223
224Responsible 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
240Constructor.
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
247will 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
254Adds 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
262A 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
268The application can specify the tab width using this function, in terms
269of the number of tabs per layer (row) which will fit the view area, which
270should have been set previously with SetViewRect.
271
272{\it noTabs} is the number of tabs which should take up the full width
273of the view area.
274
275{\it adjustView} can be set to TRUE in order to readjust the view width
276to exactly fit the given number of tabs.
277
278The new tab width is returned.
279
280\membersection{wxTabView::ClearTabs}
281
282\func{void}{ClearTabs}{\param{bool }{deleteTabs=TRUE}}
283
284Clears the tabs, deleting them if {\it deleteTabs} is TRUE.
285
286\membersection{wxTabView::Draw}
287
288\func{void}{Draw}{\param{wxDC\& }{dc}}
289
290Draws the tabs and (optionally) a box around the view area.
291
292\membersection{wxTabView::FindTabControlForId}
293
294\func{wxTabControl *}{FindTabControlForId}{\param{int}{ id}}
295
296Finds the wxTabControl corresponding to {\it id}.
297
298\membersection{wxTabView::FindTabControlForPosition}
299
300\func{wxTabControl *}{FindTabControlForPosition}{\param{int}{ layer}, \param{int}{ position}}
301
302Finds the wxTabControl at layer {\it layer}, position in layer {\it position}, both starting from
303zero. Note that tabs change layer as they are selected or deselected.
304
305\membersection{wxTabView::GetBackgroundBrush}
306
307\func{wxBrush *}{GetBackgroundBrush}{\void}
308
309Returns the brush used to draw in the background colour. It is set when
310SetBackgroundColour is called.
311
312\membersection{wxTabView::GetBackgroundColour}
313
314\func{wxColour}{GetBackgroundColour}{\void}
315
316Returns the colour used for each tab background. By default, this is
317light grey. To ensure a match with the dialog or panel background, omit
318the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
319
320\membersection{wxTabView::GetBackgroundPen}
321
322\func{wxPen *}{GetBackgroundPen}{\void}
323
324Returns the pen used to draw in the background colour. It is set when
325SetBackgroundColour is called.
326
327\membersection{wxTabView::GetHighlightColour}
328
329\func{wxColour}{GetHighlightColour}{\void}
330
331Returns 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
337Returns the pen used to draw 3D effect highlights. This is set when
338SetHighlightColour is called.
339
340\membersection{wxTabView::GetHorizontalTabOffset}
341
342\func{int}{GetHorizontalTabOffset}{\void}
343
344Returns 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
350Returns the number of layers (rows of tabs).
351
352\membersection{wxTabView::GetSelectedTabFont}
353
354\func{wxFont *}{GetSelectedTabFont}{\void}
355
356Returns the font to be used for the selected tab label.
357
358\membersection{wxTabView::GetShadowColour}
359
360\func{wxColour}{GetShadowColour}{\void}
361
362Returns 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
368Returns the tab default height.
369
370\membersection{wxTabView::GetTabFont}
371
372\func{wxFont *}{GetTabFont}{\void}
373
374Returns the tab label font.
375
376\membersection{wxTabView::GetTabSelectionHeight}
377
378\func{int}{GetTabSelectionHeight}{\void}
379
380Returns the height to be used for the currently selected tab; normally a few pixels
381higher than the other tabs.
382
383\membersection{wxTabView::GetTabStyle}
384
385\func{long}{GetTabStyle}{\void}
386
387Returns the tab style. See constructor documentation for details of valid styles.
388
389\membersection{wxTabView::GetTabWidth}
390
391\func{int}{GetTabWidth}{\void}
392
393Returns the tab default width.
394
395\membersection{wxTabView::GetTextColour}
396
397\func{wxColour}{GetTextColour}{\void}
398
399Returns the colour used to draw label text. By default, this is
400black.
401
402\membersection{wxTabView::GetTopMargin}
403
404\func{int}{GetTopMargin}{\void}
405
406Returns the height between the top of the view area and the bottom of the first
407row of tabs.
408
409\membersection{wxTabView::GetShadowPen}
410
411\func{wxPen *}{GetShadowPen}{\void}
412
413Returns the pen used to draw 3D effect shadows. This is set when
414SetShadowColour is called.
415
416\membersection{wxTabView::GetViewRect}
417
418\func{wxRectangle}{GetViewRect}{\void}
419
420Returns the rectangle specifying the view area (above which tabs are
421placed).
422
423\membersection{wxTabView::GetVerticalTabTextSpacing}
424
425\func{int}{GetVerticalTabTextSpacing}{\void}
426
427Returns 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
433Returns the window for the view.
434
435\membersection{wxTabView::OnCreateTabControl}
436
437\func{wxTabControl *}{OnCreateTabControl}{\void}
438
439Creates a new tab control. By default, this returns a wxTabControl object, but the application may wish
440to 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
446Recalculates the positions of the tabs, and adjusts the layer of the selected tab if necessary.
447
448You 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
454Processes mouse events sent from the panel or dialog. Returns TRUE if the event was processed,
455FALSE otherwise.
456
457\membersection{wxTabView::OnTabActivate}
458
459\func{void}{OnTabActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}
460
461Called 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
467Called just before a tab is activated, with the new active tab id, and the former active tab id.
468
469If the function returns FALSE, the tab is not activated.
470
471\membersection{wxTabView::SetBackgroundColour}
472
473\func{void}{SetBackgroundColour}{\param{const wxColour\&}{ col}}
474
475Sets the colour to be used for each tab background. By default, this is
476light grey. To ensure a match with the dialog or panel background, omit
477the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
478
479\membersection{wxTabView::SetHighlightColour}
480
481\func{void}{SetHighlightColour}{\param{const wxColour\&}{ col}}
482
483Sets 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
489Sets 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
495Sets 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
501Sets 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
507Sets the tab label font.
508
509\membersection{wxTabView::SetTabStyle}
510
511\func{void}{SetTabStyle}{\param{long}{ tabStyle}}
512
513Sets 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
519Sets the tab default width and height.
520
521\membersection{wxTabView::SetTabSelectionHeight}
522
523\func{void}{SetTabSelectionHeight}{\param{int}{ height}}
524
525Sets the height to be used for the currently selected tab; normally a few pixels
526higher than the other tabs.
527
528\membersection{wxTabView::SetTabSelection}
529
530\func{void}{SetTabSelection}{\param{int}{ sel}, \param{bool}{ activateTool=TRUE}}
531
532Sets the selected tab, calling the application's OnTabActivate function.
533
534If {\it activateTool} is FALSE, OnTabActivate will not be called.
535
536\membersection{wxTabView::SetTextColour}
537
538\func{void}{SetTextColour}{\param{const wxColour\&}{ col}}
539
540Sets the colour to be used to draw label text. By default, this is
541black.
542
543\membersection{wxTabView::SetTopMargin}
544
545\func{void}{SetTopMargin}{\param{int}{ margin}}
546
547Sets the height between the top of the view area and the bottom of the first
548row of tabs.
549
550\membersection{wxTabView::SetVerticalTabTextSpacing}
551
552\func{void}{SetVerticalTabTextSpacing}{\param{int}{ spacing}}
553
554Sets 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
560Sets the rectangle specifying the view area (above which tabs are
561placed). This must be set by the application.
562
563\membersection{wxTabView::SetWindow}
564
565\func{void}{SetWindow}{\param{wxWindow *}{window}}
566
567Set the window that the tab view will use for drawing onto.
568