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