]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/ogl/_diagram.py
Using buffered drawing won't let the themed background show through,
[wxWidgets.git] / wxPython / wx / lib / ogl / _diagram.py
index d117a7c6a552007fee4fdc7e4e63c7f875f41b9d..6bdf00185f00e3267409f0d0ced4dd4618aae960 100644 (file)
@@ -78,11 +78,12 @@ class Diagram(object):
         for shape in self._shapeList[:]:
             if not shape.GetParent():
                 self.RemoveShape(shape)
+                shape.Delete()
                 
     def ShowAll(self, show):
         """Call Show for each shape in the diagram."""
         for shape in self._shapeList:
-            shape.Show()
+            shape.Show(show)
 
     def DrawOutline(self, dc, x1, y1, x2, y2):
         """Draw an outline rectangle on the current device context."""
@@ -118,6 +119,14 @@ class Diagram(object):
             return self._gridSpacing * int(x / self._gridSpacing + 0.5), self._gridSpacing * int(y / self._gridSpacing + 0.5)
         return x, y
 
+    def SetGridSpacing(self, spacing): 
+        """Sets grid spacing.""" 
+        self._gridSpacing = spacing 
+    def SetSnapToGrid(self, snap): 
+        """Sets snap-to-grid mode.""" 
+        self._snapToGrid = snap 
+
     def GetGridSpacing(self):
         """Return the grid spacing."""
         return self._gridSpacing