X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/137b5242b1834999da2883c7a68fbde28c6fba37..55f9f0cbc8dcf45f8d484b2f931c5c254d4404d1:/wxPython/src/controls.i diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index bb8a78bfff..c3f57ddb65 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -92,12 +92,12 @@ public: // wxControl(wxWindow *parent, - wxWindowID id, - const wxPoint& pos=wxDefaultPosition, - const wxSize& size=wxDefaultSize, - long style=0, - const wxValidator& validator=wxDefaultValidator, - const wxString& name=wxPyControlNameStr); + wxWindowID id, + const wxPoint& pos=wxDefaultPosition, + const wxSize& size=wxDefaultSize, + long style=0, + const wxValidator& validator=wxDefaultValidator, + const wxString& name=wxPyControlNameStr); // %name(wxPreControl)wxControl(); @@ -338,6 +338,7 @@ public: %pragma(python) addtomethod = "wxPreCheckBox:val._setOORInfo(val)" bool GetValue(); + bool IsChecked(); void SetValue(const bool state); }; @@ -709,6 +710,11 @@ public: #ifndef __WXMAC__ int GetItemHeight(); #endif + + // return the index of the item at this position or wxNOT_FOUND + int HitTest(const wxPoint& pt) const; + %name(HitTestXY)int HitTest(wxCoord x, wxCoord y) const; + }; //---------------------------------------------------------------------- @@ -809,6 +815,10 @@ public: void WriteText(const wxString& text); void AppendText(const wxString& text); + // insert the character which would have resulted from this key event, + // return TRUE if anything has been inserted + bool EmulateKeyPress(const wxKeyEvent& event); + // text control under some platforms supports the text styles: these // methods allow to apply the given text style to the given selection or to // set/get the style which will be used for all appended text @@ -853,6 +863,10 @@ public: void SelectAll(); void SetEditable(bool editable); + bool IsSingleLine(); + bool IsMultiLine(); + + %addmethods { void write(const wxString& text) { self->AppendText(text); @@ -862,7 +876,7 @@ public: // TODO: replace this when the method is really added to wxTextCtrl %addmethods { wxString GetString(long from, long to) { - return self->GetValue().Mid(from, to-from); + return self->GetValue().Mid(from, to - from); } } }; @@ -990,18 +1004,15 @@ public: int FindString(const wxString& string); wxString GetString(int n); - -#ifdef __WXGTK__ - %name(GetItemLabel)wxString GetLabel( int item ); - %name(SetItemLabel)void SetLabel( int item, const wxString& label ); -#else void SetString(int n, const wxString& label); %pragma(python) addtoclass = " GetItemLabel = GetString SetItemLabel = SetString " +#ifndef __WXGTK__ int GetColumnCount(); int GetRowCount(); + int GetNextItem(int item, wxDirection dir, long style); #endif int GetSelection();