X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc735b4085a71ba204bca6a61bd35e99d1e13ea6..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/ribbon/bar.h diff --git a/interface/wx/ribbon/bar.h b/interface/wx/ribbon/bar.h index 34d3a258be..e8d9ef3c48 100644 --- a/interface/wx/ribbon/bar.h +++ b/interface/wx/ribbon/bar.h @@ -2,7 +2,6 @@ // Name: ribbon/bar.h // Purpose: interface of wxRibbonBar // Author: Peter Cawley -// RCS-ID: $Id$ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -64,7 +63,8 @@ public: @beginStyleTable @style{wxRIBBON_BAR_DEFAULT_STYLE} Defined as wxRIBBON_BAR_FLOW_HORIZONTAL | - wxRIBBON_BAR_SHOW_PAGE_LABELS | wxRIBBON_BAR_SHOW_PANEL_EXT_BUTTONS + wxRIBBON_BAR_SHOW_PAGE_LABELS | wxRIBBON_BAR_SHOW_PANEL_EXT_BUTTONS | + wxRIBBON_BAR_SHOW_TOGGLE_BUTTON | wxRIBBON_BAR_SHOW_HELP_BUTTON. @style{wxRIBBON_BAR_FOLDBAR_STYLE} Defined as wxRIBBON_BAR_FLOW_VERTICAL | wxRIBBON_BAR_SHOW_PAGE_ICONS | wxRIBBON_BAR_SHOW_PANEL_EXT_BUTTONS | @@ -83,6 +83,12 @@ public: @style{wxRIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS} Causes minimise buttons to be shown on panels (where the panel has such a button). + @style{wxRIBBON_BAR_SHOW_TOGGLE_BUTTON} + Causes a toggle button to appear on the ribbon bar at top-right corner. + This style is new since wxWidgets 2.9.5. + @style{wxRIBBON_BAR_SHOW_HELP_BUTTON} + Causes a help button to appear on the ribbon bar at the top-right corner. + This style is new since wxWidgets 2.9.5. @endStyleTable @@ -101,6 +107,14 @@ public: Triggered when the right mouse button is pressed on a tab. @event{EVT_RIBBONBAR_TAB_RIGHT_UP(id, func)} Triggered when the right mouse button is released on a tab. + @event{EVT_RIBBONBAR_TAB_LEFT_DCLICK(id, func)} + Triggered when the left mouse button is double clicked on a tab. + @event{EVT_RIBBONBAR_TOGGLED(id, func)} + Triggered when the button triggering the ribbon bar is clicked. This + event is new since wxWidgets 2.9.5. + @event{EVT_RIBBONBAR_HELP_CLICK(id, func)} + Triggered when the help button is clicked. This even is new since + wxWidgets 2.9.5. @endEventTable @library{wxribbon} @@ -162,7 +176,7 @@ public: Note that unlike most other ribbon controls, the ribbon bar creates a default art provider when initialised, so an explicit call to SetArtProvider() is not required if the default art provider is - sufficient. Alos unlike other ribbon controls, the ribbon bar takes + sufficient. Also, unlike other ribbon controls, the ribbon bar takes ownership of the given pointer, and will delete it when the art provider is changed or the bar is destroyed. If this behaviour is not desired, then clone the art provider before setting it. @@ -204,13 +218,134 @@ public: */ wxRibbonPage* GetPage(int n); + /** + Get the number of pages in this bar. + + @since 2.9.4 + */ + size_t GetPageCount() const; + /** Dismiss the expanded panel of the currently active page. - Calls and returns the value fromwxRibbonPage::DismissExpandedPanel() + Calls and returns the value from wxRibbonPage::DismissExpandedPanel() for the currently active page, or @false if there is no active page. */ bool DismissExpandedPanel(); + + /** + Returns the number for a given ribbon bar page. + + The number can be used in other ribbon bar calls. + + @since 2.9.5 + */ + int GetPageNumber(wxRibbonPage* page) const; + + /** + Delete a single page from this ribbon bar. + + The user must call wxRibbonBar::Realize() after one (or more) calls to + this function. + + @since 2.9.4 + */ + void DeletePage(size_t n); + + /** + Delete all pages from the ribbon bar. + + @since 2.9.4 + */ + void ClearPages(); + + /** + Indicates whether the tab for the given page is shown to the user or + not. + + By default all page tabs are shown. + + @since 2.9.5 + */ + bool IsPageShown(size_t page) const; + + /** + Show or hide the tab for a given page. + + After showing or hiding a tab, you need to call wxRibbonBar::Realize(). + If you hide the tab for the currently active page (GetActivePage) then + you should call SetActivePage to activate a different page. + + @since 2.9.5 + */ + void ShowPage(size_t page, bool show_tab=true); + + /** + Hides the tab for a given page. + + Equivalent to @c ShowPage(page, false). + + @since 2.9.5 + */ + void HidePage(size_t page); + + /** + Indicates whether a tab is currently highlighted. + + @see AddPageHighlight() + + @since 2.9.5 + */ + bool IsPageHighlighted(size_t page) const; + + /** + Highlight the specified tab. + + Highlighted tabs have a colour between that of the active tab + and a tab over which the mouse is hovering. This can be used + to make a tab (usually temporarily) more noticeable to the user. + + @since 2.9.5 + */ + void AddPageHighlight(size_t page, bool highlight = true); + + /** + Changes a tab to not be highlighted. + + @see AddPageHighlight() + + @since 2.9.5 + */ + void RemovePageHighlight(size_t page); + + /** + Shows or hides the panel area of the ribbon bar. + + If the panel area is hidden, then only the tab of the ribbon bar will + be shown. This is useful for giving the user more screen space to work + with when he/she doesn't need to see the ribbon's options. + + @since 2.9.2 + */ + void ShowPanels(bool show = true); + + /** + Hides the panel area of the ribbon bar. + + This method simply calls ShowPanels() with @false argument. + + @since 2.9.2 + */ + void HidePanels(); + + /** + Indicates whether the panel area of the ribbon bar is shown. + + @see ShowPanels() + + @since 2.9.2 + */ + bool ArePanelsShown() const; /** Perform initial layout and size calculations of the bar and its