X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6fd73d33ac80632981dee1c0be669f20ba765b5..86ac84b8ce086e6bbda58f422d41f84268606e35:/include/wx/button.h diff --git a/include/wx/button.h b/include/wx/button.h index 53b164bbba..dfcf6610da 100644 --- a/include/wx/button.h +++ b/include/wx/button.h @@ -43,6 +43,13 @@ // small as possible #define wxBU_EXACTFIT 0x0001 +// this flag can be used to disable using the text label in the button: it is +// mostly useful when creating buttons showing bitmap and having stock id as +// without it both the standard label corresponding to the stock id and the +// bitmap would be shown +#define wxBU_NOTEXT 0x0002 + + #include "wx/bitmap.h" #include "wx/control.h" @@ -146,6 +153,19 @@ public: State_Max }; + // return true if this button shouldn't show the text label, either because + // it doesn't have it or because it was explicitly disabled with wxBU_NOTEXT + bool DontShowLabel() const + { + return HasFlag(wxBU_NOTEXT) || GetLabel().empty(); + } + + // return true if we do show the label + bool ShowsLabel() const + { + return !DontShowLabel(); + } + protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }