X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02a40ac1da3c074bd305ac7757b89c617f8ec328..e4097f77c440b1f31a80fe273cc732c14d606096:/interface/wx/ribbon/buttonbar.h diff --git a/interface/wx/ribbon/buttonbar.h b/interface/wx/ribbon/buttonbar.h index 05e23634d9..27c396d7ac 100644 --- a/interface/wx/ribbon/buttonbar.h +++ b/interface/wx/ribbon/buttonbar.h @@ -2,7 +2,6 @@ // Name: ribbon/buttonbar.h // Purpose: interface of wxRibbonButtonBar // Author: Peter Cawley -// RCS-ID: $Id$ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -231,8 +230,6 @@ public: The kind of button to add. @param help_string The UI help string to associate with the new button. - @param client_data - Client data to associate with the new button. @return An opaque pointer which can be used only with other button bar methods. @@ -249,8 +246,7 @@ public: const wxBitmap& bitmap_disabled = wxNullBitmap, const wxBitmap& bitmap_small_disabled = wxNullBitmap, wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL, - const wxString& help_string = wxEmptyString, - wxObject* client_data = NULL); + const wxString& help_string = wxEmptyString); /** Inserts a button to the button bar (simple version) at the given position. @@ -345,8 +341,6 @@ public: The kind of button to add. @param help_string The UI help string to associate with the new button. - @param client_data - Client data to associate with the new button. @return An opaque pointer which can be used only with other button bar methods. @@ -367,8 +361,7 @@ public: const wxBitmap& bitmap_disabled = wxNullBitmap, const wxBitmap& bitmap_small_disabled = wxNullBitmap, wxRibbonButtonKind kind = wxRIBBON_BUTTON_NORMAL, - const wxString& help_string = wxEmptyString, - wxObject* client_data = NULL); + const wxString& help_string = wxEmptyString); /** Returns the number of buttons in this button bar. @@ -377,6 +370,37 @@ public: */ virtual size_t GetButtonCount() const; + /** + Set the client object associated with a button. The button bar + owns the given object and takes care of its deletion. + Please, note that you cannot use both client object and client data. + + @since 2.9.5 + */ + void SetItemClientObject(wxRibbonButtonBarButtonBase* item, wxClientData* data); + + /** + Get the client object associated with a button. + + @since 2.9.5 + */ + wxClientData* GetItemClientObject(const wxRibbonButtonBarButtonBase* item) const; + + /** + Set the client data associated with a button. + Please, note that you cannot use both client object and client data. + + @since 2.9.5 + */ + void SetItemClientData(wxRibbonButtonBarButtonBase* item, void* data); + + /** + Get the client data associated with a button. + + @since 2.9.5 + */ + void* GetItemClientData(const wxRibbonButtonBarButtonBase* item) const; + /** Returns the N-th button of the bar. @@ -460,6 +484,25 @@ public: */ virtual wxRibbonButtonBarButtonBase *GetHoveredItem() const; + /** + Indicates whether tooltips are shown for disabled buttons. + + By default they are not shown. + + @since 2.9.5 + */ + void SetShowToolTipsForDisabled(bool show); + + /** + Sets whether tooltips should be shown for disabled buttons or not. + + You may wish to show it to explain why a button is disabled or + what it normally does when enabled. + + @since 2.9.5 + */ + bool GetShowToolTipsForDisabled() const; + }; /** @@ -484,7 +527,8 @@ public: */ wxRibbonButtonBarEvent(wxEventType command_type = wxEVT_NULL, int win_id = 0, - wxRibbonButtonBar* bar = NULL); + wxRibbonButtonBar* bar = NULL, + wxRibbonButtonBarButtonBase* button = NULL); /** Returns the bar which contains the button which the event relates to. @@ -496,6 +540,20 @@ public: */ void SetBar(wxRibbonButtonBar* bar); + /** + Returns the button which the event relates to. + + @since 2.9.5 + */ + wxRibbonButtonBarButtonBase* GetButton(); + + /** + Sets the button relating to this event. + + @since 2.9.5 + */ + void SetButton(wxRibbonButtonBarButtonBase* bar); + /** Display a popup menu as a result of this (dropdown clicked) event. */