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