X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1bc693a9ca31e2fb5da145c741a3a3eb0796e6f5..ce45dbe3c85292676e54e3d4a78da876dc25b042:/interface/wx/aui/auibook.h diff --git a/interface/wx/aui/auibook.h b/interface/wx/aui/auibook.h index ab151ff49b..451924152e 100644 --- a/interface/wx/aui/auibook.h +++ b/interface/wx/aui/auibook.h @@ -3,7 +3,7 @@ // Purpose: interface of wxAuiNotebook // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -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. @@ -54,32 +51,29 @@ With this style, tabs are drawn along the bottom of the notebook. @endStyleTable - - @beginEventTable{wxAuiNotebookEvent} + @beginEventEmissionTable{wxAuiNotebookEvent} @event{EVT_AUINOTEBOOK_PAGE_CLOSE(id, func)} - Provide description. + A page is about to be closed. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE event. @event{EVT_AUINOTEBOOK_PAGE_CHANGED(id, func)} - Provide description. + The page selection was changed. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED event. @event{EVT_AUINOTEBOOK_PAGE_CHANGING(id, func)} - Provide description. + 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)} - Provide description. + The window list button has been pressed. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_BUTTON event. @event{EVT_AUINOTEBOOK_BEGIN_DRAG(id, func)} - Provide description. + Dragging is about to begin. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG event. @event{EVT_AUINOTEBOOK_END_DRAG(id, func)} - Provide description. + Dragging has ended. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_END_DRAG event. @event{EVT_AUINOTEBOOK_DRAG_MOTION(id, func)} - Provide description. + Emitted during a drag and drop operation. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION event. @event{EVT_AUINOTEBOOK_ALLOW_DND(id, func)} - Provide description. + Whether to allow a tab to be dropped. Processes a @c wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND event. This event must be specially allowed. @endEventTable - @todo provide description for the events above. - @library{wxaui} @category{aui} */ -class wxAuiNotebook : public wxControl +class wxAuiNotebook : public wxBookCtrlBase { public: /** @@ -103,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. */ @@ -116,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. @@ -127,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. @@ -180,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. */ @@ -212,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. */ @@ -248,8 +322,8 @@ public: The @a direction argument specifies where the pane should go, it should be one of the following: wxTOP, wxBOTTOM, wxLEFT, or wxRIGHT. */ - void SetUniformBitmapSize(const wxSize& size); - void Split(size_t page, int direction); + virtual void SetUniformBitmapSize(const wxSize& size); + virtual void Split(size_t page, int direction); //@} /** @@ -340,9 +414,63 @@ public: */ virtual void SetSelectedFont(const wxFont& font) = 0; + /** + Sets the colour of the inactive tabs. + + @since 2.9.2 + */ + virtual void SetColour(const wxColour& colour) = 0; + + /** + Sets the colour of the selected tab. + + @since 2.9.2 + */ + virtual void SetActiveColour(const wxColour& colour) = 0; + /** Sets sizing information. */ 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(); +}; +