]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed name of demo so the list sorts nicer
authorRobin Dunn <robin@alldunn.com>
Sat, 15 Jun 2002 05:52:22 +0000 (05:52 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 15 Jun 2002 05:52:22 +0000 (05:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Main.py
wxPython/demo/VirtualListCtrl.py [deleted file]
wxPython/demo/wxEditor.py
wxPython/demo/wxListCtrl_virtual.py [new file with mode: 0644]

index f64b5e8e07bca998ae9d7b62a240e3cbed34b1a3..82b0a9b9f5dcebbc0fd7d2eaa996e8f951a5502b 100644 (file)
@@ -66,7 +66,6 @@ _treeList = [
 
     # core controls
     ('Core Windows/Controls', [
-        'VirtualListCtrl',
         'wxButton',
         'wxCheckBox',
         'wxCheckListBox',
@@ -77,6 +76,7 @@ _treeList = [
         'wxGrid',
         'wxListBox',
         'wxListCtrl',
+        'wxListCtrl_virtual',
         'wxNotebook',
         'wxPopupWindow',
         'wxRadioBox',
diff --git a/wxPython/demo/VirtualListCtrl.py b/wxPython/demo/VirtualListCtrl.py
deleted file mode 100644 (file)
index b30b4ca..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-from wxPython.wx import *
-
-#----------------------------------------------------------------------
-
-class TestVirtualList(wxListCtrl):
-    def __init__(self, parent, log):
-        wxListCtrl.__init__(self, parent, -1,
-                            style=wxLC_REPORT|wxLC_VIRTUAL|wxLC_HRULES|wxLC_VRULES)
-        self.log = log
-
-        self.InsertColumn(0, "First")
-        self.InsertColumn(1, "Second")
-        self.InsertColumn(2, "Third")
-        self.SetColumnWidth(0, 175)
-        self.SetColumnWidth(1, 175)
-        self.SetColumnWidth(2, 175)
-
-        self.SetItemCount(1000000)
-
-        self.attr1 = wxListItemAttr()
-        self.attr1.SetBackgroundColour("yellow")
-
-        self.attr2 = wxListItemAttr()
-        self.attr2.SetBackgroundColour("light blue")
-
-        EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.OnItemSelected)
-        EVT_LIST_ITEM_ACTIVATED(self, self.GetId(), self.OnItemActivated)
-
-
-    def OnItemSelected(self, event):
-        self.currentItem = event.m_itemIndex
-        self.log.WriteText('OnItemSelected: "%s", "%s", "%s", "%s"\n' %
-                           (self.currentItem,
-                            self.GetItemText(self.currentItem),
-                            self.getColumnText(self.currentItem, 1),
-                            self.getColumnText(self.currentItem, 2)))
-
-    def OnItemActivated(self, event):
-        self.currentItem = event.m_itemIndex
-        self.log.WriteText("OnItemActivated: %s\n" % self.GetItemText(self.currentItem))
-
-    def getColumnText(self, index, col):
-        item = self.GetItem(index, col)
-        return item.GetText()
-
-    #---------------------------------------------------
-    # These methods are callbacks for implementing the
-    # "virtualness" of the list...
-    def OnGetItemText(self, item, col):
-        return "Item %d, column %d" % (item, col)
-
-
-    def OnGetItemImage(self, item):
-        return -1  # if used you should return the index in the ImageList
-
-
-    def OnGetItemAttr(self, item):
-        if item % 3 == 1:
-            return self.attr1
-        elif item % 3 == 2:
-            return self.attr2
-        else:
-            return None
-
-
-#----------------------------------------------------------------------
-
-def runTest(frame, nb, log):
-    win = TestVirtualList(nb, log)
-    return win
-
-#----------------------------------------------------------------------
-
-
-
-
-
-
-
-
-overview = """\
-"""
index d3bbd087857ac80a78625a7635a39a71c684b5d8..2ee5c23c6b0c1ac30fc693664817474990021fad 100644 (file)
@@ -62,3 +62,9 @@ SetAltFuncs() method.
 
 
 
+
+if __name__ == '__main__':
+    import sys,os
+    import run
+    run.main(['', os.path.basename(sys.argv[0])])
+
diff --git a/wxPython/demo/wxListCtrl_virtual.py b/wxPython/demo/wxListCtrl_virtual.py
new file mode 100644 (file)
index 0000000..3e9a8fa
--- /dev/null
@@ -0,0 +1,88 @@
+
+from wxPython.wx import *
+
+#----------------------------------------------------------------------
+
+class TestVirtualList(wxListCtrl):
+    def __init__(self, parent, log):
+        wxListCtrl.__init__(self, parent, -1,
+                            style=wxLC_REPORT|wxLC_VIRTUAL|wxLC_HRULES|wxLC_VRULES)
+        self.log = log
+
+        self.InsertColumn(0, "First")
+        self.InsertColumn(1, "Second")
+        self.InsertColumn(2, "Third")
+        self.SetColumnWidth(0, 175)
+        self.SetColumnWidth(1, 175)
+        self.SetColumnWidth(2, 175)
+
+        self.SetItemCount(1000000)
+
+        self.attr1 = wxListItemAttr()
+        self.attr1.SetBackgroundColour("yellow")
+
+        self.attr2 = wxListItemAttr()
+        self.attr2.SetBackgroundColour("light blue")
+
+        EVT_LIST_ITEM_SELECTED(self, self.GetId(), self.OnItemSelected)
+        EVT_LIST_ITEM_ACTIVATED(self, self.GetId(), self.OnItemActivated)
+
+
+    def OnItemSelected(self, event):
+        self.currentItem = event.m_itemIndex
+        self.log.WriteText('OnItemSelected: "%s", "%s", "%s", "%s"\n' %
+                           (self.currentItem,
+                            self.GetItemText(self.currentItem),
+                            self.getColumnText(self.currentItem, 1),
+                            self.getColumnText(self.currentItem, 2)))
+
+    def OnItemActivated(self, event):
+        self.currentItem = event.m_itemIndex
+        self.log.WriteText("OnItemActivated: %s\n" % self.GetItemText(self.currentItem))
+
+    def getColumnText(self, index, col):
+        item = self.GetItem(index, col)
+        return item.GetText()
+
+    #---------------------------------------------------
+    # These methods are callbacks for implementing the
+    # "virtualness" of the list...
+    def OnGetItemText(self, item, col):
+        return "Item %d, column %d" % (item, col)
+
+
+    def OnGetItemImage(self, item):
+        return -1  # if used you should return the index in the ImageList
+
+
+    def OnGetItemAttr(self, item):
+        if item % 3 == 1:
+            return self.attr1
+        elif item % 3 == 2:
+            return self.attr2
+        else:
+            return None
+
+
+#----------------------------------------------------------------------
+
+def runTest(frame, nb, log):
+    win = TestVirtualList(nb, log)
+    return win
+
+#----------------------------------------------------------------------
+
+
+
+
+
+overview = """\
+"""
+
+
+
+if __name__ == '__main__':
+    import sys,os
+    import run
+    run.main(['', os.path.basename(sys.argv[0])])
+