1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/stockitem.h
3 // Purpose: stock items helpers (privateh header)
4 // Author: Vaclav Slavik
7 // Copyright: (c) Vaclav Slavik, 2004
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_STOCKITEM_H_
12 #define _WX_STOCKITEM_H_
15 #include "wx/chartype.h"
16 #include "wx/string.h"
19 // ----------------------------------------------------------------------------
20 // Helper functions for stock items handling:
21 // ----------------------------------------------------------------------------
23 // Returns true if the ID is in the list of recognized stock actions
24 WXDLLIMPEXP_CORE
bool wxIsStockID(wxWindowID id
);
26 // Returns true of the label is empty or label of a stock button with
28 WXDLLIMPEXP_CORE
bool wxIsStockLabel(wxWindowID id
, const wxString
& label
);
30 enum wxStockLabelQueryFlag
34 wxSTOCK_WITH_MNEMONIC
= 1,
35 wxSTOCK_WITH_ACCELERATOR
= 2,
37 // by default, stock items text is returned with ellipsis, if appropriate,
38 // this flag allows to avoid having it
39 wxSTOCK_WITHOUT_ELLIPSIS
= 4,
41 // return label for button, not menu item: buttons should always use
42 // mnemonics and never use ellipsis
43 wxSTOCK_FOR_BUTTON
= wxSTOCK_WITHOUT_ELLIPSIS
| wxSTOCK_WITH_MNEMONIC
46 // Returns label that should be used for given stock UI element (e.g. "&OK"
47 // for wxSTOCK_OK); if wxSTOCK_WITH_MNEMONIC is given, the & character
48 // is included; if wxSTOCK_WITH_ACCELERATOR is given, the stock accelerator
49 // for given ID is concatenated to the label using \t as separator
50 WXDLLIMPEXP_CORE wxString
wxGetStockLabel(wxWindowID id
,
51 long flags
= wxSTOCK_WITH_MNEMONIC
);
55 // Returns the accelerator that should be used for given stock UI element
56 // (e.g. "Ctrl+x" for wxSTOCK_EXIT)
57 WXDLLIMPEXP_CORE wxAcceleratorEntry
wxGetStockAccelerator(wxWindowID id
);
61 // wxStockHelpStringClient conceptually works like wxArtClient: it gives a hint to
62 // wxGetStockHelpString() about the context where the help string is to be used
63 enum wxStockHelpStringClient
65 wxSTOCK_MENU
// help string to use for menu items
68 // Returns an help string for the given stock UI element and for the given "context".
69 WXDLLIMPEXP_CORE wxString
wxGetStockHelpString(wxWindowID id
,
70 wxStockHelpStringClient client
= wxSTOCK_MENU
);
75 // Translates stock ID to GTK+'s stock item string identifier:
76 WXDLLIMPEXP_CORE
const char *wxGetStockGtkID(wxWindowID id
);
80 #endif // _WX_STOCKITEM_H_