]>
Commit | Line | Data |
---|---|---|
401e3b6e VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/stockitem.h | |
5f7bcb48 | 3 | // Purpose: stock items helpers (privateh header) |
401e3b6e VS |
4 | // Author: Vaclav Slavik |
5 | // Modified by: | |
6 | // Created: 2004-08-15 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Vaclav Slavik, 2004 | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_STOCKITEM_H_ | |
13 | #define _WX_STOCKITEM_H_ | |
14 | ||
401e3b6e | 15 | #include "wx/defs.h" |
634629fa | 16 | #include "wx/wxchar.h" |
401e3b6e | 17 | #include "wx/string.h" |
ee0a94cf | 18 | #include "wx/accel.h" |
401e3b6e VS |
19 | |
20 | // ---------------------------------------------------------------------------- | |
5f7bcb48 | 21 | // Helper functions for stock items handling: |
401e3b6e VS |
22 | // ---------------------------------------------------------------------------- |
23 | ||
5f7bcb48 | 24 | // Returns true if the ID is in the list of recognized stock actions |
abdd2c01 | 25 | WXDLLEXPORT bool wxIsStockID(wxWindowID id); |
401e3b6e | 26 | |
5f7bcb48 VS |
27 | // Returns true of the label is empty or label of a stock button with |
28 | // given ID | |
abdd2c01 | 29 | WXDLLEXPORT bool wxIsStockLabel(wxWindowID id, const wxString& label); |
401e3b6e | 30 | |
ee0a94cf RR |
31 | enum wxStockLabelQueryFlag |
32 | { | |
33 | wxSTOCK_NOFLAGS = 0, | |
34 | ||
35 | wxSTOCK_WITH_MNEMONIC = 1, | |
36 | wxSTOCK_WITH_ACCELERATOR = 2 | |
37 | }; | |
38 | ||
401e3b6e | 39 | // Returns label that should be used for given stock UI element (e.g. "&OK" |
ee0a94cf RR |
40 | // for wxSTOCK_OK); if wxSTOCK_WITH_MNEMONIC is given, the & character |
41 | // is included; if wxSTOCK_WITH_ACCELERATOR is given, the stock accelerator | |
42 | // for given ID is concatenated to the label using \t as separator | |
634629fa | 43 | WXDLLEXPORT wxString wxGetStockLabel(wxWindowID id, |
ee0a94cf RR |
44 | long flags = wxSTOCK_WITH_MNEMONIC); |
45 | ||
46 | // Returns the accelerator that should be used for given stock UI element | |
47 | // (e.g. "Ctrl+x" for wxSTOCK_EXIT) | |
48 | WXDLLEXPORT wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id); | |
401e3b6e VS |
49 | |
50 | #ifdef __WXGTK20__ | |
ee0a94cf RR |
51 | |
52 | #include <gdk/gdktypes.h> | |
53 | ||
401e3b6e | 54 | // Translates stock ID to GTK+'s stock item string indentifier: |
abdd2c01 | 55 | WXDLLEXPORT const char *wxGetStockGtkID(wxWindowID id); |
ee0a94cf RR |
56 | |
57 | // Returns stock accelerator modifier and key code for the given ID | |
58 | WXDLLEXPORT bool wxGetStockGtkAccelerator(const char *id, GdkModifierType *mod, guint *key); | |
401e3b6e VS |
59 | #endif |
60 | ||
61 | #endif // _WX_STOCKITEM_H_ |