]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: stockitem.h | |
3 | // Purpose: interface of global functions | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | Possible values for flags parameter of wxGetStockLabel(). | |
11 | ||
12 | The elements of this enum are bit masks and may be combined with each other | |
13 | (except when specified otherwise). | |
14 | */ | |
15 | enum wxStockLabelQueryFlag | |
16 | { | |
17 | /** | |
18 | Indicates absence of wxSTOCK_WITH_MNEMONIC and wxSTOCK_WITH_ACCELERATOR. | |
19 | ||
20 | Requests just the label (e.g. "Print..."). | |
21 | */ | |
22 | wxSTOCK_NOFLAGS = 0, | |
23 | ||
24 | /** | |
25 | Request the label with mnemonics character. | |
26 | ||
27 | E.g. "&Print...". | |
28 | */ | |
29 | wxSTOCK_WITH_MNEMONIC = 1, | |
30 | ||
31 | /** | |
32 | Return the label with accelerator following it after TAB. | |
33 | ||
34 | E.g. "Print...\tCtrl-P". This can be combined with | |
35 | wxSTOCK_WITH_MNEMONIC to get "&Print...\tCtrl-P". | |
36 | */ | |
37 | wxSTOCK_WITH_ACCELERATOR = 2, | |
38 | ||
39 | /** | |
40 | Return the label without any ellipsis at the end. | |
41 | ||
42 | By default, stock items text is returned with ellipsis, if appropriate, | |
43 | this flag allows to avoid having it. So using the same example as | |
44 | above, the returned string would be "Print" or "&Print" if | |
45 | wxSTOCK_WITH_MNEMONIC were also used. | |
46 | ||
47 | This flag can't be combined with wxSTOCK_WITH_ACCELERATOR. | |
48 | ||
49 | @since 2.9.1 | |
50 | */ | |
51 | wxSTOCK_WITHOUT_ELLIPSIS = 4, | |
52 | ||
53 | /** | |
54 | Return the label appropriate for a button and not a menu item. | |
55 | ||
56 | Currently the main difference is that the trailing ellipsis used in | |
57 | some stock labels is never included in the returned label. Also, the | |
58 | mnemonics is included if this flag is used. So the returned value for | |
59 | wxID_PRINT when this flag is used is "&Print". | |
60 | ||
61 | This flag can't be combined with wxSTOCK_WITH_ACCELERATOR. | |
62 | ||
63 | @since 2.9.1 | |
64 | */ | |
65 | wxSTOCK_FOR_BUTTON = wxSTOCK_WITHOUT_ELLIPSIS | wxSTOCK_WITH_MNEMONIC | |
66 | }; | |
67 | ||
68 | /** @addtogroup group_funcmacro_misc */ | |
69 | //@{ | |
70 | ||
71 | /** | |
72 | Returns label that should be used for given @a id element. | |
73 | ||
74 | @param id | |
75 | Given id of the wxMenuItem, wxButton, wxToolBar tool, etc. | |
76 | @param flags | |
77 | Combination of the elements of wxStockLabelQueryFlag. | |
78 | ||
79 | @header{wx/stockitem.h} | |
80 | */ | |
81 | wxString wxGetStockLabel(wxWindowID id, long flags = wxSTOCK_WITH_MNEMONIC); | |
82 | ||
83 | //@} | |
84 |