Version: 2.9.4
Public Member Functions
wxAuiNotebook Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/aui/auibook.h>

Inheritance diagram for wxAuiNotebook:

Detailed Description

wxAuiNotebook is part of the wxAUI class framework, which represents a notebook control, managing multiple windows with associated tabs.

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.

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.

Styles

This class supports the following styles:

Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxAuiNotebookEvent& event)

Event macros for events emitted by this class:

Library:  wxAui
Category:  Window Docking (wxAUI)

Public Member Functions

 wxAuiNotebook ()
 Default ctor.
 wxAuiNotebook (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxAUI_NB_DEFAULT_STYLE)
 Constructor.
bool AddPage (wxWindow *page, const wxString &caption, bool select=false, const wxBitmap &bitmap=wxNullBitmap)
 Adds a page.
virtual bool AddPage (wxWindow *page, const wxString &text, bool select, int imageId)
 新しいページを追加します。
void AdvanceSelection (bool forward=true)
 Sets the selection to the next or previous page.
virtual int ChangeSelection (size_t n)
 指定されたページを変更し、以前選択していたページを返却します。
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
 Creates the notebook window.
virtual bool DeleteAllPages ()
 Deletes all pages.
bool DeletePage (size_t page)
 Deletes a page at the given index.
wxAuiTabArtGetArtProvider () const
 Returns the associated art provider.
wxWindowGetCurrentPage () const
 Returns the currently selected page or NULL.
int GetHeightForPageHeight (int pageHeight)
 Returns the desired height of the notebook for the given page height.
