$szTitle = "wxauinotebook"; include "./_header.inc"; ?>
wxauinotebook is part of the wxaui class framework. see also wxaui overview.
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 wxauinotebook::setartprovider.
derived from
include files
<wx/aui/auibook.h>
window styles
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 . |
wxaui_nb_tab_split | allows the tab control to be split by dragging a tab. |
wxaui_nb_tab_move | allows a tab to be moved horizontally by dragging. |
wxaui_nb_tab_external_move | allows a tab to be moved to another tab control. |
wxaui_nb_tab_fixed_width | with this style, all tabs have the same width. |
wxaui_nb_scroll_buttons | with this style, left and right scroll buttons are displayed. |
wxaui_nb_windowlist_button | with this style, a drop-down list of windows is available. |
wxaui_nb_close_button | with this style, a close button is available on the tab bar. |
wxaui_nb_close_on_active_tab | with this style, the close button is visible on the active tab. |
wxaui_nb_close_on_all_tabs | with this style, the close button is visible on all tabs. |
wxaui_nb_top | with this style, tabs are drawn along the top of the notebook. |
wxaui_nb_bottom | with this style, tabs are drawn along the bottom of the notebook. |
data structures
members
wxauinotebook::wxauinotebook
wxauinotebook::addpage
wxauinotebook::advanceselection
wxauinotebook::create
wxauinotebook::deletepage
wxauinotebook::getartprovider
wxauinotebook::getheightforpageheight
wxauinotebook::getpage
wxauinotebook::getpagebitmap
wxauinotebook::getpagecount
wxauinotebook::getpageindex
wxauinotebook::getpagetext
wxauinotebook::getselection
wxauinotebook::gettabctrlheight
wxauinotebook::insertpage
wxauinotebook::removepage
wxauinotebook::setartprovider
wxauinotebook::setfont
wxauinotebook::setnormalfont
wxauinotebook::setselectedfont
wxauinotebook::setmeasuringfont
wxauinotebook::setpagebitmap
wxauinotebook::setpagetext
wxauinotebook::setselection
wxauinotebook::settabctrlheight
wxauinotebook::setuniformbitmapsize
wxauinotebook::showwindowmenu
wxauinotebook()
wxauinotebook(wxwindow* parent, wxwindowid id = wxid_any, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxaui_nb_default_style)
constructor. creates a wxauinotebok control.
bool addpage(wxwindow* page, const wxstring& caption, bool select = false, const wxbitmap& bitmap = wxnullbitmap)
adds a page. if the select parameter is true, calling this will generate a page change event.
void advanceselection(bool forward = true)
sets the selection to the next or previous page.
bool create(wxwindow* parent, wxwindowid id = wxid_any, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = 0)
creates the notebook window.
bool deletepage(size_t page)
deletes a page at the given index. calling this method will generate a page change event.
wxauitabart* getartprovider() const
returns the associated art provider.
int getheightforpageheight(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.
wxwindow* getpage(size_t page_idx) const
returns the page specified by the given index.
wxbitmap getpagebitmap(size_t page) const
returns the tab bitmap for the page.
size_t getpagecount() const
returns the number of pages in the notebook.
int getpageindex(wxwindow* page_wnd) const
returns the page index for the specified window. if the window is not found in the notebook, wxnot_found is returned.
wxstring getpagetext(size_t page) const
returns the tab label for the page.
int getselection() const
returns the currently selected page.
int gettabctrlheight() const
returns the height of the tab control.
bool insertpage(size_t page_idx, wxwindow* page, const wxstring& caption, bool select = false, const wxbitmap& bitmap = wxnullbitmap)
insertpage() is similar to addpage, but allows the ability to specify the insert location. if the select parameter is true, calling this will generate a page change event.
bool removepage(size_t page)
removes a page, without deleting the window pointer.
void setartprovider(wxauitabart* art)
sets the art provider to be used by the notebook.
bool setfont(const wxfont& font)
sets the font for drawing the tab labels, using a bold version of the font for selected tab labels.
void setnormalfont(const wxfont& font)
sets the font for drawing unselected tab labels.
void setselectedfont(const wxfont& font)
sets the font for drawing selected tab labels.
void setmeasuringfont(const wxfont& font)
sets the font for measuring tab labels.
bool setpagebitmap(size_t page, const wxbitmap& bitmap)
sets the bitmap for the page. to remove a bitmap from the tab caption, pass wxnullbitmap.
bool setpagetext(size_t page, const wxstring& text)
sets the tab label for the page.
size_t setselection(size_t new_page)
sets the page selection. calling this method will generate a page change event.
void settabctrlheight(int height)
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.
void setuniformbitmapsize(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.
void split(size_t page, int direction)
split performs a split operation programmatically. the argument page indicates the page that will be split off. this page will also become the active page after the split. the direction argument specifies where the pane should go, it should be one of the following: wxtop, wxbottom, wxleft, or wxright.
bool showwindowmenu()
shows the window menu for the active tab control associated with this notebook, and returns true if a selection was made.
include "./_footer.inc"; ?>