1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/stockitem.h
3 // Purpose: stock items helpers (privateh header)
4 // Author: Vaclav Slavik
8 // Copyright: (c) Vaclav Slavik, 2004
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_STOCKITEM_H_
13 #define _WX_STOCKITEM_H_
16 #include "wx/wxchar.h"
17 #include "wx/string.h"
20 // ----------------------------------------------------------------------------
21 // Helper functions for stock items handling:
22 // ----------------------------------------------------------------------------
24 // Returns true if the ID is in the list of recognized stock actions
25 WXDLLEXPORT
bool wxIsStockID(wxWindowID id
);
27 // Returns true of the label is empty or label of a stock button with
29 WXDLLEXPORT
bool wxIsStockLabel(wxWindowID id
, const wxString
& label
);
31 enum wxStockLabelQueryFlag
35 wxSTOCK_WITH_MNEMONIC
= 1,
36 wxSTOCK_WITH_ACCELERATOR
= 2
39 // Returns label that should be used for given stock UI element (e.g. "&OK"
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
43 WXDLLEXPORT wxString
wxGetStockLabel(wxWindowID id
,
44 long flags
= wxSTOCK_WITH_MNEMONIC
);
48 // Returns the accelerator that should be used for given stock UI element
49 // (e.g. "Ctrl+x" for wxSTOCK_EXIT)
50 WXDLLEXPORT wxAcceleratorEntry
wxGetStockAccelerator(wxWindowID id
);
56 #include <gdk/gdktypes.h>
58 // Translates stock ID to GTK+'s stock item string indentifier:
59 WXDLLEXPORT
const char *wxGetStockGtkID(wxWindowID id
);
61 // Returns stock accelerator modifier and key code for the given ID
62 WXDLLEXPORT
bool wxGetStockGtkAccelerator(const char *id
, GdkModifierType
*mod
, guint
*key
);
65 #endif // _WX_STOCKITEM_H_