wxWidgets/docs/latex/wx/tab.tex

597 lines
16 KiB
TeX
Raw Normal View History

\section{\class{wxTabbedDialog}}\label{wxtabbeddialog}
A dialog suitable for handling tabs.
Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
This class is retained for backward compatibility.
\wxheading{Derived from}
\helpref{wxDialog}{wxdialog}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/tab.h>
\wxheading{See also}
\helpref{Tab classes overview}{wxtaboverview}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxTabbedDialog::wxTabbedDialog}
\func{}{wxTabbedDialog}{\param{wxWindow *}{parent}, \param{wxWindowID }{id},
\param{const wxString\& }{title}, \param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
\param{long}{ style=wxDEFAULT\_DIALOG\_STYLE}, \param{const wxString\& }{name="dialogBox"}}
Constructor.
\membersection{wxTabbedDialog::\destruct{wxTabbedDialog}}
\func{}{\destruct{wxTabbedDialog}}{\void}
Destructor. This destructor deletes the tab view associated with the dialog box.
If you do not wish this to happen, set the tab view to NULL before destruction (for example,
in the OnCloseWindow event handler).
\membersection{wxTabbedDialog::SetTabView}
\func{void}{SetTabView}{\param{wxTabView *}{view}}
Sets the tab view associated with the dialog box.
\membersection{wxTabbedDialog::GetTabView}
\func{wxTabView *}{GetTabView}{\void}
Returns the tab view associated with the dialog box.
\section{\class{wxTabbedPanel}}\label{wxtabbedpanel}
A panel suitable for handling tabs.
Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
This class is retained for backward compatibility.
\wxheading{Derived from}
\helpref{wxPanel}{wxpanel}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/tab.h>
\wxheading{See also}
\helpref{Tab classes overview}{wxtaboverview}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxTabbedPanel::wxTabbedPanel}
\func{}{wxTabbedPanel}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},
\param{const wxPoint\&}{ pos}, \param{const wxSize\&}{ size},
\param{long}{ style=0}, \param{const wxString\& }{name="panel"}}
Constructor.
\membersection{wxTabbedPanel::SetTabView}
\func{void}{SetTabView}{\param{wxTabView *}{view}}
Sets the tab view associated with the panel.
\membersection{wxTabbedPanel::GetTabView}
\func{wxTabView *}{GetTabView}{\void}
Returns the tab view associated with the panel.
\section{\class{wxTabControl}}\label{wxtabcontrol}
You will rarely need to use this class directly.
Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
This class is retained for backward compatibility.
\wxheading{Derived from}
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/tab.h>
\wxheading{See also}
\overview{Tab classes overview}{wxtaboverview}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxTabControl::wxTabControl}
\func{void}{wxTabControl}{\param{wxTabView *}{view = NULL}}
Constructor.
\membersection{wxTabControl::GetColPosition}
\func{int}{GetColPosition}{\void}
Returns the position of the tab in the tab column.
\membersection{wxTabControl::GetFont}
\func{wxFont *}{GetFont}{\void}
Returns the font to be used for this tab.
\membersection{wxTabControl::GetHeight}
\func{int}{GetHeight}{\void}
Returns the tab height.
\membersection{wxTabControl::GetId}
\func{int}{GetId}{\void}
Returns the tab identifier.
\membersection{wxTabControl::GetLabel}
\func{wxString}{GetLabel}{\void}
Returns the tab label.
\membersection{wxTabControl::GetRowPosition}
\func{int}{GetRowPosition}{\void}
Returns the position of the tab in the layer or row.
\membersection{wxTabControl::GetSelected}
\func{bool}{GetSelected}{\void}
Returns the selected flag.
\membersection{wxTabControl::GetWidth}
\func{int}{GetWidth}{\void}
Returns the tab width.
\membersection{wxTabControl::GetX}
\func{int}{GetX}{\void}
Returns the x offset from the top-left of the view area.
\membersection{wxTabControl::GetY}
\func{int}{GetY}{\void}
Returns the y offset from the top-left of the view area.
\membersection{wxTabControl::HitTest}
\func{bool}{HitTest}{\param{int}{ x}, \param{int}{ y}}
Returns TRUE if the point x, y is within the tab area.
\membersection{wxTabControl::OnDraw}
\func{void}{OnDraw}{\param{wxDC\& }{dc}, \param{bool}{ lastInRow}}
Draws the tab control on the given device context.
\membersection{wxTabControl::SetColPosition}
\func{void}{SetColPosition}{\param{int}{ pos}}
Sets the position in the column.
\membersection{wxTabControl::SetFont}
\func{void}{SetFont}{\param{wxFont *}{font}}
Sets the font to be used for this tab.
\membersection{wxTabControl::SetId}
\func{void}{SetId}{\param{int}{ id}}
Sets the tab identifier.
\membersection{wxTabControl::SetLabel}
\func{void}{SetLabel}{\param{const wxString\& }{str}}
Sets the label for the tab.
\membersection{wxTabControl::SetPosition}
\func{void}{SetPosition}{\param{int}{ x}, \param{int}{ y}}
Sets the x and y offsets for this tab, measured from the top-left of the view area.
\membersection{wxTabControl::SetRowPosition}
\func{void}{SetRowPosition}{\param{int}{ pos}}
Sets the position on the layer (row).
\membersection{wxTabControl::SetSelected}
\func{void}{SetSelected}{\param{bool }{selected}}
Sets the selection flag for this tab (does not set the current tab for the view;
use wxTabView::SetSelectedTab for that).
\membersection{wxTabControl::SetSize}
\func{void}{SetSize}{\param{int}{ width}, \param{int}{ height}}
Sets the width and height for this tab.
\section{\class{wxTabView}}\label{wxtabview}
Responsible for drawing tabs onto a window, and dealing with input.
Please note that the preferred class for programming tabbed windows is \helpref{wxNotebook}{wxnotebook}.
This class is retained for backward compatibility.
\wxheading{Derived from}
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/tab.h>
\wxheading{See also}
\helpref{wxTabView overview}{wxtabviewoverview}, \helpref{wxPanelTabView}{wxpaneltabview}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxTabView::wxTabView}
\func{}{wxTabView}{\param{long }{style = wxTAB\_STYLE\_DRAW\_BOX \pipe wxTAB\_STYLE\_COLOUR\_INTERIOR}}
Constructor.
{\it style} may be a bit list of the following:
\begin{twocollist}\itemsep=0pt
\twocolitem{wxTAB\_STYLE\_DRAW\_BOX}{Draw a box around the view area. Most commonly used for dialogs.}
\twocolitem{wxTAB\_STYLE\_COLOUR\_INTERIOR}{Draw tab backgrounds in the specified colour. Omitting this style
will ensure that the tab background matches the dialog background.}
\end{twocollist}
\membersection{wxTabView::AddTab}\label{wxtabviewaddtab}
\func{wxTabControl *}{AddTab}{\param{int}{ id}, \param{const wxString\& }{label}, \param{wxTabControl *}{existingTab=NULL}}
Adds a tab to the view.
{\it id} is the application-chosen identifier for the tab, which will be used in subsequent tab operations.
{\it label} is the label to give the tab.
{\it existingTab} maybe NULL to specify a new tab, or non-NULL to indicate that an existing tab should be used.
A new layer (row) is started when the current layer has been filled up with tabs.
\membersection{wxTabView::CalculateTabWidth}\label{wxtabviewcalculatetabwidth}
\func{int}{CalculateTabWidth}{\param{int}{ noTabs}, \param{bool}{ adjustView = FALSE}}
The application can specify the tab width using this function, in terms
of the number of tabs per layer (row) which will fit the view area, which
should have been set previously with SetViewRect.
{\it noTabs} is the number of tabs which should take up the full width
of the view area.
{\it adjustView} can be set to TRUE in order to readjust the view width
to exactly fit the given number of tabs.
The new tab width is returned.
\membersection{wxTabView::ClearTabs}
\func{void}{ClearTabs}{\param{bool }{deleteTabs=TRUE}}
Clears the tabs, deleting them if {\it deleteTabs} is TRUE.
\membersection{wxTabView::Draw}
\func{void}{Draw}{\param{wxDC\& }{dc}}
Draws the tabs and (optionally) a box around the view area.
\membersection{wxTabView::FindTabControlForId}
\func{wxTabControl *}{FindTabControlForId}{\param{int}{ id}}
Finds the wxTabControl corresponding to {\it id}.
\membersection{wxTabView::FindTabControlForPosition}
\func{wxTabControl *}{FindTabControlForPosition}{\param{int}{ layer}, \param{int}{ position}}
Finds the wxTabControl at layer {\it layer}, position in layer {\it position}, both starting from
zero. Note that tabs change layer as they are selected or deselected.
\membersection{wxTabView::GetBackgroundBrush}
\func{wxBrush *}{GetBackgroundBrush}{\void}
Returns the brush used to draw in the background colour. It is set when
SetBackgroundColour is called.
\membersection{wxTabView::GetBackgroundColour}
\func{wxColour}{GetBackgroundColour}{\void}
Returns the colour used for each tab background. By default, this is
light grey. To ensure a match with the dialog or panel background, omit
the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
\membersection{wxTabView::GetBackgroundPen}
\func{wxPen *}{GetBackgroundPen}{\void}
Returns the pen used to draw in the background colour. It is set when
SetBackgroundColour is called.
\membersection{wxTabView::GetHighlightColour}
\func{wxColour}{GetHighlightColour}{\void}
Returns the colour used for bright highlights on the left side of `3D' surfaces. By default, this is white.
\membersection{wxTabView::GetHighlightPen}
\func{wxPen *}{GetHighlightPen}{\void}
Returns the pen used to draw 3D effect highlights. This is set when
SetHighlightColour is called.
\membersection{wxTabView::GetHorizontalTabOffset}
\func{int}{GetHorizontalTabOffset}{\void}
Returns the horizontal spacing by which each tab layer is offset from the one below.
\membersection{wxTabView::GetNumberOfLayers}
\func{int}{GetNumberOfLayers}{\void}
Returns the number of layers (rows of tabs).
\membersection{wxTabView::GetSelectedTabFont}
\func{wxFont *}{GetSelectedTabFont}{\void}
Returns the font to be used for the selected tab label.
\membersection{wxTabView::GetShadowColour}
\func{wxColour}{GetShadowColour}{\void}
Returns the colour used for shadows on the right-hand side of `3D' surfaces. By default, this is dark grey.
\membersection{wxTabView::GetTabHeight}
\func{int}{GetTabHeight}{\void}
Returns the tab default height.
\membersection{wxTabView::GetTabFont}
\func{wxFont *}{GetTabFont}{\void}
Returns the tab label font.
\membersection{wxTabView::GetTabSelectionHeight}
\func{int}{GetTabSelectionHeight}{\void}
Returns the height to be used for the currently selected tab; normally a few pixels
higher than the other tabs.
\membersection{wxTabView::GetTabStyle}
\func{long}{GetTabStyle}{\void}
Returns the tab style. See constructor documentation for details of valid styles.
\membersection{wxTabView::GetTabWidth}
\func{int}{GetTabWidth}{\void}
Returns the tab default width.
\membersection{wxTabView::GetTextColour}
\func{wxColour}{GetTextColour}{\void}
Returns the colour used to draw label text. By default, this is
black.
\membersection{wxTabView::GetTopMargin}
\func{int}{GetTopMargin}{\void}
Returns the height between the top of the view area and the bottom of the first
row of tabs.
\membersection{wxTabView::GetShadowPen}
\func{wxPen *}{GetShadowPen}{\void}
Returns the pen used to draw 3D effect shadows. This is set when
SetShadowColour is called.
\membersection{wxTabView::GetViewRect}
\func{wxRectangle}{GetViewRect}{\void}
Returns the rectangle specifying the view area (above which tabs are
placed).
\membersection{wxTabView::GetVerticalTabTextSpacing}
\func{int}{GetVerticalTabTextSpacing}{\void}
Returns the vertical spacing between the top of an unselected tab, and the tab label.
\membersection{wxTabView::GetWindow}
\func{wwxWindow *}{GetWindow}{\void}
Returns the window for the view.
\membersection{wxTabView::OnCreateTabControl}
\func{wxTabControl *}{OnCreateTabControl}{\void}
Creates a new tab control. By default, this returns a wxTabControl object, but the application may wish
to define a derived class, in which case the tab view should be subclassed and this function overridden.
\membersection{wxTabView::LayoutTabs}
\func{void}{LayoutTabs}{\void}
Recalculates the positions of the tabs, and adjusts the layer of the selected tab if necessary.
You may want to call this function if the view width has changed (for example, from an OnSize handler).
\membersection{wxTabView::OnEvent}
\func{bool}{OnEvent}{\param{wxMouseEvent\& }{event}}
Processes mouse events sent from the panel or dialog. Returns TRUE if the event was processed,
FALSE otherwise.
\membersection{wxTabView::OnTabActivate}
\func{void}{OnTabActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}
Called when a tab is activated, with the new active tab id, and the former active tab id.
\membersection{wxTabView::OnTabPreActivate}
\func{bool}{OnTabPreActivate}{\param{int}{ activateId}, \param{int}{ deactivateId}}
Called just before a tab is activated, with the new active tab id, and the former active tab id.
If the function returns FALSE, the tab is not activated.
\membersection{wxTabView::SetBackgroundColour}
\func{void}{SetBackgroundColour}{\param{const wxColour\&}{ col}}
Sets the colour to be used for each tab background. By default, this is
light grey. To ensure a match with the dialog or panel background, omit
the wxTAB\_STYLE\_COLOUR\_INTERIOR flag from the wxTabView constructor.
\membersection{wxTabView::SetHighlightColour}
\func{void}{SetHighlightColour}{\param{const wxColour\&}{ col}}
Sets the colour to be used for bright highlights on the left side of `3D' surfaces. By default, this is white.
\membersection{wxTabView::SetHorizontalTabOffset}
\func{void}{SetHorizontalTabOffset}{\param{int}{ offset}}
Sets the horizontal spacing by which each tab layer is offset from the one below.
\membersection{wxTabView::SetSelectedTabFont}
\func{void}{SetSelectedTabFont}{\param{wxFont *}{font}}
Sets the font to be used for the selected tab label.
\membersection{wxTabView::SetShadowColour}
\func{void}{SetShadowColour}{\param{const wxColour\&}{ col}}
Sets the colour to be used for shadows on the right-hand side of `3D' surfaces. By default, this is dark grey.
\membersection{wxTabView::SetTabFont}
\func{void}{SetTabFont}{\param{wxFont *}{font}}
Sets the tab label font.
\membersection{wxTabView::SetTabStyle}
\func{void}{SetTabStyle}{\param{long}{ tabStyle}}
Sets the tab style. See constructor documentation for details of valid styles.
\membersection{wxTabView::SetTabSize}
\func{void}{SetTabSize}{\param{int}{ width}, \param{int}{ height}}
Sets the tab default width and height.
\membersection{wxTabView::SetTabSelectionHeight}
\func{void}{SetTabSelectionHeight}{\param{int}{ height}}
Sets the height to be used for the currently selected tab; normally a few pixels
higher than the other tabs.
\membersection{wxTabView::SetTabSelection}
\func{void}{SetTabSelection}{\param{int}{ sel}, \param{bool}{ activateTool=TRUE}}
Sets the selected tab, calling the application's OnTabActivate function.
If {\it activateTool} is FALSE, OnTabActivate will not be called.
\membersection{wxTabView::SetTextColour}
\func{void}{SetTextColour}{\param{const wxColour\&}{ col}}
Sets the colour to be used to draw label text. By default, this is
black.
\membersection{wxTabView::SetTopMargin}
\func{void}{SetTopMargin}{\param{int}{ margin}}
Sets the height between the top of the view area and the bottom of the first
row of tabs.
\membersection{wxTabView::SetVerticalTabTextSpacing}
\func{void}{SetVerticalTabTextSpacing}{\param{int}{ spacing}}
Sets the vertical spacing between the top of an unselected tab, and the tab label.
\membersection{wxTabView::SetViewRect}\label{wxtabviewsetviewrect}
\func{void}{SetViewRect}{\param{const wxRectangle\& }{rect}}
Sets the rectangle specifying the view area (above which tabs are
placed). This must be set by the application.
\membersection{wxTabView::SetWindow}
\func{void}{SetWindow}{\param{wxWindow *}{window}}
Set the window that the tab view will use for drawing onto.