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 (note that wxAuiNotebook does not derive from 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.
@library{wxaui}
@category{aui}
*/
-class wxAuiNotebook : public wxControl
+class wxAuiNotebook : public wxBookCtrlBase
{
public:
/**
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
+ /**
+ Adds a new page.
+
+ 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.
+
+ @param page
+ Specifies the new page.
+ @param text
+ Specifies the text for the new page.
+ @param select
+ Specifies whether the page should be selected.
+ @param imageId
+ Specifies the optional image index for the new page.
+
+ @return @true if successful, @false otherwise.
+
+ @remarks Do not delete the page, it will be deleted by the book control.
+
+ @see InsertPage()
+ @since 2.9.3
+ */
+ virtual bool AddPage(wxWindow *page, const wxString &text, bool select, int imageId);
+
/**
Sets the selection to the next or previous page.
*/
void AdvanceSelection(bool forward = true);
+ /**
+ Changes the selection for the given page, returning the previous selection.
+
+ This function behaves as SetSelection() but does @em not generate the
+ page changing events.
+
+ See @ref overview_events_prog for more information.
+ @since 2.9.3
+ */
+ virtual int ChangeSelection(size_t n);
+
/**
Creates the notebook window.
*/
const wxSize& size = wxDefaultSize,
long style = 0);
+ /**
+ Deletes all pages.
+ @since 2.9.3
+ */
+ virtual bool DeleteAllPages();
+
/**
Deletes a page at the given index.
Calling this method will generate a page change event.
*/
wxAuiTabArt* GetArtProvider() const;
+ /**
+ Returns the currently selected page or @NULL.
+ @since 2.9.3
+ */
+ wxWindow* GetCurrentPage () const;
+
/**
Returns the desired height of the notebook for the given page height.
Use this to fit the notebook to a given page size.
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
+ /**
+ Inserts a new page at the specified position.
+
+ @param index
+ Specifies the position for the new page.
+ @param page
+ Specifies the new page.
+ @param text
+ Specifies the text for the new page.
+ @param select
+ Specifies whether the page should be selected.
+ @param imageId
+ Specifies the optional image index for the new page.
+
+ @return @true if successful, @false otherwise.
+
+ @remarks Do not delete the page, it will be deleted by the book control.
+
+ @see AddPage()
+ @since 2.9.3
+ */
+ virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
+ bool select=false, int imageId=NO_IMAGE);
+
/**
Removes a page, without deleting the window pointer.
*/
*/
bool SetPageBitmap(size_t page, const wxBitmap& bitmap);
+ /**
+ Sets the image index for the given page. @a image is an index into
+ the image list which was set with SetImageList().
+ @since 2.9.3
+ */
+ virtual bool SetPageImage(size_t n, int imageId);
+
/**
Sets the tab label for the page.
*/
virtual void SetSizingInfo(const wxSize& tab_ctrl_size, size_t tab_count) = 0;
};
+/**
+ @class wxAuiNotebookEvent
+
+ This class is used by the events generated by wxAuiNotebook.
+
+ @beginEventEmissionTable{wxAuiNotebookEvent}
+ @event{EVT_AUINOTEBOOK_PAGE_CLOSE(id, func)}
+ A page is about to be closed. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE event.
+ @event{EVT_AUINOTEBOOK_PAGE_CHANGED(id, func)}
+ The page selection was changed. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED event.
+ @event{EVT_AUINOTEBOOK_PAGE_CHANGING(id, func)}
+ The page selection is about to be changed. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING event. This event can be vetoed.
+ @event{EVT_AUINOTEBOOK_BUTTON(id, func)}
+ The window list button has been pressed. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_BUTTON event.
+ @event{EVT_AUINOTEBOOK_BEGIN_DRAG(id, func)}
+ Dragging is about to begin. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG event.
+ @event{EVT_AUINOTEBOOK_END_DRAG(id, func)}
+ Dragging has ended. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_END_DRAG event.
+ @event{EVT_AUINOTEBOOK_DRAG_MOTION(id, func)}
+ Emitted during a drag and drop operation. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION event.
+ @event{EVT_AUINOTEBOOK_ALLOW_DND(id, func)}
+ Whether to allow a tab to be dropped. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND event. This event must be specially allowed.
+ @endEventTable
+
+ @library{wxaui}
+ @category{events,bookctrl}
+
+ @see wxAuiNotebook, wxBookCtrlEvent
+*/
+class wxAuiNotebookEvent : public wxBookCtrlEvent
+{
+public:
+ /**
+ Constructor.
+ */
+ wxAuiNotebookEvent(wxEventType command_type = wxEVT_NULL, int win_id = 0);
+
+ wxEvent *Clone();
+};
+