]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ArtProvider.py
removed WXWIN_COMPATIBILITY_2_4 from common and wxMSW files (patch 1675546)
[wxWidgets.git] / wxPython / demo / ArtProvider.py
index 8daadc6298bdba8c20133250fb0597038c8b030f..00cc9068ff96501160d12228e63fa8636c91635c 100644 (file)
@@ -27,6 +27,8 @@ 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",
@@ -48,6 +50,17 @@ 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_NEW",
+           "wx.ART_UNDO",
+           "wx.ART_REDO",
+           "wx.ART_QUIT",
+           "wx.ART_FIND",
+           "wx.ART_FIND_AND_REPLACE",
            ]
 
 
@@ -184,38 +197,48 @@ class TestPanel(wx.Panel):
     def OnUseCustom(self, evt):
         if evt.IsChecked():
             self.log.write("Images will now be provided by MyArtProvider\n")
-            wx.ArtProvider_PushProvider( MyArtProvider(self.log) )
+            wx.ArtProvider.Push( MyArtProvider(self.log) )
         else:
             self.log.write("MyArtProvider deactivated\n")
-            wx.ArtProvider_PopProvider()
+            wx.ArtProvider.Pop()
         self.getArt()
 
 
     def getArt(self):
         self.log.write("Getting art for %s:%s\n" % (self.client, self.artid))
 
-        bmp = wx.ArtProvider_GetBitmap(self.artid, self.client, (16,16))
+        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))
+        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))
+        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):
@@ -236,11 +259,11 @@ the users can plug in their own wx.ArtProvider class and easily replace
 standard art with his/her own version. It is easy thing to do: all
 that is needed is to derive a class from wx.ArtProvider, override it's
 CreateBitmap method and register the provider with
-wx.ArtProvider_PushProvider.
+wx.ArtProvider.PushProvider.
 <p>
 
 This class can also be used to get the platform native icons as
-provided by wx.ArtProvider_GetBitmap or wx.ArtProvider_GetIcon methods.
+provided by wx.ArtProvider.GetBitmap or wx.ArtProvider.GetIcon methods.
 
 </body></html>
 """