1 \section{\class{wxTabView
}}\label{wxtabview
}
3 Responsible for drawing tabs onto a window, and dealing with input.
5 Please note that the preferred class for programming tabbed windows is
\helpref{wxNotebook
}{wxnotebook
}.
6 This class is retained for backward compatibility.
8 \wxheading{Derived from
}
10 \helpref{wxObject
}{wxobject
}
12 \wxheading{Include files
}
18 \helpref{wxTabView overview
}{wxtabviewoverview
},
\helpref{wxPanelTabView
}{wxpaneltabview
}
20 \latexignore{\rtfignore{\wxheading{Members
}}}
22 \membersection{wxTabView::wxTabView
}
24 \func{}{wxTabView
}{\param{long
}{style = wxTAB
\_STYLE\_DRAW\_BOX \pipe wxTAB
\_STYLE\_COLOUR\_INTERIOR}}
28 {\it style
} may be a bit list of the following:
30 \begin{twocollist
}\itemsep=
0pt
31 \twocolitem{wxTAB
\_STYLE\_DRAW\_BOX}{Draw a box around the view area. Most commonly used for dialogs.
}
32 \twocolitem{wxTAB
\_STYLE\_COLOUR\_INTERIOR}{Draw tab backgrounds in the specified colour. Omitting this style
33 will ensure that the tab background matches the dialog background.
}
36 \membersection{wxTabView::AddTab
}\label{wxtabviewaddtab
}
38 \func{wxTabControl *
}{AddTab
}{\param{int
}{ id
},
\param{const wxString\&
}{label
},
\param{wxTabControl *
}{existingTab=NULL
}}
40 Adds a tab to the view.
42 {\it id
} is the application-chosen identifier for the tab, which will be used in subsequent tab operations.
44 {\it label
} is the label to give the tab.
46 {\it existingTab
} maybe NULL to specify a new tab, or non-NULL to indicate that an existing tab should be used.
48 A new layer (row) is started when the current layer has been filled up with tabs.
50 \membersection{wxTabView::CalculateTabWidth
}\label{wxtabviewcalculatetabwidth
}
52 \func{int
}{CalculateTabWidth
}{\param{int
}{ noTabs
},
\param{bool
}{ adjustView = false
}}
54 The application can specify the tab width using this function, in terms
55 of the number of tabs per layer (row) which will fit the view area, which
56 should have been set previously with SetViewRect.
58 {\it noTabs
} is the number of tabs which should take up the full width
61 {\it adjustView
} can be set to true in order to readjust the view width
62 to exactly fit the given number of tabs.
64 The new tab width is returned.
66 \membersection{wxTabView::ClearTabs
}
68 \func{void
}{ClearTabs
}{\param{bool
}{deleteTabs=true
}}
70 Clears the tabs, deleting them if
{\it deleteTabs
} is true.
72 \membersection{wxTabView::Draw
}
74 \func{void
}{Draw
}{\param{wxDC\&
}{dc
}}
76 Draws the tabs and (optionally) a box around the view area.
78 \membersection{wxTabView::FindTabControlForId
}
80 \func{wxTabControl *
}{FindTabControlForId
}{\param{int
}{ id
}}
82 Finds the wxTabControl corresponding to
{\it id
}.
84 \membersection{wxTabView::FindTabControlForPosition
}
86 \func{wxTabControl *
}{FindTabControlForPosition
}{\param{int
}{ layer
},
\param{int
}{ position
}}
88 Finds the wxTabControl at layer
{\it layer
}, position in layer
{\it position
}, both starting from
89 zero. Note that tabs change layer as they are selected or deselected.
91 \membersection{wxTabView::GetBackgroundBrush
}
93 \func{wxBrush *
}{GetBackgroundBrush
}{\void}
95 Returns the brush used to draw in the background colour. It is set when
96 SetBackgroundColour is called.
98 \membersection{wxTabView::GetBackgroundColour
}
100 \func{wxColour
}{GetBackgroundColour
}{\void}
102 Returns the colour used for each tab background. By default, this is
103 light grey. To ensure a match with the dialog or panel background, omit
104 the wxTAB
\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
106 \membersection{wxTabView::GetBackgroundPen
}
108 \func{wxPen *
}{GetBackgroundPen
}{\void}
110 Returns the pen used to draw in the background colour. It is set when
111 SetBackgroundColour is called.
113 \membersection{wxTabView::GetHighlightColour
}
115 \func{wxColour
}{GetHighlightColour
}{\void}
117 Returns the colour used for bright highlights on the left side of `
3D' surfaces. By default, this is white.
119 \membersection{wxTabView::GetHighlightPen
}
121 \func{wxPen *
}{GetHighlightPen
}{\void}
123 Returns the pen used to draw
3D effect highlights. This is set when
124 SetHighlightColour is called.
126 \membersection{wxTabView::GetHorizontalTabOffset
}
128 \func{int
}{GetHorizontalTabOffset
}{\void}
130 Returns the horizontal spacing by which each tab layer is offset from the one below.
132 \membersection{wxTabView::GetNumberOfLayers
}
134 \func{int
}{GetNumberOfLayers
}{\void}
136 Returns the number of layers (rows of tabs).
138 \membersection{wxTabView::GetSelectedTabFont
}
140 \func{wxFont *
}{GetSelectedTabFont
}{\void}
142 Returns the font to be used for the selected tab label.
144 \membersection{wxTabView::GetShadowColour
}
146 \func{wxColour
}{GetShadowColour
}{\void}
148 Returns the colour used for shadows on the right-hand side of `
3D' surfaces. By default, this is dark grey.
150 \membersection{wxTabView::GetTabHeight
}
152 \func{int
}{GetTabHeight
}{\void}
154 Returns the tab default height.
156 \membersection{wxTabView::GetTabFont
}
158 \func{wxFont *
}{GetTabFont
}{\void}
160 Returns the tab label font.
162 \membersection{wxTabView::GetTabSelectionHeight
}
164 \func{int
}{GetTabSelectionHeight
}{\void}
166 Returns the height to be used for the currently selected tab; normally a few pixels
167 higher than the other tabs.
169 \membersection{wxTabView::GetTabStyle
}
171 \func{long
}{GetTabStyle
}{\void}
173 Returns the tab style. See constructor documentation for details of valid styles.
175 \membersection{wxTabView::GetTabWidth
}
177 \func{int
}{GetTabWidth
}{\void}
179 Returns the tab default width.
181 \membersection{wxTabView::GetTextColour
}
183 \func{wxColour
}{GetTextColour
}{\void}
185 Returns the colour used to draw label text. By default, this is
188 \membersection{wxTabView::GetTopMargin
}
190 \func{int
}{GetTopMargin
}{\void}
192 Returns the height between the top of the view area and the bottom of the first
195 \membersection{wxTabView::GetShadowPen
}
197 \func{wxPen *
}{GetShadowPen
}{\void}
199 Returns the pen used to draw
3D effect shadows. This is set when
200 SetShadowColour is called.
202 \membersection{wxTabView::GetViewRect
}
204 \func{wxRectangle
}{GetViewRect
}{\void}
206 Returns the rectangle specifying the view area (above which tabs are
209 \membersection{wxTabView::GetVerticalTabTextSpacing
}
211 \func{int
}{GetVerticalTabTextSpacing
}{\void}
213 Returns the vertical spacing between the top of an unselected tab, and the tab label.
215 \membersection{wxTabView::GetWindow
}
217 \func{wwxWindow *
}{GetWindow
}{\void}
219 Returns the window for the view.
221 \membersection{wxTabView::OnCreateTabControl
}
223 \func{wxTabControl *
}{OnCreateTabControl
}{\void}
225 Creates a new tab control. By default, this returns a wxTabControl object, but the application may wish
226 to define a derived class, in which case the tab view should be subclassed and this function overridden.
228 \membersection{wxTabView::LayoutTabs
}
230 \func{void
}{LayoutTabs
}{\void}
232 Recalculates the positions of the tabs, and adjusts the layer of the selected tab if necessary.
234 You may want to call this function if the view width has changed (for example, from an OnSize handler).
236 \membersection{wxTabView::OnEvent
}
238 \func{bool
}{OnEvent
}{\param{wxMouseEvent\&
}{event
}}
240 Processes mouse events sent from the panel or dialog. Returns true if the event was processed,
243 \membersection{wxTabView::OnTabActivate
}
245 \func{void
}{OnTabActivate
}{\param{int
}{ activateId
},
\param{int
}{ deactivateId
}}
247 Called when a tab is activated, with the new active tab id, and the former active tab id.
249 \membersection{wxTabView::OnTabPreActivate
}
251 \func{bool
}{OnTabPreActivate
}{\param{int
}{ activateId
},
\param{int
}{ deactivateId
}}
253 Called just before a tab is activated, with the new active tab id, and the former active tab id.
255 If the function returns false, the tab is not activated.
257 \membersection{wxTabView::SetBackgroundColour
}
259 \func{void
}{SetBackgroundColour
}{\param{const wxColour\&
}{ col
}}
261 Sets the colour to be used for each tab background. By default, this is
262 light grey. To ensure a match with the dialog or panel background, omit
263 the wxTAB
\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
265 \membersection{wxTabView::SetHighlightColour
}
267 \func{void
}{SetHighlightColour
}{\param{const wxColour\&
}{ col
}}
269 Sets the colour to be used for bright highlights on the left side of `
3D' surfaces. By default, this is white.
271 \membersection{wxTabView::SetHorizontalTabOffset
}
273 \func{void
}{SetHorizontalTabOffset
}{\param{int
}{ offset
}}
275 Sets the horizontal spacing by which each tab layer is offset from the one below.
277 \membersection{wxTabView::SetSelectedTabFont
}
279 \func{void
}{SetSelectedTabFont
}{\param{wxFont *
}{font
}}
281 Sets the font to be used for the selected tab label.
283 \membersection{wxTabView::SetShadowColour
}
285 \func{void
}{SetShadowColour
}{\param{const wxColour\&
}{ col
}}
287 Sets the colour to be used for shadows on the right-hand side of `
3D' surfaces. By default, this is dark grey.
289 \membersection{wxTabView::SetTabFont
}
291 \func{void
}{SetTabFont
}{\param{wxFont *
}{font
}}
293 Sets the tab label font.
295 \membersection{wxTabView::SetTabStyle
}
297 \func{void
}{SetTabStyle
}{\param{long
}{ tabStyle
}}
299 Sets the tab style. See constructor documentation for details of valid styles.
301 \membersection{wxTabView::SetTabSize
}
303 \func{void
}{SetTabSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
305 Sets the tab default width and height.
307 \membersection{wxTabView::SetTabSelectionHeight
}
309 \func{void
}{SetTabSelectionHeight
}{\param{int
}{ height
}}
311 Sets the height to be used for the currently selected tab; normally a few pixels
312 higher than the other tabs.
314 \membersection{wxTabView::SetTabSelection
}
316 \func{void
}{SetTabSelection
}{\param{int
}{ sel
},
\param{bool
}{ activateTool=true
}}
318 Sets the selected tab, calling the application's OnTabActivate function.
320 If
{\it activateTool
} is false, OnTabActivate will not be called.
322 \membersection{wxTabView::SetTextColour
}
324 \func{void
}{SetTextColour
}{\param{const wxColour\&
}{ col
}}
326 Sets the colour to be used to draw label text. By default, this is
329 \membersection{wxTabView::SetTopMargin
}
331 \func{void
}{SetTopMargin
}{\param{int
}{ margin
}}
333 Sets the height between the top of the view area and the bottom of the first
336 \membersection{wxTabView::SetVerticalTabTextSpacing
}
338 \func{void
}{SetVerticalTabTextSpacing
}{\param{int
}{ spacing
}}
340 Sets the vertical spacing between the top of an unselected tab, and the tab label.
342 \membersection{wxTabView::SetViewRect
}\label{wxtabviewsetviewrect
}
344 \func{void
}{SetViewRect
}{\param{const wxRectangle\&
}{rect
}}
346 Sets the rectangle specifying the view area (above which tabs are
347 placed). This must be set by the application.
349 \membersection{wxTabView::SetWindow
}
351 \func{void
}{SetWindow
}{\param{wxWindow *
}{window
}}
353 Set the window that the tab view will use for drawing onto.