]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/controls2.i
added url of Fink Unix to Mac OS X porting instructions
[wxWidgets.git] / wxPython / src / controls2.i
index 5e4c8aff5866b74eebd2fda6b71304644087d00d..ea646254040c2d57cdf1e5aca87da559f1b01b26 100644 (file)
@@ -421,7 +421,22 @@ public:
     bool SetBackgroundColour(const wxColour& col);
 
     // Gets information about this column
-    bool GetColumn(int col, wxListItem& item) const;
+    // bool GetColumn(int col, wxListItem& item) const;
+    %addmethods {
+        %new wxListItem* GetColumn(int col) {
+            wxListItem item;
+            if (self->GetColumn(col, item))
+                return new wxListItem(item);
+            else
+                return NULL;
+        }
+    }  // The OOR typemaps don't know what to do with the %new, so fix it up.
+    %pragma(python) addtoclass = "
+    def GetItem(self, *_args, **_kwargs):
+        val = apply(controls2c.wxListCtrl_GetColumn,(self,) + _args, _kwargs)
+        if val is not None: val.thisown = 1
+        return val
+    "
 
     // Sets information about this column
     bool SetColumn(int col, wxListItem& item) ;
@@ -686,6 +701,16 @@ public:
 
     def ClearColumnImage(self, col):
         self.SetColumnImage(col, -1)
+
+    def Append(self, entry):
+        '''Append an item to the list control.  The entry parameter should be a
+           sequence with an item for each column'''
+        if len(entry):
+            pos = self.GetItemCount()
+            self.InsertStringItem(pos, str(entry[0]))
+            for i in range(1, len(entry)):
+                self.SetStringItem(pos, i, str(entry[i]))
+            return pos
     "
 };
 
@@ -1195,7 +1220,7 @@ public:
                                 size_t before,
                                 const wxString& text,
                                 int image = -1, int selectedImage = -1,
-                                wxTreeItemData *data = NULL);
+                                wxPyTreeItemData *data = NULL);
     wxTreeItemId AppendItem(const wxTreeItemId& parent,
                             const wxString& text,
                             int image = -1, int selectedImage = -1,
@@ -1308,11 +1333,11 @@ class wxGenericDirCtrl: public wxControl
 {
 public:
     wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1,
-                     const wxString &dir = wxDirDialogDefaultFolderStr,
+                     const char* dir = wxDirDialogDefaultFolderStr,
                      const wxPoint& pos = wxDefaultPosition,
                      const wxSize& size = wxDefaultSize,
                      long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
-                     const wxString& filter = wxEmptyString,
+                     const char* filter = wxEmptyString,
                      int defaultFilter = 0,
                      const char* name = "dirCtrl" );
     %name(wxPreGenericDirCtrl)wxGenericDirCtrl();
@@ -1321,11 +1346,11 @@ public:
     %pragma(python) addtomethod = "wxPreGenericDirCtrl:val._setOORInfo(val)"
 
     bool Create(wxWindow *parent, const wxWindowID id = -1,
-                const wxString &dir = wxDirDialogDefaultFolderStr,
+                const char* dir = wxDirDialogDefaultFolderStr,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& size = wxDefaultSize,
                 long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER,
-                const wxString& filter = wxEmptyString,
+                const char* filter = wxEmptyString,
                 int defaultFilter = 0,
                 const char* name = "dirCtrl" );