projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
aui notebook pages can be moved around
[wxWidgets.git]
/
wxPython
/
demo
/
ArtProvider.py
diff --git
a/wxPython/demo/ArtProvider.py
b/wxPython/demo/ArtProvider.py
index 02b326680e91a389e17545b1756890ac088782a7..00cc9068ff96501160d12228e63fa8636c91635c 100644
(file)
--- 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
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_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_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",
+ "wx.ART_FOLDER_OPEN",
"wx.ART_GO_DIR_UP",
"wx.ART_EXECUTABLE_FILE",
"wx.ART_NORMAL_FILE",
"wx.ART_GO_DIR_UP",
"wx.ART_EXECUTABLE_FILE",
"wx.ART_NORMAL_FILE",
@@
-47,6
+50,17
@@
ArtIDs = [ "wx.ART_ADD_BOOKMARK",
"wx.ART_QUESTION",
"wx.ART_WARNING",
"wx.ART_INFORMATION",
"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",
]
]
@@
-159,7
+173,7
@@
class TestPanel(wx.Panel):
text = wx.StaticText(self, -1, "48x48")
box.Add(text, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
text = wx.StaticText(self, -1, "48x48")
box.Add(text, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
- fgs.Add
Sizer
(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)
sizer.Add(fgs, 0, wx.ALL, 5)
self.SetSizer(sizer)
@@
-183,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")
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")
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))
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():
if not bmp.Ok():
- bmp = wxEmptyBitmap(16,16)
+ bmp = wx.EmptyBitmap(16,16)
+ self.clearBmp(bmp)
self.bmp16.SetBitmap(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():
if not bmp.Ok():
- bmp = wxEmptyBitmap(32,32)
+ bmp = wx.EmptyBitmap(32,32)
+ self.clearBmp(bmp)
self.bmp32.SetBitmap(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():
if not bmp.Ok():
- bmp = wxEmptyBitmap(48,48)
+ bmp = wx.EmptyBitmap(48,48)
+ self.clearBmp(bmp)
self.bmp48.SetBitmap(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):
#----------------------------------------------------------------------
def runTest(frame, nb, log):
@@
-225,21
+249,21
@@
def runTest(frame, nb, log):
overview = """<html><body>
overview = """<html><body>
-<h2><center>wxArtProvider</center></h2>
+<h2><center>wx
.
ArtProvider</center></h2>
-wxArtProvider class can be used to customize the look of wxWindows
+wx
.
ArtProvider class can be used to customize the look of wxWindows
applications. When wxWindows internal classes need to display an icon
or a bitmap (e.g. in the standard file dialog), it does not use a
applications. When wxWindows internal classes need to display an icon
or a bitmap (e.g. in the standard file dialog), it does not use a
-hard-coded resource but asks wxArtProvider for it instead. This way
-the users can plug in their own wxArtProvider class and easily replace
+hard-coded resource but asks wx
.
ArtProvider for it instead. This way
+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
standard art with his/her own version. It is easy thing to do: all
-that is needed is to derive a class from wxArtProvider, override it's
+that is needed is to derive a class from wx
.
ArtProvider, override it's
CreateBitmap method and register the provider with
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
<p>
This class can also be used to get the platform native icons as
-provided by wx
ArtProvider_GetBitmap or wxArtProvider_
GetIcon methods.
+provided by wx
.ArtProvider.GetBitmap or wx.ArtProvider.
GetIcon methods.
</body></html>
"""
</body></html>
"""
@@
-853,7
+877,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
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:]
)