1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wxAcceleratorTable
7 // Created: 03-July-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
18 %typemap(in) (int n, const wxAcceleratorEntry* entries) {
19 $2 = wxAcceleratorEntry_LIST_helper($input);
20 if ($2) $1 = PyList_Size($input);
24 %typemap(freearg) wxAcceleratorEntry* entries {
30 //---------------------------------------------------------------------------
41 DocStr(wxAcceleratorEntry,
42 "A class used to define items in an `wx.AcceleratorTable`. wxPython
43 programs can choose to use wx.AcceleratorEntry objects, but using a
44 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
45 as well. See `__init__` for details of the tuple values.
47 :see: `wx.AcceleratorTable`", "");
49 class wxAcceleratorEntry {
52 wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmdID = 0/*, wxMenuItem *menuitem = NULL*/),
53 "Construct a wx.AcceleratorEntry.",
55 :param flags: A bitmask of wx.ACCEL_ALT, wx.ACCEL_SHIFT,
56 wx.ACCEL_CTRL, wx.ACCEL_CMD, or wx.ACCEL_NORMAL
57 used to specify which modifier keys are held down.
58 :param keyCode: The keycode to be detected
59 :param cmdID: The menu or control command ID to use for the
62 ~wxAcceleratorEntry();
65 void , Set(int flags, int keyCode, int cmd/*, wxMenuItem *menuItem = NULL*/),
66 "(Re)set the attributes of a wx.AcceleratorEntry.
67 :see `__init__`", "");
70 // void SetMenuItem(wxMenuItem *item);
71 // wxMenuItem *GetMenuItem() const;
75 "Get the AcceleratorEntry's flags.", "");
79 "Get the AcceleratorEntry's keycode.", "");
83 "Get the AcceleratorEntry's command ID.", "");
85 %property(Command, GetCommand, doc="See `GetCommand`");
86 %property(Flags, GetFlags, doc="See `GetFlags`");
87 %property(KeyCode, GetKeyCode, doc="See `GetKeyCode`");
95 DocStr(wxAcceleratorTable,
96 "An accelerator table allows the application to specify a table of
97 keyboard shortcuts for menus or other commands. On Windows, menu or
98 button commands are supported; on GTK, only menu commands are
101 The object ``wx.NullAcceleratorTable`` is defined to be a table with
102 no data, and is the initial accelerator table for a window.
104 An accelerator takes precedence over normal processing and can be a
105 convenient way to program some event handling. For example, you can
106 use an accelerator table to make a hotkey generate an event no matter
107 which window within a frame has the focus.
111 aTable = wx.AcceleratorTable([(wx.ACCEL_ALT, ord('X'), exitID),
112 (wx.ACCEL_CTRL, ord('H'), helpID),
113 (wx.ACCEL_CTRL, ord('F'), findID),
114 (wx.ACCEL_NORMAL, wx.WXK_F3, findnextID)
116 self.SetAcceleratorTable(aTable)
119 :see: `wx.AcceleratorEntry`, `wx.Window.SetAcceleratorTable`
122 class wxAcceleratorTable : public wxObject {
124 DocAStr(wxAcceleratorTable,
125 "__init__(entries) -> AcceleratorTable",
126 "Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
127 items or or of 3-tuples (flags, keyCode, cmdID)
129 :see: `wx.AcceleratorEntry`", "");
130 wxAcceleratorTable(int n, const wxAcceleratorEntry* entries);
131 ~wxAcceleratorTable();
139 const wxAcceleratorTable wxNullAcceleratorTable;
143 wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
145 //---------------------------------------------------------------------------