X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/299647acac7960652aadb008775429c1f8ea9b8d..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/demo/ArtProvider.py?ds=sidebyside diff --git a/wxPython/demo/ArtProvider.py b/wxPython/demo/ArtProvider.py index 02b326680e..91d7a9fafc 100644 --- a/wxPython/demo/ArtProvider.py +++ b/wxPython/demo/ArtProvider.py @@ -1,7 +1,3 @@ -# 11/15/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# import cStringIO import wx @@ -31,13 +27,20 @@ ArtIDs = [ "wx.ART_ADD_BOOKMARK", "wx.ART_GO_TO_PARENT", "wx.ART_GO_HOME", "wx.ART_FILE_OPEN", + "wx.ART_FILE_SAVE", + "wx.ART_FILE_SAVE_AS", "wx.ART_PRINT", "wx.ART_HELP", "wx.ART_TIP", "wx.ART_REPORT_VIEW", "wx.ART_LIST_VIEW", "wx.ART_NEW_DIR", + "wx.ART_HARDDISK", + "wx.ART_FLOPPY", + "wx.ART_CDROM", + "wx.ART_REMOVABLE", "wx.ART_FOLDER", + "wx.ART_FOLDER_OPEN", "wx.ART_GO_DIR_UP", "wx.ART_EXECUTABLE_FILE", "wx.ART_NORMAL_FILE", @@ -47,6 +50,16 @@ ArtIDs = [ "wx.ART_ADD_BOOKMARK", "wx.ART_QUESTION", "wx.ART_WARNING", "wx.ART_INFORMATION", + "wx.ART_MISSING_IMAGE", + "wx.ART_COPY", + "wx.ART_CUT", + "wx.ART_PASTE", + "wx.ART_DELETE", + "wx.ART_UNDO", + "wx.ART_REDO", + "wx.ART_QUIT", + "wx.ART_FIND", + "wx.ART_FIND_AND_REPLACE", ] @@ -159,7 +172,7 @@ class TestPanel(wx.Panel): text = wx.StaticText(self, -1, "48x48") box.Add(text, 0, wx.ALIGN_CENTRE|wx.ALL, 5) - fgs.AddSizer(box, 0, wx.ALIGN_CENTRE|wx.ALL, 5) + fgs.Add(box, 0, wx.ALIGN_CENTRE|wx.ALL, 5) sizer.Add(fgs, 0, wx.ALL, 5) self.SetSizer(sizer) @@ -196,25 +209,35 @@ class TestPanel(wx.Panel): bmp = wx.ArtProvider_GetBitmap(self.artid, self.client, (16,16)) if not bmp.Ok(): - bmp = wxEmptyBitmap(16,16) + bmp = wx.EmptyBitmap(16,16) + self.clearBmp(bmp) self.bmp16.SetBitmap(bmp) bmp = wx.ArtProvider_GetBitmap(self.artid, self.client, (32,32)) if not bmp.Ok(): - bmp = wxEmptyBitmap(32,32) + bmp = wx.EmptyBitmap(32,32) + self.clearBmp(bmp) self.bmp32.SetBitmap(bmp) bmp = wx.ArtProvider_GetBitmap(self.artid, self.client, (48,48)) if not bmp.Ok(): - bmp = wxEmptyBitmap(48,48) + bmp = wx.EmptyBitmap(48,48) + self.clearBmp(bmp) self.bmp48.SetBitmap(bmp) + def clearBmp(self, bmp): + dc = wx.MemoryDC() + dc.SelectObject(bmp) + dc.SetBackground(wx.Brush("white")) + dc.Clear() + + #---------------------------------------------------------------------- def runTest(frame, nb, log): @@ -225,21 +248,21 @@ def runTest(frame, nb, log): overview = """
-This class can also be used to get the platform native icons as -provided by wxArtProvider_GetBitmap or wxArtProvider_GetIcon methods. +provided by wx.ArtProvider_GetBitmap or wx.ArtProvider_GetIcon methods. """ @@ -853,7 +876,7 @@ V\xab\x95\xb2\xd9,y<\x1e2\x18\x0c\x8ak\xb5Z-9\x9dN*\x14\n\xdf\x9e\x9c$@*\x95\ if __name__ == '__main__': import sys,os import run - run.main(['', os.path.basename(sys.argv[0])]) + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])