]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_accel.i
Better conversion functions for integral and floating point types,
[wxWidgets.git] / wxPython / src / _accel.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _accel.i
3 // Purpose: SWIG interface for wxAcceleratorTable
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 03-July-1997
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17
18 %typemap(in) (int n, const wxAcceleratorEntry* entries) {
19 $2 = wxAcceleratorEntry_LIST_helper($input);
20 if ($2) $1 = PyList_Size($input);
21 else $1 = 0;
22 }
23
24 %typemap(freearg) wxAcceleratorEntry* entries {
25 delete [] $1;
26 }
27
28
29
30 //---------------------------------------------------------------------------
31 %newgroup;
32
33
34 class wxAcceleratorEntry {
35 public:
36 wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0, wxMenuItem *item = NULL);
37 ~wxAcceleratorEntry();
38
39 void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL);
40
41 void SetMenuItem(wxMenuItem *item);
42 wxMenuItem *GetMenuItem() const;
43
44 int GetFlags();
45 int GetKeyCode();
46 int GetCommand();
47 };
48
49
50 class wxAcceleratorTable : public wxObject {
51 public:
52 DocAStr(wxAcceleratorTable,
53 "__init__(entries) -> AcceleratorTable",
54 "Construct an AcceleratorTable from a list of AcceleratorEntry items or\n"
55 "3-tuples (flags, keyCode, cmdID)");
56 wxAcceleratorTable(int n, const wxAcceleratorEntry* entries);
57 ~wxAcceleratorTable();
58
59 bool Ok() const;
60 };
61
62
63 %immutable;
64 // See also wxPy_ReinitStockObjects in helpers.cpp
65 const wxAcceleratorTable wxNullAcceleratorTable;
66 %mutable;
67
68
69 wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
70
71 //---------------------------------------------------------------------------