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 //---------------------------------------------------------------------------
 
  33 DocStr(wxAcceleratorEntry,
 
  34 "A class used to define items in an `wx.AcceleratorTable`.  wxPython
 
  35 programs can choose to use wx.AcceleratorEntry objects, but using a
 
  36 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
 
  37 as well.  See `__init__` for details of the tuple values.
 
  39 :see: `wx.AcceleratorTable`", "");
 
  41 class wxAcceleratorEntry {
 
  44         wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmdID = 0/*, wxMenuItem *menuitem = NULL*/),
 
  45         "Construct a wx.AcceleratorEntry.",
 
  47     :param flags: A bitmask of wx.ACCEL_ALT, wx.ACCEL_SHIFT,
 
  48                 wx.ACCEL_CTRL or wx.ACCEL_NORMAL used to specify
 
  49                 which modifier keys are held down.
 
  50     :param keyCode: The keycode to be detected
 
  51     :param cmdID: The menu or control command ID to use for the
 
  54     ~wxAcceleratorEntry();
 
  57         void , Set(int flags, int keyCode, int cmd/*, wxMenuItem *menuItem = NULL*/),
 
  58         "(Re)set the attributes of a wx.AcceleratorEntry.
 
  59 :see `__init__`", "");
 
  62 //     void SetMenuItem(wxMenuItem *item);
 
  63 //     wxMenuItem *GetMenuItem() const;
 
  67         "Get the AcceleratorEntry's flags.", "");
 
  71         "Get the AcceleratorEntry's keycode.", "");
 
  75         "Get the AcceleratorEntry's command ID.", "");
 
  82 DocStr(wxAcceleratorTable,
 
  83 "An accelerator table allows the application to specify a table of
 
  84 keyboard shortcuts for menus or other commands. On Windows, menu or
 
  85 button commands are supported; on GTK, only menu commands are
 
  88 The object ``wx.NullAcceleratorTable`` is defined to be a table with
 
  89 no data, and is the initial accelerator table for a window.
 
  91 An accelerator takes precedence over normal processing and can be a
 
  92 convenient way to program some event handling. For example, you can
 
  93 use an accelerator table to make a hotkey generate an event no matter
 
  94 which window within a frame has the focus.
 
  98     aTable = wx.AcceleratorTable([(wx.ACCEL_ALT,  ord('X'), exitID),
 
  99                                   (wx.ACCEL_CTRL, ord('H'), helpID),
 
 100                                   (wx.ACCEL_CTRL, ord('F'), findID),
 
 101                                   (wx.ACCEL_NORMAL, wx.WXK_F3, findnextID)
 
 103     self.SetAcceleratorTable(aTable)
 
 106 :see: `wx.AcceleratorEntry`, `wx.Window.SetAcceleratorTable`
 
 109 class wxAcceleratorTable : public wxObject {
 
 111     DocAStr(wxAcceleratorTable,
 
 112             "__init__(entries) -> AcceleratorTable",
 
 113             "Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
 
 114 items or or of 3-tuples (flags, keyCode, cmdID)
 
 116 :see: `wx.AcceleratorEntry`", "");
 
 117     wxAcceleratorTable(int n, const wxAcceleratorEntry* entries);
 
 118     ~wxAcceleratorTable();
 
 126 // See also wxPy_ReinitStockObjects in helpers.cpp
 
 127 const wxAcceleratorTable wxNullAcceleratorTable;
 
 131 wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
 
 133 //---------------------------------------------------------------------------