X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/079c683c3d30292926f74f1e06432659055c4f06..ce45dbe3c85292676e54e3d4a78da876dc25b042:/interface/wx/aui/auibook.h?ds=sidebyside diff --git a/interface/wx/aui/auibook.h b/interface/wx/aui/auibook.h index 2ed82e3edd..451924152e 100644 --- a/interface/wx/aui/auibook.h +++ b/interface/wx/aui/auibook.h @@ -19,9 +19,6 @@ 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. @@ -76,7 +73,7 @@ @library{wxaui} @category{aui} */ -class wxAuiNotebook : public wxControl +class wxAuiNotebook : public wxBookCtrlBase { public: /** @@ -100,11 +97,48 @@ 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. */ @@ -113,6 +147,12 @@ public: 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. @@ -124,6 +164,12 @@ public: */ 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. @@ -177,6 +223,30 @@ public: 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. */ @@ -209,6 +279,13 @@ public: */ 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. */ @@ -357,3 +434,43 @@ public: 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(); +}; +