X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe40185d40076711e97ef33de0b934da01f68e0a..6a8b9da42c22b34c1f8ea5f10080e7c51e21a330:/wxPython/demo/ColourDB.py diff --git a/wxPython/demo/ColourDB.py b/wxPython/demo/ColourDB.py index 8e00407dba..ad7c92fc74 100644 --- a/wxPython/demo/ColourDB.py +++ b/wxPython/demo/ColourDB.py @@ -5,11 +5,6 @@ from wxPython.lib import colourdb import images -# This loads a whole bunch of new color names and values -# into wxTheColourDatabase - -colourdb.updateColourDB() - #---------------------------------------------------------------------- class TestWindow(wxScrolledWindow): @@ -28,7 +23,7 @@ class TestWindow(wxScrolledWindow): dc = wxClientDC(self) dc.SetFont(self.font) - w,h,d,e = dc.GetFullTextExtent("Wy") # a wide character and one that decends + w,h,d,e = dc.GetFullTextExtent("Wy") # a wide character and one that descends self.textHeight = h + d self.lineHeight = self.textHeight + 5 self.cellWidth = w @@ -52,7 +47,7 @@ class TestWindow(wxScrolledWindow): while x < sz.width: y = -dy while y < sz.height: - dc.DrawBitmap(self.bg_bmp, x, y) + dc.DrawBitmap(self.bg_bmp, (x, y)) y = y + h x = x + w @@ -62,7 +57,7 @@ class TestWindow(wxScrolledWindow): if not dc: dc = wxClientDC(self) rect = self.GetUpdateRegion().GetBox() - dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height) + dc.SetClippingRect(rect) self.TileBackground(dc) @@ -94,11 +89,12 @@ class TestWindow(wxScrolledWindow): for line in range(max(0,start), min(stop,numColours)): clr = colours[line] y = (line+1) * self.lineHeight + 2 - dc.DrawText(clr, self.cellWidth, y) + dc.DrawText(clr, (self.cellWidth, y)) brush = wxBrush(clr, wxSOLID) dc.SetBrush(brush) - dc.DrawRectangle(12 * self.cellWidth, y, 6 * self.cellWidth, self.textHeight) + dc.DrawRectangle((12 * self.cellWidth, y), + (6 * self.cellWidth, self.textHeight)) dc.EndDrawing() @@ -120,6 +116,10 @@ class TestPanel(wxPanel): def runTest(frame, nb, log): + # This loads a whole bunch of new color names and values + # into wxTheColourDatabase + colourdb.updateColourDB() + win = TestPanel(nb) return win @@ -127,3 +127,10 @@ def runTest(frame, nb, log): overview = """ """ + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) +