]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/tab.tex
a couple of wors about wxObjArray::Index()
[wxWidgets.git] / docs / latex / wx / tab.tex
CommitLineData
a660d684
KB
1\section{\class{wxTabbedDialog}}\label{wxtabbeddialog}
2
3A dialog suitable for handling tabs.
4
7f24fdbf
JS
5Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
6This class is retained for backward compatibility.
7
a660d684
KB
8\wxheading{Derived from}
9
10\helpref{wxDialog}{wxdialog}\\
11\helpref{wxEvtHandler}{wxevthandler}\\
12\helpref{wxObject}{wxobject}
13
954b8ae6
JS
14\wxheading{Include files}
15
16<wx/tab.h>
17
a660d684
KB
18\wxheading{See also}
19
20\helpref{Tab classes overview}{wxtaboverview}
21
22\latexignore{\rtfignore{\wxheading{Members}}}
23
24\membersection{wxTabbedDialog::wxTabbedDialog}
25
eaaa6a06 26\func{}{wxTabbedDialog}{\param{wxWindow *}{parent}, \param{wxWindowID }{id},
a660d684 27 \param{const wxString\& }{title}, \param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
eaaa6a06 28 \param{long}{ style=wxDEFAULT\_DIALOG\_STYLE}, \param{const wxString\& }{name="dialogBox"}}
a660d684
KB
29
30Constructor.
31
32\membersection{wxTabbedDialog::\destruct{wxTabbedDialog}}
33
34\func{}{\destruct{wxTabbedDialog}}{\void}
35
36Destructor. This destructor deletes the tab view associated with the dialog box.
37If you do not wish this to happen, set the tab view to NULL before destruction (for example,
38in the OnCloseWindow event handler).
39
40\membersection{wxTabbedDialog::SetTabView}
41
42\func{void}{SetTabView}{\param{wxTabView *}{view}}
43
44Sets the tab view associated with the dialog box.
45
46\membersection{wxTabbedDialog::GetTabView}
47
48\func{wxTabView *}{GetTabView}{\void}
49
50Returns the tab view associated with the dialog box.
51
52\section{\class{wxTabbedPanel}}\label{wxtabbedpanel}
53
54A panel suitable for handling tabs.
55
7f24fdbf
JS
56Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
57This class is retained for backward compatibility.
58
a660d684
KB
59\wxheading{Derived from}
60
61\helpref{wxPanel}{wxpanel}\\
62\helpref{wxEvtHandler}{wxevthandler}\\
63\helpref{wxObject}{wxobject}
64
954b8ae6
JS
65\wxheading{Include files}
66
67<wx/tab.h>
68
a660d684
KB
69\wxheading{See also}
70
71\helpref{Tab classes overview}{wxtaboverview}
72
73\latexignore{\rtfignore{\wxheading{Members}}}
74
75\membersection{wxTabbedPanel::wxTabbedPanel}
76
eaaa6a06 77\func{}{wxTabbedPanel}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},
a660d684 78 \param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
eaaa6a06 79 \param{long}{ style=0}, \param{const wxString\& }{name="panel"}}
a660d684
KB
80
81Constructor.
82
83\membersection{wxTabbedPanel::SetTabView}
84
85\func{void}{SetTabView}{\param{wxTabView *}{view}}
86
87Sets the tab view associated with the panel.
88
89\membersection{wxTabbedPanel::GetTabView}
90
91\func{wxTabView *}{GetTabView}{\void}
92
93Returns the tab view associated with the panel.
94
95\section{\class{wxTabControl}}\label{wxtabcontrol}
96
97You will rarely need to use this class directly.
98
7f24fdbf
JS
99Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
100This class is retained for backward compatibility.
101
a660d684
KB
102\wxheading{Derived from}
103
104\helpref{wxObject}{wxobject}
105
954b8ae6
JS
106\wxheading{Include files}
107
108<wx/tab.h>
109
a660d684
KB
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
120Constructor.
121
122\membersection{wxTabControl::GetColPosition}
123
124\func{int}{GetColPosition}{\void}
125
126Returns the position of the tab in the tab column.
127
128\membersection{wxTabControl::GetFont}
129
130\func{wxFont *}{GetFont}{\void}
131
132Returns the font to be used for this tab.
133
134\membersection{wxTabControl::GetHeight}
135
136\func{int}{GetHeight}{\void}
137
138Returns the tab height.
139
140\membersection{wxTabControl::GetId}
141
142\func{int}{GetId}{\void}
143
144Returns the tab identifier.
145
146\membersection{wxTabControl::GetLabel}
147
148\func{wxString}{GetLabel}{\void}
149
150Returns the tab label.
151
152\membersection{wxTabControl::GetRowPosition}
153
154\func{int}{GetRowPosition}{\void}
155
156Returns the position of the tab in the layer or row.
157
158\membersection{wxTabControl::GetSelected}
159
160\func{bool}{GetSelected}{\void}
161
162Returns the selected flag.
163
164\membersection{wxTabControl::GetWidth}
165
166\func{int}{GetWidth}{\void}
167
168Returns the tab width.
169
170\membersection{wxTabControl::GetX}
171
172\func{int}{GetX}{\void}
173
174Returns the x offset from the top-left of the view area.
175
176\membersection{wxTabControl::GetY}
177
178\func{int}{GetY}{\void}
179
180Returns 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
186Returns 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
192Draws the tab control on the given device context.
193
194\membersection{wxTabControl::SetColPosition}
195
196\func{void}{SetColPosition}{\param{int}{ pos}}
197
198Sets the position in the column.
199
200\membersection{wxTabControl::SetFont}
201
202\func{void}{SetFont}{\param{wxFont *}{font}}
203
204Sets the font to be used for this tab.
205
206\membersection{wxTabControl::SetId}
207
208\func{void}{SetId}{\param{int}{ id}}
209
210Sets the tab identifier.
211
212\membersection{wxTabControl::SetLabel}
213
214\func{void}{SetLabel}{\param{const wxString\& }{str}}
215
216Sets the label for the tab.
217
218\membersection{wxTabControl::SetPosition}
219
220\func{void}{SetPosition}{\param{int}{ x}, \param{int}{ y}}
221
222Sets 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
228Sets the position on the layer (row).
229
230\membersection{wxTabControl::SetSelected}
231
232\func{void}{SetSelected}{\param{bool }{selected}}
233
234Sets the selection flag for this tab (does not set the current tab for the view;
235use wxTabView::SetSelectedTab for that).
236
237\membersection{wxTabControl::SetSize}
238
239\func{void}{SetSize}{\param{int}{ width}, \param{int}{ height}}
240
241Sets the width and height for this tab.
242
243\section{\class{wxTabView}}\label{wxtabview}
244
245Responsible for drawing tabs onto a window, and dealing with input.
246
7f24fdbf
JS
247Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
248This class is retained for backward compatibility.
249
a660d684
KB
250\wxheading{Derived from}
251
252\helpref{wxObject}{wxobject}
253
954b8ae6
JS
254\wxheading{Include files}
255
256<wx/tab.h>
257
a660d684
KB
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
268Constructor.
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
275will 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
282Adds 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
290A 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
296The application can specify the tab width using this function, in terms
297of the number of tabs per layer (row) which will fit the view area, which
298should have been set previously with SetViewRect.
299
300{\it noTabs} is the number of tabs which should take up the full width
301of the view area.
302
303{\it adjustView} can be set to TRUE in order to readjust the view width
304to exactly fit the given number of tabs.
305
306The new tab width is returned.
307
308\membersection{wxTabView::ClearTabs}
309
310\func{void}{ClearTabs}{\param{bool }{deleteTabs=TRUE}}
311
312Clears the tabs, deleting them if {\it deleteTabs} is TRUE.
313
314\membersection{wxTabView::Draw}
315
316\func{void}{Draw}{\param{wxDC\& }{dc}}
317
318Draws the tabs and (optionally) a box around the view area.
319
320\membersection{wxTabView::FindTabControlForId}
321
322\func{wxTabControl *}{FindTabControlForId}{\param{int}{ id}}
323
324Finds the wxTabControl corresponding to {\it id}.
325
326\membersection{wxTabView::FindTabControlForPosition}
327
328\func{wxTabControl *}{FindTabControlForPosition}{\param{int}{ layer}, \param{int}{ position}}
329
330Finds the wxTabControl at layer {\it layer}, position in layer {\it position}, both starting from
331zero. Note that tabs change layer as they are selected or deselected.
332
333\membersection{wxTabView::GetBackgroundBrush}
334
335\func{wxBrush *}{GetBackgroundBrush}{\void}
336
337Returns the brush used to draw in the background colour. It is set when
338SetBackgroundColour is called.
339
340\membersection{wxTabView::GetBackgroundColour}
341
342\func{wxColour}{GetBackgroundColour}{\void}
343
344Returns the colour used for each tab background. By default, this is
345light grey. To ensure a match with the dialog or panel background, omit
346the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
347
348\membersection{wxTabView::GetBackgroundPen}
349
350\func{wxPen *}{GetBackgroundPen}{\void}
351
352Returns the pen used to draw in the background colour. It is set when
353SetBackgroundColour is called.
354
355\membersection{wxTabView::GetHighlightColour}
356
357\func{wxColour}{GetHighlightColour}{\void}
358
359Returns 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
365Returns the pen used to draw 3D effect highlights. This is set when
366SetHighlightColour is called.
367
368\membersection{wxTabView::GetHorizontalTabOffset}
369
370\func{int}{GetHorizontalTabOffset}{\void}
371
372Returns 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
378Returns the number of layers (rows of tabs).
379
380\membersection{wxTabView::GetSelectedTabFont}
381
382\func{wxFont *}{GetSelectedTabFont}{\void}
383
384Returns the font to be used for the selected tab label.
385
386\membersection{wxTabView::GetShadowColour}
387
388\func{wxColour}{GetShadowColour}{\void}
389
390Returns 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
396Returns the tab default height.
397
398\membersection{wxTabView::GetTabFont}
399
400\func{wxFont *}{GetTabFont}{\void}
401
402Returns the tab label font.
403
404\membersection{wxTabView::GetTabSelectionHeight}
405
406\func{int}{GetTabSelectionHeight}{\void}
407
408Returns the height to be used for the currently selected tab; normally a few pixels
409higher than the other tabs.
410
411\membersection{wxTabView::GetTabStyle}
412
413\func{long}{GetTabStyle}{\void}
414
415Returns the tab style. See constructor documentation for details of valid styles.
416
417\membersection{wxTabView::GetTabWidth}
418
419\func{int}{GetTabWidth}{\void}
420
421Returns the tab default width.
422
423\membersection{wxTabView::GetTextColour}
424
425\func{wxColour}{GetTextColour}{\void}
426
427Returns the colour used to draw label text. By default, this is
428black.
429
430\membersection{wxTabView::GetTopMargin}
431
432\func{int}{GetTopMargin}{\void}
433
434Returns the height between the top of the view area and the bottom of the first
435row of tabs.
436
437\membersection{wxTabView::GetShadowPen}
438
439\func{wxPen *}{GetShadowPen}{\void}
440
441Returns the pen used to draw 3D effect shadows. This is set when
442SetShadowColour is called.
443
444\membersection{wxTabView::GetViewRect}
445
446\func{wxRectangle}{GetViewRect}{\void}
447
448Returns the rectangle specifying the view area (above which tabs are
449placed).
450
451\membersection{wxTabView::GetVerticalTabTextSpacing}
452
453\func{int}{GetVerticalTabTextSpacing}{\void}
454
455Returns 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
461Returns the window for the view.
462
463\membersection{wxTabView::OnCreateTabControl}
464
465\func{wxTabControl *}{OnCreateTabControl}{\void}
466
467Creates a new tab control. By default, this returns a wxTabControl object, but the application may wish
468to define a derived class, in which case the tab view should be subclassed and this function overridden.
469
60a67569 470\membersection{wxTabView::LayoutTabs}
a660d684 471
60a67569 472\func{void}{LayoutTabs}{\void}
a660d684
KB
473
474Recalculates the positions of the tabs, and adjusts the layer of the selected tab if necessary.
475
476You 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
482Processes mouse events sent from the panel or dialog. Returns TRUE if the event was processed,
483FALSE otherwise.
484
485\membersection{wxTabView::OnTabActivate}
486
487\func{void}{OnTabActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}
488
489Called 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
495Called just before a tab is activated, with the new active tab id, and the former active tab id.
496
497If the function returns FALSE, the tab is not activated.
498
499\membersection{wxTabView::SetBackgroundColour}
500
501\func{void}{SetBackgroundColour}{\param{const wxColour\&}{ col}}
502
503Sets the colour to be used for each tab background. By default, this is
504light grey. To ensure a match with the dialog or panel background, omit
505the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
506
507\membersection{wxTabView::SetHighlightColour}
508
509\func{void}{SetHighlightColour}{\param{const wxColour\&}{ col}}
510
511Sets 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
517Sets 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
523Sets 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
529Sets 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
535Sets the tab label font.
536
537\membersection{wxTabView::SetTabStyle}
538
539\func{void}{SetTabStyle}{\param{long}{ tabStyle}}
540
541Sets 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
547Sets the tab default width and height.
548
549\membersection{wxTabView::SetTabSelectionHeight}
550
551\func{void}{SetTabSelectionHeight}{\param{int}{ height}}
552
553Sets the height to be used for the currently selected tab; normally a few pixels
554higher than the other tabs.
555
556\membersection{wxTabView::SetTabSelection}
557
558\func{void}{SetTabSelection}{\param{int}{ sel}, \param{bool}{ activateTool=TRUE}}
559
560Sets the selected tab, calling the application's OnTabActivate function.
561
562If {\it activateTool} is FALSE, OnTabActivate will not be called.
563
564\membersection{wxTabView::SetTextColour}
565
566\func{void}{SetTextColour}{\param{const wxColour\&}{ col}}
567
568Sets the colour to be used to draw label text. By default, this is
569black.
570
571\membersection{wxTabView::SetTopMargin}
572
573\func{void}{SetTopMargin}{\param{int}{ margin}}
574
575Sets the height between the top of the view area and the bottom of the first
576row of tabs.
577
578\membersection{wxTabView::SetVerticalTabTextSpacing}
579
580\func{void}{SetVerticalTabTextSpacing}{\param{int}{ spacing}}
581
582Sets 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
588Sets the rectangle specifying the view area (above which tabs are
589placed). This must be set by the application.
590
591\membersection{wxTabView::SetWindow}
592
593\func{void}{SetWindow}{\param{wxWindow *}{window}}
594
595Set the window that the tab view will use for drawing onto.
596