+
+class wxControlWithItems : public wxControl {
+public:
+
+ // void Clear(); ambiguous, redefine below...
+
+ // Deletes an item from the control
+ void Delete(int n);
+
+ // Returns the number of items in the control.
+ int GetCount();
+ %pragma(python) addtoclass = "Number = GetCount"
+
+ // Returns the string at the given position.
+ wxString GetString(int n);
+
+ // Sets the string value of an item.
+ void SetString(int n, const wxString& s);
+
+ // Finds an item matching the given string. Returns the zero-based
+ // position of the item, or -1 if the string was not found.
+ int FindString(const wxString& s);
+
+ // Select the item at postion n.
+ void Select(int n);
+
+ // Gets the position of the selected item.
+ int GetSelection();
+
+ // Gets the current selection as a string.
+ wxString GetStringSelection() const;
+
+ // void Append(const wxString& item);
+ // void Append(const wxString& item, char* clientData);
+ // char* GetClientData(const int n);
+ // void SetClientData(const int n, char* data);
+
+
+ %addmethods {
+ // Adds the item to the control, associating the given data with the
+ // item if not None.
+ void Append(const wxString& item, PyObject* clientData=NULL) {
+ if (clientData) {
+ wxPyClientData* data = new wxPyClientData(clientData);
+ self->Append(item, data);
+ } else
+ self->Append(item);
+ }
+
+ // Returns the client data associated with the given item, (if any.)
+ PyObject* GetClientData(int n) {
+ wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
+ if (data) {
+ Py_INCREF(data->m_obj);
+ return data->m_obj;
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
+
+ // Associate the given client data with the item at position n.
+ void SetClientData(int n, PyObject* clientData) {
+ wxPyClientData* data = new wxPyClientData(clientData);
+ self->SetClientObject(n, data);
+ }
+ }
+
+ // append several items at once to the control
+ %name(AppendItems)void Append(const wxArrayString& strings);
+
+};
+
+//----------------------------------------------------------------------
+
+// A button is a control that contains a text string, and is one of the most
+// common elements of a GUI. It may be placed on a dialog box or panel, or
+// indeed almost any other window.
+//
+// Styles
+// wxBU_LEFT: Left-justifies the label. WIN32 only.
+// wxBU_TOP: Aligns the label to the top of the button. WIN32 only.
+// wxBU_RIGHT: Right-justifies the bitmap label. WIN32 only.
+// wxBU_BOTTOM: Aligns the label to the bottom of the button. WIN32 only.
+// wxBU_EXACTFIT: Creates the button as small as possible instead of making
+// it of the standard size (which is the default behaviour.)
+//
+// Events
+// EVT_BUTTON(win,id,func):
+// Sent when the button is clicked.
+//