wxWindowGetPage (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.
wxString GetPageText (size_t page) const
 Returns the tab label for the page.
wxString GetPageToolTip (size_t pageIdx) const
 Returns the tooltip for the tab label of 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.
virtual bool InsertPage (size_t index, wxWindow *page, const wxString &text, bool select=false, int imageId=NO_IMAGE)
 Inserts a new page at the specified position.
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.
virtual 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 SetMeasuringFont (const wxFont &font)
 Sets the font for measuring tab labels.
void SetNormalFont (const wxFont &font)
 Sets the font for drawing unselected tab labels.
bool SetPageBitmap (size_t page, const wxBitmap &bitmap)
 Sets the bitmap for the page.
virtual bool SetPageImage (size_t n, int imageId)
 Sets the image index for the given page.
bool SetPageText (size_t page, const wxString &text)
 Sets the tab label for the page.
bool SetPageToolTip (size_t page, const wxString &text)
 Sets the tooltip displayed when hovering over the tab label of the page.
void SetSelectedFont (const wxFont &font)
 Sets the font for drawing selected tab labels.
size_t SetSelection (size_t new_page)
 Sets the page selection.
virtual void SetTabCtrlHeight (int height)
 Sets the tab height.
bool ShowWindowMenu ()
 Shows the window menu for the active tab control associated with this notebook, and returns true if a selection was made.
virtual void SetUniformBitmapSize (const wxSize &size)
 Split performs a split operation programmatically.
virtual void Split (size_t page, int direction)
 Split performs a split operation programmatically.

List of all members.


Constructor & Destructor Documentation

wxAuiNotebook::wxAuiNotebook ( )

Default ctor.

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.


Member Function Documentation

bool wxAuiNotebook::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.

virtual bool wxAuiNotebook::AddPage ( wxWindow page,
const wxString text,
bool  select,
int  imageId 
) [virtual]

新しいページを追加します。

The page must have the book control itself as the parent and must not have been added to this control previously.

The call to this function may generate the page changing events.

Parameters:
pageSpecifies the new page.
textSpecifies the text for the new page.
selectSpecifies whether the page should be selected.
imageIdSpecifies the optional image index for the new page.
Returns:
true if successful, false otherwise.
注意:
Do not delete the page, it will be deleted by the book control.
参照:
InsertPage()
Since:
2.9.3

Reimplemented from wxBookCtrlBase.

void wxAuiNotebook::AdvanceSelection ( bool  forward = true)

Sets the selection to the next or previous page.

Reimplemented from wxBookCtrlBase.

virtual int wxAuiNotebook::ChangeSelection ( size_t  n) [virtual]

指定されたページを変更し、以前選択していたページを返却します。

This function behaves as SetSelection() but does not generate the page changing events.

See User Generated Events vs Programmatically Generated Events for more information.

Since:
2.9.3

Implements wxBookCtrlBase.

bool wxAuiNotebook::Create ( wxWindow parent,
wxWindowID  id = wxID_ANY,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = 0 
)

Creates the notebook window.

virtual bool wxAuiNotebook::DeleteAllPages ( ) [virtual]

Deletes all pages.

Since:
2.9.3

Reimplemented from wxBookCtrlBase.

bool wxAuiNotebook::DeletePage ( size_t  page) [virtual]

Deletes a page at the given index.

Calling this method will generate a page change event.

Reimplemented from wxBookCtrlBase.

wxAuiTabArt* wxAuiNotebook::GetArtProvider ( ) const

Returns the associated art provider.

wxWindow* wxAuiNotebook::GetCurrentPage ( ) const

Returns the currently selected page or NULL.

Since:
2.9.3

Reimplemented from wxBookCtrlBase.

int wxAuiNotebook::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* wxAuiNotebook::GetPage ( size_t  page_idx) const

Returns the page specified by the given index.

Reimplemented from wxBookCtrlBase.

wxBitmap wxAuiNotebook::GetPageBitmap ( size_t  page) const

Returns the tab bitmap for the page.

size_t wxAuiNotebook::GetPageCount ( ) const [virtual]

Returns the number of pages in the notebook.

Reimplemented from wxBookCtrlBase.

int wxAuiNotebook::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 wxAuiNotebook::GetPageText ( size_t  page) const [virtual]

Returns the tab label for the page.

Implements wxBookCtrlBase.

wxString wxAuiNotebook::GetPageToolTip ( size_t  pageIdx) const

Returns the tooltip for the tab label of the page.

Since:
2.9.4
int wxAuiNotebook::GetSelection ( ) const [virtual]

Returns the currently selected page.

Implements wxBookCtrlBase.

int wxAuiNotebook::GetTabCtrlHeight ( ) const

Returns the height of the tab control.

bool wxAuiNotebook::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.

virtual bool wxAuiNotebook::InsertPage ( size_t  index,
wxWindow page,
const wxString text,
bool  select = false,
int  imageId = NO_IMAGE 
) [virtual]

Inserts a new page at the specified position.

Parameters:
indexSpecifies the position for the new page.
pageSpecifies the new page.
textSpecifies the text for the new page.
selectSpecifies whether the page should be selected.
imageIdSpecifies the optional image index for the new page.
Returns:
true if successful, false otherwise.
注意:
Do not delete the page, it will be deleted by the book control.
参照:
AddPage()
Since:
2.9.3

Implements wxBookCtrlBase.

bool wxAuiNotebook::RemovePage ( size_t  page) [virtual]

Removes a page, without deleting the window pointer.

Reimplemented from wxBookCtrlBase.

void wxAuiNotebook::SetArtProvider ( wxAuiTabArt art)

Sets the art provider to be used by the notebook.

virtual bool wxAuiNotebook::SetFont ( const wxFont font) [virtual]

Sets the font for drawing the tab labels, using a bold version of the font for selected tab labels.

Reimplemented from wxWindow.

void wxAuiNotebook::SetMeasuringFont ( const wxFont font)

Sets the font for measuring tab labels.

void wxAuiNotebook::SetNormalFont ( const wxFont font)

Sets the font for drawing unselected tab labels.

bool wxAuiNotebook::SetPageBitmap ( size_t  page,
const wxBitmap bitmap 
)

Sets the bitmap for the page.

To remove a bitmap from the tab caption, pass wxNullBitmap.

virtual bool wxAuiNotebook::SetPageImage ( size_t  n,
int  imageId 
) [virtual]

Sets the image index for the given page.

image is an index into the image list which was set with SetImageList().

Since:
2.9.3

Implements wxBookCtrlBase.

bool wxAuiNotebook::SetPageText ( size_t  page,
const wxString text 
) [virtual]

Sets the tab label for the page.

Implements wxBookCtrlBase.

bool wxAuiNotebook::SetPageToolTip ( size_t  page,
const wxString text 
)

Sets the tooltip displayed when hovering over the tab label of the page.

Returns:
true if tooltip was updated, false if it failed, e.g. because the page index is invalid.
Since:
2.9.4
void wxAuiNotebook::SetSelectedFont ( const wxFont font)

Sets the font for drawing selected tab labels.

size_t wxAuiNotebook::SetSelection ( size_t  new_page) [virtual]

Sets the page selection.

Calling this method will generate a page change event.

Implements wxBookCtrlBase.

virtual void wxAuiNotebook::SetTabCtrlHeight ( int  height) [virtual]

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.

virtual void wxAuiNotebook::SetUniformBitmapSize ( const wxSize size) [virtual]

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 wxAuiNotebook::ShowWindowMenu ( )

Shows the window menu for the active tab control associated with this notebook, and returns true if a selection was made.

virtual void wxAuiNotebook::Split ( size_t  page,
int  direction 
) [virtual]

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.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines