]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed bug that prevented wxTreeCtrl.OnCompareItems from being called.
authorRobin Dunn <robin@alldunn.com>
Wed, 9 May 2001 22:15:05 +0000 (22:15 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 9 May 2001 22:15:05 +0000 (22:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/CHANGES.txt
wxPython/demo/wxTreeCtrl.py
wxPython/src/controls2.i
wxPython/src/msw/controls2.cpp

index 425cc911ad879180db92f0cd7c95358583742b0e..882c1135f302537a503617acc5b04f9a8592191e 100644 (file)
@@ -55,7 +55,9 @@ Added a ton of missing methods for wxPrintData.
 
 Switched to InnoSetup for MSW distributions.
 
-Added wxToggleButton
+Added wxToggleButton.
+
+Fixed bug that prevented wxTreeCtrl.OnCompareItems from being called.
 
 
 
index 17fcfe835957eb570692f559009d7e0bb4041fbb..f16c48c6cfde32fd7da6981e82d874e9500f01e8 100644 (file)
@@ -6,13 +6,14 @@ import string
 #---------------------------------------------------------------------------
 
 class MyTreeCtrl(wxTreeCtrl):
-    def __init__(self, parent, id, pos, size, style):
+    def __init__(self, parent, id, pos, size, style, log):
         wxTreeCtrl.__init__(self, parent, id, pos, size, style)
-
+        self.log = log
 
     def OnCompareItems(self, item1, item2):
         t1 = self.GetItemText(item1)
         t2 = self.GetItemText(item2)
+        self.log.WriteText('compare: ' + t1 + '<>' + t2 + '\n')
         if t1 < t2: return -1
         if t1 == t2: return 0
         return 1
@@ -29,7 +30,8 @@ class TestTreeCtrlPanel(wxPanel):
         tID = NewId()
 
         self.tree = MyTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize,
-                               wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS)# | wxTR_MULTIPLE)
+                               wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS# | wxTR_MULTIPLE
+                               , self.log)
 
         #import images
         #il = wxImageList(16, 16)
index 1ca0a09bb9529fa763582a7a61723d2d0d42911a..998a4650c91d7c8238daa0373d1fadf15810cfa8 100644 (file)
@@ -490,6 +490,7 @@ public:
 
 %{
 class wxPyTreeCtrl : public wxTreeCtrl {
+    DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl);
 public:
     wxPyTreeCtrl(wxWindow *parent, wxWindowID id,
                  const wxPoint& pos,
@@ -499,7 +500,6 @@ public:
                  char* name) :
         wxTreeCtrl(parent, id, pos, size, style, validator, name) {}
 
-
     int OnCompareItems(const wxTreeItemId& item1,
                        const wxTreeItemId& item2) {
         int rval = 0;
@@ -517,6 +517,8 @@ public:
     PYPRIVATE;
 };
 
+IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
+
 %}
 
 // These are for the GetFirstChild/GetNextChild methods below
index d564344390de33b72b2ec517d6681e2f623fbbf1..4cfdb3f11e556fecf1d4891f536779ded475b8cf 100644 (file)
@@ -164,6 +164,7 @@ public:
 };
 
 class wxPyTreeCtrl : public wxTreeCtrl {
+    DECLARE_ABSTRACT_CLASS(wxPyTreeCtrl);
 public:
     wxPyTreeCtrl(wxWindow *parent, wxWindowID id,
                  const wxPoint& pos,
@@ -173,7 +174,6 @@ public:
                  char* name) :
         wxTreeCtrl(parent, id, pos, size, style, validator, name) {}
 
-
     int OnCompareItems(const wxTreeItemId& item1,
                        const wxTreeItemId& item2) {
         int rval = 0;
@@ -191,6 +191,8 @@ public:
     PYPRIVATE;
 };
 
+IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl);
+
 #ifdef __cplusplus
 extern "C" {
 #endif