X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1cc14cea1c985b5e0ed274a925577aa63a91ddfb..f6342fb5e6524edffa219d5843536ea279bba4df:/wxPython/src/_accel.i?ds=inline diff --git a/wxPython/src/_accel.i b/wxPython/src/_accel.i index f9b6c2f12a..cc20204c42 100644 --- a/wxPython/src/_accel.i +++ b/wxPython/src/_accel.i @@ -70,6 +70,12 @@ public: // void SetMenuItem(wxMenuItem *item); // wxMenuItem *GetMenuItem() const; + %newobject Create; + DocDeclStr( + static wxAcceleratorEntry *, Create(const wxString& str), + "Create accelerator corresponding to the specified string, or None if +it coulnd't be parsed.", ""); + DocDeclStr( int , GetFlags(), "Get the AcceleratorEntry's flags.", ""); @@ -81,6 +87,29 @@ public: DocDeclStr( int , GetCommand(), "Get the AcceleratorEntry's command ID.", ""); + + DocDeclStr( + bool , IsOk() const, + "", ""); + + + DocDeclStr( + wxString , ToString() const, + "Returns a string representation for the this accelerator. The string +is formatted using the - format where maybe a +hyphen-separed list of \"shift|alt|ctrl\" +", ""); + + + DocDeclStr( + bool , FromString(const wxString &str), + "Returns true if the given string correctly initialized this object.", ""); + + + %property(Command, GetCommand, doc="See `GetCommand`"); + %property(Flags, GetFlags, doc="See `GetFlags`"); + %property(KeyCode, GetKeyCode, doc="See `GetKeyCode`"); + }; @@ -125,7 +154,8 @@ items or or of 3-tuples (flags, keyCode, cmdID) wxAcceleratorTable(int n, const wxAcceleratorEntry* entries); ~wxAcceleratorTable(); - bool Ok() const; + bool IsOk() const; + %pythoncode { Ok = IsOk } }; @@ -135,6 +165,11 @@ const wxAcceleratorTable wxNullAcceleratorTable; %mutable; -wxAcceleratorEntry *wxGetAccelFromString(const wxString& label); +%pythoncode { + def GetAccelFromString(label): + entry = AcceleratorEntry() + entry.FromString(label) + return entry +} //---------------------------------------------------------------------------