X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6aaca5bac6f3ad13add44c220163fda423c40351..846b11857e328bd01ae377e419107d2ff08339f3:/wxPython/src/_control.i diff --git a/wxPython/src/_control.i b/wxPython/src/_control.i index adf3b06174..94b33f048a 100644 --- a/wxPython/src/_control.i +++ b/wxPython/src/_control.i @@ -72,11 +72,6 @@ __init__ as a plain old wx.Control is not very useful.", ""); "Get the control alignment (left/right/centre, top/bottom/centre)", ""); - DocDeclStr( - static wxString , GetLabelText(const wxString& label), - "Get the string without mnemonic characters ('&')", ""); - - DocDeclStr( wxString , GetLabelText() const, "Get just the text of the label, without mnemonic characters ('&')", ""); @@ -90,14 +85,6 @@ __init__ as a plain old wx.Control is not very useful.", ""); :see: `wx.CommandEvent` ", ""); - DocDeclStr( - wxString , GetLabel(), - "Return a control's text.", ""); - - DocDeclStr( - void , SetLabel(const wxString& label), - "Sets the item's text.", ""); - // DocDeclStr( // bool , GetAdjustMinSizeFlag(), @@ -115,6 +102,10 @@ __init__ as a plain old wx.Control is not very useful.", ""); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(Alignment, GetAlignment, doc="See `GetAlignment`"); + %property(LabelText, GetLabelText, doc="See `GetLabelText`"); + }; @@ -272,6 +263,23 @@ is selected.", ""); slightly more natural for controls which support multiple selection.", ""); + %pythoncode { + def GetItems(self): + """Return a list of the strings in the control""" + return [self.GetString(i) for i in xrange(self.GetCount())] + + def SetItems(self, items): + """Clear and set the strings in the control from a list""" + self.Clear() + for i in items: + self.Append(i) + } + + %property(Count, GetCount, doc="See `GetCount`"); + %property(Items, GetItems, SetItems, doc="See `GetItems` and `SetItems`"); + %property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`"); + %property(StringSelection, GetStringSelection, SetStringSelection, doc="See `GetStringSelection` and `SetStringSelection`"); + %property(Strings, GetStrings, doc="See `GetStrings`"); };