X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0d9896aefdd86ee792747dafc5a39aeadcbc867..d67c33888f65e236adedd65ffbd978607eadc9d5:/docs/latex/wx/auinotebook.tex diff --git a/docs/latex/wx/auinotebook.tex b/docs/latex/wx/auinotebook.tex index 76ba502298..fec32a0cc9 100644 --- a/docs/latex/wx/auinotebook.tex +++ b/docs/latex/wx/auinotebook.tex @@ -3,198 +3,241 @@ % auibook.h at 11/Nov/06 22:56:01 % - \section{\class{wxAuiNotebook}}\label{wxauinotebook} +wxAuiNotebook is part of the wxAUI class framework. +See also \helpref{wxAUI overview}{wxauioverview}. + +wxAuiNotebook is a notebook control which implements many features common in applications with dockable panes. +Specifically, wxAuiNotebook implements functionality which allows the user to rearrange tab order via drag-and-drop, +split the tab window into many different splitter configurations, and toggle through different themes to customize +the control's look and feel. + +An effort has been made to try to maintain an API as similar to that of wxNotebook. + +The default theme that is used is wxAuiDefaultTabArt, which provides a modern, glossy look and feel. +The theme can be changed by calling \helpref{wxAuiNotebook::SetArtProvider}{wxauinotebooksetartprovider}. + \wxheading{Derived from} -\helpref{wxControl}{wxcontrol} +\helpref{wxControl}{wxcontrol}\\ +\helpref{wxWindow}{wxwindow}\\ +\helpref{wxEvtHandler}{wxevthandler}\\ +\helpref{wxObject}{wxobject} \wxheading{Include files} - + -\wxheading{Data structures} +\wxheading{Library} -\latexignore{\rtfignore{\wxheading{Members}}} +\helpref{wxAui}{librarieslist} -\membersection{wxAuiNotebook::wxAuiNotebook}\label{wxauinotebookwxauinotebook} +\wxheading{Window styles} -\func{}{wxAuiNotebook}{\void} +\twocolwidtha{5cm}% +\begin{twocollist}\itemsep=0pt +\twocolitem{\windowstyle{wxAUI\_NB\_DEFAULT\_STYLE}}{Defined as wxAUI\_NB\_TOP | wxAUI\_NB\_TAB\_SPLIT | wxAUI\_NB\_TAB\_MOVE | wxAUI\_NB\_SCROLL\_BUTTONS | wxAUI\_NB\_CLOSE\_ON\_ACTIVE\_TAB.} +\twocolitem{\windowstyle{wxAUI\_NB\_TAB\_SPLIT}}{Allows the tab control to be split by dragging a tab.} +\twocolitem{\windowstyle{wxAUI\_NB\_TAB\_MOVE}}{Allows a tab to be moved horizontally by dragging.} +\twocolitem{\windowstyle{wxAUI\_NB\_TAB\_EXTERNAL\_MOVE}}{Allows a tab to be moved to another tab control.} +\twocolitem{\windowstyle{wxAUI\_NB\_TAB\_FIXED\_WIDTH}}{With this style, all tabs have the same width.} +\twocolitem{\windowstyle{wxAUI\_NB\_SCROLL\_BUTTONS}}{With this style, left and right scroll buttons are displayed.} +\twocolitem{\windowstyle{wxAUI\_NB\_WINDOWLIST\_BUTTON}}{With this style, a drop-down list of windows is available.} +\twocolitem{\windowstyle{wxAUI\_NB\_CLOSE\_BUTTON}}{With this style, a close button is available on the tab bar.} +\twocolitem{\windowstyle{wxAUI\_NB\_CLOSE\_ON\_ACTIVE\_TAB}}{With this style, the close button is visible on the active tab.} +\twocolitem{\windowstyle{wxAUI\_NB\_CLOSE\_ON\_ALL\_TABS}}{With this style, the close button is visible on all tabs.} +\twocolitem{\windowstyle{wxAUI\_NB\_TOP}}{With this style, tabs are drawn along the top of the notebook.} +\twocolitem{\windowstyle{wxAUI\_NB\_BOTTOM}}{With this style, tabs are drawn along the bottom of the notebook.} +\end{twocollist} -\func{}{wxAuiNotebook}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxAUI\_NB\_DEFAULT\_STYLE}} +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} +\membersection{wxAuiNotebook::wxAuiNotebook}\label{wxauinotebookwxauinotebook} -\membersection{wxAuiNotebook::\destruct{wxAuiNotebook}}\label{wxauinotebookdtor} +\func{}{wxAuiNotebook}{\void} -\func{}{\destruct{wxAuiNotebook}}{\void} +\func{}{wxAuiNotebook}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxAUI\_NB\_DEFAULT\_STYLE}} +Constructor. Creates a wxAuiNotebok control. \membersection{wxAuiNotebook::AddPage}\label{wxauinotebookaddpage} \func{bool}{AddPage}{\param{wxWindow* }{page}, \param{const wxString\& }{caption}, \param{bool }{select = false}, \param{const wxBitmap\& }{bitmap = wxNullBitmap}} +Adds a page. If the {\it select} parameter is true, calling this will generate a page change event. -\membersection{wxAuiNotebook::CalculateTabCtrlHeight}\label{wxauinotebookcalculatetabctrlheight} +\membersection{wxAuiNotebook::AdvanceSelection}\label{wxauinotebookadvanceselection} -\func{int}{CalculateTabCtrlHeight}{\void} +\func{void}{AdvanceSelection}{\param{bool }{forward = true}} +Sets the selection to the next or previous page. \membersection{wxAuiNotebook::Create}\label{wxauinotebookcreate} \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}} +Creates the notebook window. \membersection{wxAuiNotebook::DeletePage}\label{wxauinotebookdeletepage} \func{bool}{DeletePage}{\param{size\_t }{page}} +Deletes a page at the given index. Calling this method will generate a page change event. -\membersection{wxAuiNotebook::DoSizing}\label{wxauinotebookdosizing} - -\func{void}{DoSizing}{\void} - - -\membersection{wxAuiNotebook::FindTab}\label{wxauinotebookfindtab} +\membersection{wxAuiNotebook::GetArtProvider}\label{wxauinotebookgetartprovider} -\func{bool}{FindTab}{\param{wxWindow* }{page}, \param{wxAuiTabCtrl** }{ctrl}, \param{int* }{idx}} +\constfunc{wxAuiTabArt*}{GetArtProvider}{\void} +Returns the associated art provider. -\membersection{wxAuiNotebook::GetActiveTabCtrl}\label{wxauinotebookgetactivetabctrl} +\membersection{wxAuiNotebook::GetHeightForPageHeight}\label{wxauinotebookgetheightforpageheight} -\func{wxAuiTabCtrl*}{GetActiveTabCtrl}{\void} +\func{int}{GetHeightForPageHeight}{\param{int }{pageHeight}} +Returns the desired height of the notebook for the given page height. Use this to fit the notebook to +a given page size. -\membersection{wxAuiNotebook::GetArtProvider}\label{wxauinotebookgetartprovider} +\membersection{wxAuiNotebook::GetPage}\label{wxauinotebookgetpage} -\constfunc{wxAuiTabArt*}{GetArtProvider}{\void} +\constfunc{wxWindow*}{GetPage}{\param{size\_t }{page\_idx}} +Returns the page specified by the given index. -\membersection{wxAuiNotebook::GetPage}\label{wxauinotebookgetpage} +\membersection{wxAuiNotebook::GetPageBitmap}\label{wxauinotebookgetpagebitmap} -\constfunc{wxWindow*}{GetPage}{\param{size\_t }{page\_idx}} +\constfunc{wxBitmap}{GetPageBitmap}{\param{size\_t }{page}} +Returns the tab bitmap for the page. \membersection{wxAuiNotebook::GetPageCount}\label{wxauinotebookgetpagecount} \constfunc{size\_t}{GetPageCount}{\void} +Returns the number of pages in the notebook. \membersection{wxAuiNotebook::GetPageIndex}\label{wxauinotebookgetpageindex} \constfunc{int}{GetPageIndex}{\param{wxWindow* }{page\_wnd}} +Returns the page index for the specified window. If the window is not found in +the notebook, wxNOT\_FOUND is returned. -\membersection{wxAuiNotebook::GetSelection}\label{wxauinotebookgetselection} - -\constfunc{int}{GetSelection}{\void} - - -\membersection{wxAuiNotebook::GetTabCtrlFromPoint}\label{wxauinotebookgettabctrlfrompoint} +\membersection{wxAuiNotebook::GetPageText}\label{wxauinotebookgetpagetext} -\func{wxAuiTabCtrl*}{GetTabCtrlFromPoint}{\param{const wxPoint\& }{pt}} +\constfunc{wxString}{GetPageText}{\param{size\_t }{page}} +Returns the tab label for the page. -\membersection{wxAuiNotebook::GetTabFrameFromTabCtrl}\label{wxauinotebookgettabframefromtabctrl} +\membersection{wxAuiNotebook::GetTabCtrlHeight}\label{wxauinotebookgettabctrlheight} -\func{wxWindow*}{GetTabFrameFromTabCtrl}{\param{wxWindow* }{tab\_ctrl}} +\constfunc{int}{GetTabCtrlHeight}{\void} +Returns the height of the tab control. -\membersection{wxAuiNotebook::InitNotebook}\label{wxauinotebookinitnotebook} +\membersection{wxAuiNotebook::GetSelection}\label{wxauinotebookgetselection} -\func{void}{InitNotebook}{\param{long }{style}} +\constfunc{int}{GetSelection}{\void} +Returns the currently selected page. \membersection{wxAuiNotebook::InsertPage}\label{wxauinotebookinsertpage} \func{bool}{InsertPage}{\param{size\_t }{page\_idx}, \param{wxWindow* }{page}, \param{const wxString\& }{caption}, \param{bool }{select = false}, \param{const wxBitmap\& }{bitmap = wxNullBitmap}} +InsertPage() is similar to AddPage, but allows the ability to specify the insert location. +If the {\it select} parameter is true, calling this will generate a page change event. -\membersection{wxAuiNotebook::OnChildFocus}\label{wxauinotebookonchildfocus} - -\func{void}{OnChildFocus}{\param{wxChildFocusEvent\& }{evt}} - - -\membersection{wxAuiNotebook::OnEraseBackground}\label{wxauinotebookonerasebackground} - -\func{void}{OnEraseBackground}{\param{wxEraseEvent\& }{evt}} - - -\membersection{wxAuiNotebook::OnRender}\label{wxauinotebookonrender} - -\func{void}{OnRender}{\param{wxAuiManagerEvent\& }{evt}} - - -\membersection{wxAuiNotebook::OnSize}\label{wxauinotebookonsize} - -\func{void}{OnSize}{\param{wxSizeEvent\& }{evt}} - - -\membersection{wxAuiNotebook::OnTabBeginDrag}\label{wxauinotebookontabbegindrag} - -\func{void}{OnTabBeginDrag}{\param{wxCommandEvent\& }{evt}} - - -\membersection{wxAuiNotebook::OnTabButton}\label{wxauinotebookontabbutton} - -\func{void}{OnTabButton}{\param{wxCommandEvent\& }{evt}} - - -\membersection{wxAuiNotebook::OnTabClicked}\label{wxauinotebookontabclicked} +\membersection{wxAuiNotebook::RemovePage}\label{wxauinotebookremovepage} -\func{void}{OnTabClicked}{\param{wxCommandEvent\& }{evt}} +\func{bool}{RemovePage}{\param{size\_t }{page}} +Removes a page, without deleting the window pointer. -\membersection{wxAuiNotebook::OnTabDragMotion}\label{wxauinotebookontabdragmotion} +\membersection{wxAuiNotebook::SetArtProvider}\label{wxauinotebooksetartprovider} -\func{void}{OnTabDragMotion}{\param{wxCommandEvent\& }{evt}} +\func{void}{SetArtProvider}{\param{wxAuiTabArt* }{art}} +Sets the art provider to be used by the notebook. -\membersection{wxAuiNotebook::OnTabEndDrag}\label{wxauinotebookontabenddrag} +\membersection{wxAuiNotebook::SetFont}\label{wxauinotebooksetfont} -\func{void}{OnTabEndDrag}{\param{wxCommandEvent\& }{evt}} +\func{bool}{SetFont}{\param{const wxFont\& }{font}} +Sets the font for drawing the tab labels, using a bold version of the font for selected tab labels. -\membersection{wxAuiNotebook::RemoveEmptyTabFrames}\label{wxauinotebookremoveemptytabframes} +\membersection{wxAuiNotebook::SetNormalFont}\label{wxauinotebooksetnormalfont} -\func{void}{RemoveEmptyTabFrames}{\void} +\func{void}{SetNormalFont}{\param{const wxFont\& }{font}} +Sets the font for drawing unselected tab labels. -\membersection{wxAuiNotebook::RemovePage}\label{wxauinotebookremovepage} +\membersection{wxAuiNotebook::SetSelectedFont}\label{wxauinotebooksetselectedfont} -\func{bool}{RemovePage}{\param{size\_t }{page}} +\func{void}{SetSelectedFont}{\param{const wxFont\& }{font}} +Sets the font for drawing selected tab labels. -\membersection{wxAuiNotebook::SetArtProvider}\label{wxauinotebooksetartprovider} +\membersection{wxAuiNotebook::SetMeasuringFont}\label{wxauinotebooksetmeasuringfont} -\func{void}{SetArtProvider}{\param{wxAuiTabArt* }{art}} +\func{void}{SetMeasuringFont}{\param{const wxFont\& }{font}} +Sets the font for measuring tab labels. \membersection{wxAuiNotebook::SetPageBitmap}\label{wxauinotebooksetpagebitmap} \func{bool}{SetPageBitmap}{\param{size\_t }{page}, \param{const wxBitmap\& }{bitmap}} +Sets the bitmap for the page. To remove a bitmap from the tab caption, pass +wxNullBitmap. \membersection{wxAuiNotebook::SetPageText}\label{wxauinotebooksetpagetext} \func{bool}{SetPageText}{\param{size\_t }{page}, \param{const wxString\& }{text}} +Sets the tab label for the page. \membersection{wxAuiNotebook::SetSelection}\label{wxauinotebooksetselection} \func{size\_t}{SetSelection}{\param{size\_t }{new\_page}} +Sets the page selection. Calling this method will generate a page change event. \membersection{wxAuiNotebook::SetTabCtrlHeight}\label{wxauinotebooksettabctrlheight} \func{void}{SetTabCtrlHeight}{\param{int }{height}} -these can be overridden +Sets the tab height. By default, the tab control height is calculated +by measuring the text height and bitmap sizes on the tab captions. Calling this +method will override that calculation and set the tab control to the specified +height parameter. A call to this method will override any call to SetUniformBitmapSize(). +Specifying -1 as the height will return the control to its default auto-sizing behaviour. + +\membersection{wxAuiNotebook::SetUniformBitmapSize}\label{wxauinotebooksetuniformbitmapsize} + +\func{void}{SetUniformBitmapSize}{\param{const wxSize\& }{size}} + +SetUniformBitmapSize() ensures that all tabs will have the same height, even +if some tabs don't have bitmaps. Passing wxDefaultSize to this function will +instruct the control to use dynamic tab height, which is the default behaviour. +Under the default behaviour, when a tab with a large bitmap is added, the tab control's +height will automatically increase to accommodate the larger bitmap. + +\func{void}{Split}{\param{size\_t }{page}, \param{int }{direction}} + +Split performs a split operation programmatically. The argument \arg{page} indicates +the page that will be split off. This page will also become the active page after the +split. The \arg{direction} argument specifies where the pane should go, it should be one +of the following: wxTOP, wxBOTTOM, wxLEFT, or wxRIGHT. +\membersection{wxAuiNotebook::ShowWindowMenu}\label{wxauinotebookshowwindowmenu} -\membersection{wxAuiNotebook::SetWindowStyleFlag}\label{wxauinotebooksetwindowstyleflag} +\func{bool}{ShowWindowMenu}{\void} -\func{void}{SetWindowStyleFlag}{\param{long }{style}} +Shows the window menu for the active tab control associated with this notebook, +and returns \true if a selection was made.