1999-04-29 23:29:54 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
import wx
|
2002-07-08 16:06:13 -04:00
|
|
|
|
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):
|
2003-12-08 20:23:28 -05:00
|
|
|
wx.Panel.__init__(self, parent, -1)
|
2002-07-08 16:06:13 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
wx.StaticText(self, -1, "This is an example of static text", (20, 10))
|
2004-01-12 22:17:17 -05:00
|
|
|
wx.StaticText(self, -1, "using the wx.StaticText Control.", (20, 30))
|
2002-07-08 16:06:13 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
wx.StaticText(
|
|
|
|
self, -1, "Is this yellow?", (20, 70), (90, -1)
|
|
|
|
).SetBackgroundColour('Yellow')
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
wx.StaticText(
|
|
|
|
self, -1, "align center", (120, 70), (90, -1), wx.ALIGN_CENTER
|
|
|
|
).SetBackgroundColour('Yellow')
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2003-12-08 20:23:28 -05:00
|
|
|
wx.StaticText(
|
|
|
|
self, -1, "align right", (220, 70), (90, -1), wx.ALIGN_RIGHT
|
|
|
|
).SetBackgroundColour('Yellow')
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
str = "This is a different font."
|
2003-12-08 20:23:28 -05:00
|
|
|
text = wx.StaticText(self, -1, str, (20, 100))
|
|
|
|
font = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL)
|
1999-04-29 23:29:54 -04:00
|
|
|
text.SetFont(font)
|
2004-04-24 20:39:05 -04:00
|
|
|
text.SetSize(text.GetBestSize())
|
1999-04-29 23:29:54 -04:00
|
|
|
|
2004-01-12 22:17:17 -05:00
|
|
|
wx.StaticText(self, -1, "Multi-line wx.StaticText\nline 2\nline 3\n\nafter empty line", (20,150))
|
2003-12-08 20:23:28 -05:00
|
|
|
wx.StaticText(self, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", (220,150), style=wx.ALIGN_RIGHT)
|
2002-07-08 16:06:13 -04:00
|
|
|
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
def runTest(frame, nb, log):
|
|
|
|
panel = TestPanel(nb)
|
|
|
|
return panel
|
|
|
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
overview = '''\
|
2004-01-12 22:17:17 -05:00
|
|
|
A StaticText control displays one or more lines of read-only text.
|
1999-04-29 23:29:54 -04:00
|
|
|
|
|
|
|
'''
|
|
|
|
|
2002-07-08 16:06:13 -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:])
|
2002-07-08 16:06:13 -04:00
|
|
|
|