]>
Commit | Line | Data |
---|---|---|
cf694132 | 1 | |
8fa876ca RD |
2 | import wx |
3 | import images | |
cf694132 | 4 | |
969d9b6f RD |
5 | |
6 | USE_GENERIC = 0 | |
7 | ||
8 | if USE_GENERIC: | |
9 | from wx.lib.stattext import GenStaticText as StaticText | |
10 | from wx.lib.statbmp import GenStaticBitmap as StaticBitmap | |
11 | else: | |
12 | StaticText = wx.StaticText | |
13 | StaticBitmap = wx.StaticBitmap | |
14 | ||
15 | ||
cf694132 RD |
16 | #---------------------------------------------------------------------- |
17 | ||
8fa876ca | 18 | class TestPanel(wx.Panel): |
cf694132 | 19 | def __init__(self, parent, log): |
8fa876ca | 20 | wx.Panel.__init__(self, parent, -1) |
cf694132 | 21 | self.log = log |
969d9b6f | 22 | ##self.SetBackgroundColour("sky blue") |
cf694132 | 23 | |
969d9b6f | 24 | StaticText(self, -1, "This is a wx.StaticBitmap.", (45, 15)) |
cf694132 | 25 | |
96bfd053 | 26 | bmp = images.getTest2Bitmap() |
d7403ad2 | 27 | mask = wx.Mask(bmp, wx.BLUE) |
1b62f00d | 28 | bmp.SetMask(mask) |
969d9b6f | 29 | StaticBitmap(self, -1, bmp, (80, 50), (bmp.GetWidth(), bmp.GetHeight())) |
cf694132 | 30 | |
afb810d9 | 31 | bmp = images.getRobinBitmap() |
969d9b6f | 32 | StaticBitmap(self, -1, bmp, (80, 150)) |
cf694132 | 33 | |
969d9b6f | 34 | StaticText(self, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175)) |
cf694132 RD |
35 | |
36 | ||
37 | #---------------------------------------------------------------------- | |
38 | ||
39 | def runTest(frame, nb, log): | |
40 | win = TestPanel(nb, log) | |
41 | return win | |
42 | ||
43 | #---------------------------------------------------------------------- | |
44 | ||
8fa876ca | 45 | overview = """\ |
95bfd958 | 46 | A StaticBitmap control displays a bitmap. |
cf694132 | 47 | |
95bfd958 | 48 | A bitmap can be derived from most image formats using the wx.Image class. |
cf694132 | 49 | |
1fded56b | 50 | """ |
cf694132 | 51 | |
1fded56b RD |
52 | if __name__ == '__main__': |
53 | import sys,os | |
54 | import run | |
8eca4fef | 55 | run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) |