+
+
+
+ DocDeclStr(
+ virtual /*unsigned*/ int , GetCount() const,
+ "Returns the number of items in the control.", "");
+
+ DocDeclStr(
+ bool , IsEmpty() const,
+ "Returns True if the control is empty or False if it has some items.", "");
+
+ DocDeclStr(
+ virtual wxString , GetString(/*unsigned*/ int n) const,
+ "Returns the label of the item with the given index.", "");
+
+ DocDeclStr(
+ wxArrayString , GetStrings() const,
+ "", "");
+
+ DocDeclStr(
+ virtual void , SetString(/*unsigned*/ int n, const wxString& s),
+ "Sets the label for the given item.", "");
+
+ DocDeclStr(
+ virtual int , FindString(const wxString& s) const,
+ "Finds an item whose label matches the given string. Returns the
+zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
+found.", "");
+
+
+ DocDeclStr(
+ virtual void , SetSelection(int n),
+ "Sets the item at index 'n' to be the selected item.", "");
+
+ DocDeclStr(
+ virtual int , GetSelection() const,
+ "Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
+is selected.", "");
+
+
+ bool SetStringSelection(const wxString& s);
+
+ DocDeclStr(
+ wxString , GetStringSelection() const,
+ "Returns the label of the selected item or an empty string if no item
+is selected.", "");
+
+
+ DocDeclStr(
+ void , Select(int n),
+ "This is the same as `SetSelection` and exists only because it is
+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`");
+