X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c039d08bfbb59c0abcbc705fb49f9b2cb321edf..2233e5b82c14c529f97b3fd0cba99908de2d5d0c:/utils/wxPython/src/controls.i diff --git a/utils/wxPython/src/controls.i b/utils/wxPython/src/controls.i index 5b49c393b3..6ba5feae4b 100644 --- a/utils/wxPython/src/controls.i +++ b/utils/wxPython/src/controls.i @@ -15,13 +15,18 @@ %{ #include "helpers.h" #include +#include +#include #ifdef __WXMSW__ -#include #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