1999-04-30 03:29:54 +00:00
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
import wx
|
|
|
|
import images
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2004-05-14 21:22:39 +00:00
|
|
|
|
|
|
|
USE_GENERIC = 0
|
|
|
|
|
|
|
|
if USE_GENERIC:
|
|
|
|
from wx.lib.stattext import GenStaticText as StaticText
|
|
|
|
from wx.lib.statbmp import GenStaticBitmap as StaticBitmap
|
|
|
|
else:
|
|
|
|
StaticText = wx.StaticText
|
|
|
|
StaticBitmap = wx.StaticBitmap
|
|
|
|
|
|
|
|
|
1999-04-30 03:29:54 +00:00
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
class TestPanel(wx.Panel):
|
1999-04-30 03:29:54 +00:00
|
|
|
def __init__(self, parent, log):
|
2003-12-09 01:23:28 +00:00
|
|
|
wx.Panel.__init__(self, parent, -1)
|
1999-04-30 03:29:54 +00:00
|
|
|
self.log = log
|
2004-05-14 21:22:39 +00:00
|
|
|
##self.SetBackgroundColour("sky blue")
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2004-05-14 21:22:39 +00:00
|
|
|
StaticText(self, -1, "This is a wx.StaticBitmap.", (45, 15))
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2001-04-09 19:36:36 +00:00
|
|
|
bmp = images.getTest2Bitmap()
|
2004-05-02 02:41:33 +00:00
|
|
|
mask = wx.Mask(bmp, wx.BLUE)
|
2001-02-16 08:19:50 +00:00
|
|
|
bmp.SetMask(mask)
|
2004-05-14 21:22:39 +00:00
|
|
|
StaticBitmap(self, -1, bmp, (80, 50), (bmp.GetWidth(), bmp.GetHeight()))
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2002-02-26 22:35:10 +00:00
|
|
|
bmp = images.getRobinBitmap()
|
2004-05-14 21:22:39 +00:00
|
|
|
StaticBitmap(self, -1, bmp, (80, 150))
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2004-05-14 21:22:39 +00:00
|
|
|
StaticText(self, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175))
|
1999-04-30 03:29:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
win = TestPanel(nb, log)
|
|
|
|
return win
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------
|
|
|
|
|
2003-12-09 01:23:28 +00:00
|
|
|
overview = """\
|
2004-01-13 03:17:17 +00:00
|
|
|
A StaticBitmap control displays a bitmap.
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2004-01-13 03:17:17 +00:00
|
|
|
A bitmap can be derived from most image formats using the wx.Image class.
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-07-02 23:13:10 +00:00
|
|
|
"""
|
1999-04-30 03:29:54 +00:00
|
|
|
|
2003-07-02 23:13:10 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
import sys,os
|
|
|
|
import run
|
2004-03-05 00:06:33 +00:00
|
|
|
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|