X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c95e68d8c78acef24dbb9f4b638efed1548ba9b8..3017f78d673acd86b210bd8d3747d45bb46d5fcd:/utils/wxPython/src/controls.i?ds=sidebyside diff --git a/utils/wxPython/src/controls.i b/utils/wxPython/src/controls.i index cb77a94f30..dbdce2edec 100644 --- a/utils/wxPython/src/controls.i +++ b/utils/wxPython/src/controls.i @@ -16,6 +16,8 @@ #include "helpers.h" #include #include +#include +#include #ifdef __WXMSW__ #if wxUSE_OWNER_DRAWN @@ -26,6 +28,7 @@ #ifdef __WXGTK__ #include #endif + %} //---------------------------------------------------------------------- @@ -48,11 +51,17 @@ wxValidator wxPyDefaultValidator; // Non-const default because of SWIG %} +%readonly +wxValidator wxDefaultValidator; +%readwrite + //---------------------------------------------------------------------- class wxControl : public wxWindow { public: +#ifdef __WXMSW__ void Command(wxCommandEvent& event); +#endif wxString GetLabel(); void SetLabel(const wxString& label); }; @@ -143,7 +152,7 @@ public: //---------------------------------------------------------------------- -class wxComboBox : public wxControl { +class wxComboBox : public wxChoice { public: wxComboBox(wxWindow* parent, wxWindowID id, char* value = "", const wxPoint& pos = wxPyDefaultPosition, @@ -177,7 +186,7 @@ public: // TODO: void SetClientData(const int n, char* data); void SetInsertionPoint(long pos); void SetInsertionPointEnd(); - void SetSelection(int n, bool select = TRUE); + void SetSelection(int n); %name(SetMark)void SetSelection(long from, long to); void SetValue(const wxString& text); }; @@ -217,6 +226,19 @@ public: }; +//---------------------------------------------------------------------- + + +class wxStaticLine : public wxControl { +public: + wxStaticLine( wxWindow *parent, wxWindowID id, + const wxPoint &pos = wxPyDefaultPosition, + const wxSize &size = wxPyDefaultSize, + long style = wxLI_HORIZONTAL, + const char* name = "staticLine" ); +}; + + //---------------------------------------------------------------------- class wxStaticText : public wxControl { @@ -255,7 +277,22 @@ 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