]>
git.saurik.com Git - wxWidgets.git/blob - interface/aui/auibook.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxAuiNotebook class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @headerfile auibook.h wx/aui/auibook.h
13 wxAuiNotebook is part of the wxAUI class framework.
14 See also @ref overview_wxauioverview "wxAUI overview".
16 wxAuiNotebook is a notebook control which implements many features common in
17 applications with dockable panes.
18 Specifically, wxAuiNotebook implements functionality which allows the user to
19 rearrange tab order via drag-and-drop,
20 split the tab window into many different splitter configurations, and toggle
21 through different themes to customize
22 the control's look and feel.
24 An effort has been made to try to maintain an API as similar to that of
27 The default theme that is used is wxAuiDefaultTabArt, which provides a modern,
29 The theme can be changed by calling wxAuiNotebook::SetArtProvider.
32 @style{wxAUI_NB_DEFAULT_STYLE}:
33 Defined as wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE |
34 wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ACTIVE_TAB.
35 @style{wxAUI_NB_TAB_SPLIT}:
36 Allows the tab control to be split by dragging a tab.
37 @style{wxAUI_NB_TAB_MOVE}:
38 Allows a tab to be moved horizontally by dragging.
39 @style{wxAUI_NB_TAB_EXTERNAL_MOVE}:
40 Allows a tab to be moved to another tab control.
41 @style{wxAUI_NB_TAB_FIXED_WIDTH}:
42 With this style, all tabs have the same width.
43 @style{wxAUI_NB_SCROLL_BUTTONS}:
44 With this style, left and right scroll buttons are displayed.
45 @style{wxAUI_NB_WINDOWLIST_BUTTON}:
46 With this style, a drop-down list of windows is available.
47 @style{wxAUI_NB_CLOSE_BUTTON}:
48 With this style, a close button is available on the tab bar.
49 @style{wxAUI_NB_CLOSE_ON_ACTIVE_TAB}:
50 With this style, the close button is visible on the active tab.
51 @style{wxAUI_NB_CLOSE_ON_ALL_TABS}:
52 With this style, the close button is visible on all tabs.
54 With this style, tabs are drawn along the top of the notebook.
55 @style{wxAUI_NB_BOTTOM}:
56 With this style, tabs are drawn along the bottom of the notebook.
62 class wxAuiNotebook
: public wxControl
67 Constructor. Creates a wxAuiNotebok control.
70 wxAuiNotebook(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
71 const wxPoint
& pos
= wxDefaultPosition
,
72 const wxSize
& size
= wxDefaultSize
,
73 long style
= wxAUI_NB_DEFAULT_STYLE
);
77 Adds a page. If the @e select parameter is @true, calling this will generate a
80 bool AddPage(wxWindow
* page
, const wxString
& caption
,
82 const wxBitmap
& bitmap
= wxNullBitmap
);
85 Sets the selection to the next or previous page.
87 void AdvanceSelection(bool forward
= @
true);
90 Creates the notebook window.
92 bool Create(wxWindow
* parent
, wxWindowID id
= wxID_ANY
,
93 const wxPoint
& pos
= wxDefaultPosition
,
94 const wxSize
& size
= wxDefaultSize
,
98 Deletes a page at the given index. Calling this method will generate a page
101 bool DeletePage(size_t page
);
104 Returns the associated art provider.
106 wxAuiTabArt
* GetArtProvider();
109 Returns the desired height of the notebook for the given page height. Use this
110 to fit the notebook to
113 int GetHeightForPageHeight(int pageHeight
);
116 Returns the page specified by the given index.
118 wxWindow
* GetPage(size_t page_idx
);
121 Returns the tab bitmap for the page.
123 wxBitmap
GetPageBitmap(size_t page
);
126 Returns the number of pages in the notebook.
128 size_t GetPageCount();
131 Returns the page index for the specified window. If the window is not found in
132 the notebook, wxNOT_FOUND is returned.
134 int GetPageIndex(wxWindow
* page_wnd
);
137 Returns the tab label for the page.
139 wxString
GetPageText(size_t page
);
142 Returns the currently selected page.
147 Returns the height of the tab control.
149 int GetTabCtrlHeight();
152 InsertPage() is similar to AddPage, but allows the ability to specify the
154 If the @e select parameter is @true, calling this will generate a page change
157 bool InsertPage(size_t page_idx
, wxWindow
* page
,
158 const wxString
& caption
,
159 bool select
= @
false,
160 const wxBitmap
& bitmap
= wxNullBitmap
);
163 Removes a page, without deleting the window pointer.
165 bool RemovePage(size_t page
);
168 Sets the art provider to be used by the notebook.
170 void SetArtProvider(wxAuiTabArt
* art
);
173 Sets the font for drawing the tab labels, using a bold version of the font for
176 bool SetFont(const wxFont
& font
);
179 Sets the font for measuring tab labels.
181 void SetMeasuringFont(const wxFont
& font
);
184 Sets the font for drawing unselected tab labels.
186 void SetNormalFont(const wxFont
& font
);
189 Sets the bitmap for the page. To remove a bitmap from the tab caption, pass
192 bool SetPageBitmap(size_t page
, const wxBitmap
& bitmap
);
195 Sets the tab label for the page.
197 bool SetPageText(size_t page
, const wxString
& text
);
200 Sets the font for drawing selected tab labels.
202 void SetSelectedFont(const wxFont
& font
);
205 Sets the page selection. Calling this method will generate a page change event.
207 size_t SetSelection(size_t new_page
);
210 Sets the tab height. By default, the tab control height is calculated
211 by measuring the text height and bitmap sizes on the tab captions. Calling this
212 method will override that calculation and set the tab control to the specified
213 height parameter. A call to this method will override any call to
214 SetUniformBitmapSize().
215 Specifying -1 as the height will return the control to its default auto-sizing
218 void SetTabCtrlHeight(int height
);
222 Split performs a split operation programmatically. The argument @e page
224 the page that will be split off. This page will also become the active page
226 split. The @e direction argument specifies where the pane should go, it should
228 of the following: wxTOP, wxBOTTOM, wxLEFT, or wxRIGHT.
230 void SetUniformBitmapSize(const wxSize
& size
);
231 void Split(size_t page
, int direction
);
235 Shows the window menu for the active tab control associated with this notebook,
236 and returns @true if a selection was made.
238 bool ShowWindowMenu();
244 @headerfile auibook.h wx/aui/auibook.h
260 Clones the art object.
262 wxAuiTabArt
* Clone();
265 Draws a background on the given area.
267 void DrawBackground(wxDC
& dc
, wxWindow
* wnd
, const wxRect
& rect
);
272 void DrawButton(wxDC
& dc
, wxWindow
* wnd
, const wxRect
& in_rect
,
276 const wxBitmap
& bitmap_override
,
282 void DrawTab(wxDC
& dc
, wxWindow
* wnd
, const wxRect
& in_rect
,
283 const wxString
& caption
,
284 const wxBitmap
& bitmap
,
286 int close_button_state
,
287 wxRect
* out_tab_rect
,
288 wxRect
* out_button_rect
,
292 Returns the tab control size.
294 int GetBestTabCtrlSize(wxWindow
* wnd
,
295 wxAuiNotebookPageArray
& pages
);
298 Returns the indent size.
303 Returns the tab size for the given caption, bitmap and state.
305 wxSize
GetTabSize(wxDC
& dc
, wxWindow
* wnd
,
306 const wxString
& caption
,
307 const wxBitmap
& bitmap
,
309 int close_button_state
,
315 void SetFlags(unsigned int flags
);
318 Sets the font used for calculating measurements.
320 void SetMeasuringFont(const wxFont
& font
);
323 Sets the normal font for drawing labels.
325 void SetNormalFont(const wxFont
& font
);
328 Sets the font for drawing text for selected UI elements.
330 void SetSelectedFont(const wxFont
& font
);
333 Sets sizing information.
335 void SetSizingInfo(const wxSize
& tab_ctrl_size
, size_t tab_count
);
338 Pops up a menu to show the list of windows managed by wxAui.
340 int ShowWindowList(wxWindow
* wnd
, const wxArrayString
& items
,