]> git.saurik.com Git - wxWidgets.git/commitdiff
Various small fixes and tweaks
authorRobin Dunn <robin@alldunn.com>
Tue, 30 Nov 1999 18:23:57 +0000 (18:23 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 30 Nov 1999 18:23:57 +0000 (18:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/wxPython/README.txt
utils/wxPython/demo/FileBrowseButton.py
utils/wxPython/demo/bitmaps/splash.gif
utils/wxPython/lib/grids.py
utils/wxPython/lib/mvctree.py

index d049e6bae8a9e21d0d1a8d13b36bc6b7500025ba..99fa7e57defaf515e9d3e0458626d48d94c5965a 100644 (file)
@@ -60,6 +60,8 @@ Added wxPython.lib.spashscreen from Mike Fletcher.
 
 Added wxPython.lib.filebrowsebutton also from Mike Fletcher.
 
 
 Added wxPython.lib.filebrowsebutton also from Mike Fletcher.
 
+Renamed wxTreeCtrl.GetParent to GetItemParent to avoid a name clash
+with wxWindow.GetParent.
 
 
 
 
 
 
index ed322b67b4588b865279365c47d3760a9eeaa096..b970ae7376924c830585bc772ad34b0c46006117 100644 (file)
@@ -1,6 +1,6 @@
 
 from wxPython.wx import *
 
 from wxPython.wx import *
-from wxPython.lib.filebrowsebtn import FileBrowseButton
+from wxPython.lib.filebrowsebutton import FileBrowseButton
 
 
 #----------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------
index 918c3a6a3e0ef51bcfc843c8dedaf83b1f8812ab..f1d3b2cf751708c41c8f107af1296e79d862c305 100644 (file)
Binary files a/utils/wxPython/demo/bitmaps/splash.gif and b/utils/wxPython/demo/bitmaps/splash.gif differ
index 061dc950752d113d501241472bac6f2d22e72f8d..2a8d58c80cd20ea3e6d88801ee221d646c853d9a 100644 (file)
@@ -13,7 +13,7 @@
 
 """
 
 
 """
 
-In this module you will find wxGridSizer and wxFlexgridSizer.
+In this module you will find wxGridSizer and wxFlexGridSizer.
 wxGridSizer arrainges its items in a grid in which all the widths and
 heights are the same.  wxFlexgridSizer allows different widths and
 heights, and you can also specify rows and/or columns that are
 wxGridSizer arrainges its items in a grid in which all the widths and
 heights are the same.  wxFlexgridSizer allows different widths and
 heights, and you can also specify rows and/or columns that are
index 28d68c44e5d74b6f73d9cea39d573dfde503777a..05ff67ab9602b7e5443fcabd74843ef217fec1d1 100644 (file)
@@ -90,7 +90,7 @@ class LayoutEngine:
     """
     def __init__(self, tree):
         self.tree = tree
     """
     def __init__(self, tree):
         self.tree = tree
-    def layout(self, node):
+    def Layout(self, node):
         raise NotImplementedError
     def GetNodeList(self):
         raise NotImplementedError
         raise NotImplementedError
     def GetNodeList(self):
         raise NotImplementedError
@@ -101,7 +101,7 @@ class Transform:
     """
     def __init__(self, tree):
         self.tree = tree
     """
     def __init__(self, tree):
         self.tree = tree
-    def transform(self, node, offset, rotation):
+    def Transform(self, node, offset, rotation):
         """
         This method should only change the projx and projy attributes of
         the node. These represent the position of the node as it should
         """
         This method should only change the projx and projy attributes of
         the node. These represent the position of the node as it should
@@ -141,7 +141,7 @@ class Painter:
         return self.bmp
     def ClearBuffer(self):
         self.bmp = None
         return self.bmp
     def ClearBuffer(self):
         self.bmp = None
-    def paint(self, dc, node, doubleBuffered=1, paintBackground=1):
+    def Paint(self, dc, node, doubleBuffered=1, paintBackground=1):
         raise NotImplementedError
     def GetTextColour(self):
         return self.textcolor
         raise NotImplementedError
     def GetTextColour(self):
         return self.textcolor
@@ -187,18 +187,18 @@ class Painter:
         if evt.LeftDClick():
             x, y = self.tree.CalcUnscrolledPosition(evt.GetX(), evt.GetY())
             for item in self.rectangles:
         if evt.LeftDClick():
             x, y = self.tree.CalcUnscrolledPosition(evt.GetX(), evt.GetY())
             for item in self.rectangles:
-                if item[1].contains((x,y)):
+                if item[1].Contains((x,y)):
                     self.tree.Edit(item[0].data)
                     self.tree.OnNodeClick(item[0], evt)
                     return
         elif evt.ButtonDown():
             x, y = self.tree.CalcUnscrolledPosition(evt.GetX(), evt.GetY())
             for item in self.rectangles:
                     self.tree.Edit(item[0].data)
                     self.tree.OnNodeClick(item[0], evt)
                     return
         elif evt.ButtonDown():
             x, y = self.tree.CalcUnscrolledPosition(evt.GetX(), evt.GetY())
             for item in self.rectangles:
-                if item[1].contains((x, y)):
+                if item[1].Contains((x, y)):
                     self.tree.OnNodeClick(item[0], evt)
                     return
             for item in self.knobs:
                     self.tree.OnNodeClick(item[0], evt)
                     return
             for item in self.knobs:
-                if item[1].contains((x, y)):
+                if item[1].Contains((x, y)):
                     self.tree.OnKnobClick(item[0])
                     return
         evt.Skip()
                     self.tree.OnKnobClick(item[0])
                     return
         evt.Skip()
@@ -242,7 +242,7 @@ class NodePainter:
     """
     def __init__(self, painter):
         self.painter = painter
     """
     def __init__(self, painter):
         self.painter = painter
-    def paint(self, node, dc, location = None):
+    def Paint(self, node, dc, location = None):
         """
         location should be provided only to draw in an unusual position
         (not the node's normal position), otherwise the node's projected x and y
         """
         location should be provided only to draw in an unusual position
         (not the node's normal position), otherwise the node's projected x and y
@@ -256,7 +256,7 @@ class LinePainter:
     """
     def __init__(self, painter):
         self.painter = painter
     """
     def __init__(self, painter):
         self.painter = painter
-    def paint(self, parent, child, dc):
+    def Paint(self, parent, child, dc):
         raise NotImplementedError
 
 class TextConverter:
         raise NotImplementedError
 
 class TextConverter:
@@ -265,7 +265,7 @@ class TextConverter:
     """
     def __init__(self, painter):
         self.painter = painter
     """
     def __init__(self, painter):
         self.painter = painter
-    def convert(node):
+    def Convert(node):
         """
         Should return a string. The node argument will be an
         MVCTreeNode.
         """
         Should return a string. The node argument will be an
         MVCTreeNode.
@@ -450,14 +450,14 @@ class LateFSTreeModel(FSTreeModel):
         return not os.path.isdir(node.path + os.sep + node.fileName)
 
 class StrTextConverter(TextConverter):
         return not os.path.isdir(node.path + os.sep + node.fileName)
 
 class StrTextConverter(TextConverter):
-    def convert(self, node):
+    def Convert(self, node):
         return str(node.data)
 
 class NullTransform(Transform):
     def GetSize(self):
         return tuple(self.size)
 
         return str(node.data)
 
 class NullTransform(Transform):
     def GetSize(self):
         return tuple(self.size)
 
-    def transform(self, node, offset, rotation):
+    def Transform(self, node, offset, rotation):
         self.size = [0,0]
         list = self.tree.GetLayoutEngine().GetNodeList()
         for node in list:
         self.size = [0,0]
         list = self.tree.GetLayoutEngine().GetNodeList()
         for node in list:
@@ -481,7 +481,7 @@ class Rect:
         name = ['x', 'y', 'width', 'height'][index]
         setattr(self, name, value)
 
         name = ['x', 'y', 'width', 'height'][index]
         setattr(self, name, value)
 
-    def contains(self, other):
+    def Contains(self, other):
         if type(other) == type(()):
             other = Rect(other[0], other[1], 0, 0)
         if other.x >= self.x:
         if type(other) == type(()):
             other = Rect(other[0], other[1], 0, 0)
         if other.x >= self.x:
@@ -504,7 +504,7 @@ class TreeLayout(LayoutEngine):
         self.NODE_HEIGHT = 20
         self.nodelist = []
 
         self.NODE_HEIGHT = 20
         self.nodelist = []
 
-    def layout(self, node):
+    def Layout(self, node):
         self.nodelist = []
         self.NODE_HEIGHT = self.tree.GetFont().GetPointSize() * 2
         self.layoutwalk(node)
         self.nodelist = []
         self.NODE_HEIGHT = self.tree.GetFont().GetPointSize() * 2
         self.layoutwalk(node)
@@ -543,7 +543,7 @@ class TreePainter(Painter):
         self.textConverter = textConverter
         self.charWidths = []
 
         self.textConverter = textConverter
         self.charWidths = []
 
-    def paint(self, dc, node, doubleBuffered=1, paintBackground=1):
+    def Paint(self, dc, node, doubleBuffered=1, paintBackground=1):
         if not self.charWidths:
             self.charWidths = []
             for i in range(25):
         if not self.charWidths:
             self.charWidths = []
             for i in range(25):
@@ -603,8 +603,8 @@ class TreePainter(Painter):
         self.dashpen = wxPen(pen.GetColour(), 1, wxDOT)
 
     def paintWalk(self, node, dc, paintRects=0):
         self.dashpen = wxPen(pen.GetColour(), 1, wxDOT)
 
     def paintWalk(self, node, dc, paintRects=0):
-        self.linePainter.paint(node.parent, node, dc)
-        self.nodePainter.paint(node, dc, drawRects = paintRects)
+        self.linePainter.Paint(node.parent, node, dc)
+        self.nodePainter.Paint(node, dc, drawRects = paintRects)
         if node.expanded:
             for kid in node.kids:
                 if not self.paintWalk(kid, dc, paintRects):
         if node.expanded:
             for kid in node.kids:
                 if not self.paintWalk(kid, dc, paintRects):
@@ -638,8 +638,8 @@ class TreePainter(Painter):
         Painter.OnMouse(self, evt)
 
 class TreeNodePainter(NodePainter):
         Painter.OnMouse(self, evt)
 
 class TreeNodePainter(NodePainter):
-    def paint(self, node, dc, location = None, drawRects = 0):
-        text = self.painter.textConverter.convert(node)
+    def Paint(self, node, dc, location = None, drawRects = 0):
+        text = self.painter.textConverter.Convert(node)
         extent = dc.GetTextExtent(text)
         node.width = extent[0]
         node.height = extent[1]
         extent = dc.GetTextExtent(text)
         node.width = extent[0]
         node.height = extent[1]
@@ -658,7 +658,7 @@ class TreeNodePainter(NodePainter):
         self.painter.rectangles.append((node, Rect(node.projx, node.projy, node.width, node.height)))
 
 class TreeLinePainter(LinePainter):
         self.painter.rectangles.append((node, Rect(node.projx, node.projy, node.width, node.height)))
 
 class TreeLinePainter(LinePainter):
-    def paint(self, parent, child, dc):
+    def Paint(self, parent, child, dc):
         dc.SetPen(self.painter.GetDashPen())
         px = py = cx = cy = 0
         if parent is None or child == self.painter.tree.currentRoot:
         dc.SetPen(self.painter.GetDashPen())
         px = py = cx = cy = 0
         if parent is None or child == self.painter.tree.currentRoot:
@@ -836,7 +836,7 @@ class wxMVCTree(wxScrolledWindow):
 
     def GetDisplayText(self, node):
         treenode = self.nodemap[node]
 
     def GetDisplayText(self, node):
         treenode = self.nodemap[node]
-        return self.painter.textConverter.convert(treenode)
+        return self.painter.textConverter.Convert(treenode)
 
     def IsDoubleBuffered(self):
         return self.doubleBuffered
 
     def IsDoubleBuffered(self):
         return self.doubleBuffered
@@ -975,8 +975,8 @@ class wxMVCTree(wxScrolledWindow):
         else:
             e = wxMVCTreeEvent(wxEVT_MVCTREE_ITEM_COLLAPSED, self.GetId(), node)
         self.GetEventHandler().ProcessEvent(e)
         else:
             e = wxMVCTreeEvent(wxEVT_MVCTREE_ITEM_COLLAPSED, self.GetId(), node)
         self.GetEventHandler().ProcessEvent(e)
-        self.layout.layout(self.currentRoot)
-        self.transform.transform(self.currentRoot, self.offset, self.rotation)
+        self.layout.Layout(self.currentRoot)
+        self.transform.Transform(self.currentRoot, self.offset, self.rotation)
         self.Refresh()
 
     def IsExpanded(self, node):
         self.Refresh()
 
     def IsExpanded(self, node):
@@ -1033,7 +1033,7 @@ class wxMVCTree(wxScrolledWindow):
         self.PrepareDC(dc)
         for node in changeparents:
             if node:
         self.PrepareDC(dc)
         for node in changeparents:
             if node:
-                self.painter.paint(dc, node, doubleBuffered = 0, paintBackground = 0)
+                self.painter.Paint(dc, node, doubleBuffered = 0, paintBackground = 0)
         self.painter.ClearBuffer()
 
     def RemoveFromSelection(self, nodeTuple):
         self.painter.ClearBuffer()
 
     def RemoveFromSelection(self, nodeTuple):
@@ -1051,7 +1051,7 @@ class wxMVCTree(wxScrolledWindow):
         self.PrepareDC(dc)
         for node in changeparents:
             if node:
         self.PrepareDC(dc)
         for node in changeparents:
             if node:
-                self.painter.paint(dc, node, doubleBuffered = 0, paintBackground = 0)
+                self.painter.Paint(dc, node, doubleBuffered = 0, paintBackground = 0)
         self.painter.ClearBuffer()
 
 
         self.painter.ClearBuffer()
 
 
@@ -1090,11 +1090,11 @@ class wxMVCTree(wxScrolledWindow):
         try:
             self.EnableScrolling(false, false)
             if not self.laidOut:
         try:
             self.EnableScrolling(false, false)
             if not self.laidOut:
-                self.layout.layout(self.currentRoot)
+                self.layout.Layout(self.currentRoot)
                 self.laidOut = true
                 self.transformed = false
             if not self.transformed:
                 self.laidOut = true
                 self.transformed = false
             if not self.transformed:
-                self.transform.transform(self.currentRoot, self.offset, self.rotation)
+                self.transform.Transform(self.currentRoot, self.offset, self.rotation)
                 self.transformed = true
             tsize = None
             tsize = list(self.transform.GetSize())
                 self.transformed = true
             tsize = None
             tsize = list(self.transform.GetSize())
@@ -1111,7 +1111,7 @@ class wxMVCTree(wxScrolledWindow):
             dc = wxPaintDC(self)
             self.PrepareDC(dc)
             dc.SetFont(self.GetFont())
             dc = wxPaintDC(self)
             self.PrepareDC(dc)
             dc.SetFont(self.GetFont())
-            self.painter.paint(dc, self.currentRoot, self.doubleBuffered)
+            self.painter.Paint(dc, self.currentRoot, self.doubleBuffered)
         except:
             traceback.print_exc()
 
         except:
             traceback.print_exc()