]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ScrolledWindow.py
Another package name fix
[wxWidgets.git] / wxPython / demo / ScrolledWindow.py
index 153ceab617836e90b15a0dbab2e6090420c9dceb..35087538d88afcf835ccb0c3a727b76a8e2d0a50 100644 (file)
@@ -24,7 +24,8 @@ class MyCanvas(wx.ScrolledWindow):
         bmp.SetMask(mask)
         self.bmp = bmp
 
         bmp.SetMask(mask)
         self.bmp = bmp
 
-        self.SetScrollbars(20, 20, self.maxWidth/20, self.maxHeight/20)
+        self.SetVirtualSize((self.maxWidth, self.maxHeight))
+        self.SetScrollRate(20,20)
 
         if BUFFERED:
             # Initialize the buffer bitmap.  No real DC is needed at this point.
 
         if BUFFERED:
             # Initialize the buffer bitmap.  No real DC is needed at this point.
@@ -53,7 +54,7 @@ class MyCanvas(wx.ScrolledWindow):
             # wx.PaintDC and then blit the bitmap to it when dc is
             # deleted.  Since we don't need to draw anything else
             # here that's all there is to it.
             # wx.PaintDC and then blit the bitmap to it when dc is
             # deleted.  Since we don't need to draw anything else
             # here that's all there is to it.
-            dc = wx.BufferedPaintDC(self, self.buffer)
+            dc = wx.BufferedPaintDC(self, self.buffer, wx.BUFFER_VIRTUAL_AREA)
         else:
             dc = wx.PaintDC(self)
             self.PrepareDC(dc)
         else:
             dc = wx.PaintDC(self)
             self.PrepareDC(dc)
@@ -136,6 +137,10 @@ class MyCanvas(wx.ScrolledWindow):
         dc.SetPen(old_pen)
         dc.DrawRectangle(490,90, 20,20)
 
         dc.SetPen(old_pen)
         dc.DrawRectangle(490,90, 20,20)
 
+        dc.GradientFillLinear((20, 260, 50, 50),
+                              "red", "blue")
+        dc.GradientFillConcentric((20, 325, 50, 50),
+                                  "red", "blue", (25,25))
         self.DrawSavedLines(dc)
         dc.EndDrawing()
 
         self.DrawSavedLines(dc)
         dc.EndDrawing()