X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b21126db7a8232fa9e64b29f916d73d6b0153bef..66f2aa61c3c7bc326f3287739eded70ca61f775d:/interface/wx/stockitem.h diff --git a/interface/wx/stockitem.h b/interface/wx/stockitem.h index dcf7683286..fc0596d0c7 100644 --- a/interface/wx/stockitem.h +++ b/interface/wx/stockitem.h @@ -3,9 +3,68 @@ // Purpose: interface of global functions // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/** + Possible values for flags parameter of wxGetStockLabel(). + + The elements of this enum are bit masks and may be combined with each other + (except when specified otherwise). + */ +enum wxStockLabelQueryFlag +{ + /** + Indicates absence of wxSTOCK_WITH_MNEMONIC and wxSTOCK_WITH_ACCELERATOR. + + Requests just the label (e.g. "Print..."). + */ + wxSTOCK_NOFLAGS = 0, + + /** + Request the label with mnemonics character. + + E.g. "&Print...". + */ + wxSTOCK_WITH_MNEMONIC = 1, + + /** + Return the label with accelerator following it after TAB. + + E.g. "Print...\tCtrl-P". This can be combined with + wxSTOCK_WITH_MNEMONIC to get "&Print...\tCtrl-P". + */ + wxSTOCK_WITH_ACCELERATOR = 2, + + /** + Return the label without any ellipsis at the end. + + By default, stock items text is returned with ellipsis, if appropriate, + this flag allows to avoid having it. So using the same example as + above, the returned string would be "Print" or "&Print" if + wxSTOCK_WITH_MNEMONIC were also used. + + This flag can't be combined with wxSTOCK_WITH_ACCELERATOR. + + @since 2.9.1 + */ + wxSTOCK_WITHOUT_ELLIPSIS = 4, + + /** + Return the label appropriate for a button and not a menu item. + + Currently the main difference is that the trailing ellipsis used in + some stock labels is never included in the returned label. Also, the + mnemonics is included if this flag is used. So the returned value for + wxID_PRINT when this flag is used is "&Print". + + This flag can't be combined with wxSTOCK_WITH_ACCELERATOR. + + @since 2.9.1 + */ + wxSTOCK_FOR_BUTTON = wxSTOCK_WITHOUT_ELLIPSIS | wxSTOCK_WITH_MNEMONIC +}; + /** @addtogroup group_funcmacro_misc */ //@{ @@ -14,18 +73,12 @@ @param id Given id of the wxMenuItem, wxButton, wxToolBar tool, etc. - @param withCodes - If @false then strip accelerator code from the label; useful for - getting labels without accelerator char code like for toolbar tooltip - or on platforms without traditional keyboard like smartphones. - @param accelerator - Optional accelerator string automatically added to label; useful for - building labels for wxMenuItem. + @param flags + Combination of the elements of wxStockLabelQueryFlag. @header{wx/stockitem.h} */ -wxString wxGetStockLabel(wxWindowID id, bool withCodes = true, - const wxString& accelerator = wxEmptyString); +wxString wxGetStockLabel(wxWindowID id, long flags = wxSTOCK_WITH_MNEMONIC); //@}