X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62bd087498a21a9e49723bd85c8d8a2ab71c4c35..d9f39e09e82e99c422619f4e3df536d0a9e87987:/utils/wxPython/src/controls.i?ds=inline diff --git a/utils/wxPython/src/controls.i b/utils/wxPython/src/controls.i index 27401be2c6..605a9d697c 100644 --- a/utils/wxPython/src/controls.i +++ b/utils/wxPython/src/controls.i @@ -16,12 +16,17 @@ #include "helpers.h" #include #include +#include #ifdef __WXMSW__ #if wxUSE_OWNER_DRAWN #include #endif #endif + +#ifdef __WXGTK__ +#include +#endif %} //---------------------------------------------------------------------- @@ -36,7 +41,7 @@ %import gdi.i %import events.i -%pragma(python) code = "import wxp" +%pragma(python) code = "import wx" //---------------------------------------------------------------------- @@ -64,7 +69,7 @@ public: const wxValidator& validator = wxPyDefaultValidator, char* name = "button"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" void SetDefault(); }; @@ -80,17 +85,15 @@ public: const wxValidator& validator = wxPyDefaultValidator, char* name = "button"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" wxBitmap& GetBitmapLabel(); -#ifdef __WXMSW__ wxBitmap& GetBitmapDisabled(); wxBitmap& GetBitmapFocus(); wxBitmap& GetBitmapSelected(); void SetBitmapDisabled(const wxBitmap& bitmap); void SetBitmapFocus(const wxBitmap& bitmap); void SetBitmapSelected(const wxBitmap& bitmap); -#endif void SetBitmapLabel(const wxBitmap& bitmap); }; @@ -106,7 +109,7 @@ public: const wxValidator& val = wxPyDefaultValidator, char* name = "checkBox"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" bool GetValue(); void SetValue(const bool state); @@ -124,7 +127,7 @@ public: const wxValidator& validator = wxPyDefaultValidator, char* name = "choice"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" void Append(const wxString& item); void Clear(); @@ -151,7 +154,7 @@ public: const wxValidator& validator = wxPyDefaultValidator, char* name = "comboBox"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" void Append(const wxString& item); // TODO: void Append(const wxString& item, char* clientData); @@ -191,7 +194,7 @@ public: const wxValidator& validator = wxPyDefaultValidator, char* name = "gauge"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" int GetBezelFace(); int GetRange(); @@ -225,7 +228,7 @@ public: long style = 0, char* name = "staticText"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" wxString GetLabel(); void SetLabel(const wxString& label); @@ -243,7 +246,7 @@ public: const wxValidator& validator = wxPyDefaultValidator, char* name = "listBox"); - %pragma(python) addtomethod = "__init__:wxp._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" void Append(const wxString& item); // TODO: void Append(const wxString& item, char* clientData); @@ -253,7 +256,20 @@ public: int FindString(const wxString& string); // TODO: char* GetClientData(const int n); int GetSelection(); - // TODO: int GetSelections(int **selections); + + // int GetSelections(int **selections); + %addmethods { + PyObject* GetSelections() { + wxArrayInt lst; + self->GetSelections(lst); + PyObject *tup = PyTuple_New(lst.GetCount()); + for(int i=0; i