]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-07/text_ctrl_multiple.py
3 class TextFrame(wx
.Frame
):
6 wx
.Frame
.__init
__(self
, None, -1, 'Text Entry Example',
8 panel
= wx
.Panel(self
, -1)
9 multiLabel
= wx
.StaticText(panel
, -1, "Multi-line")
10 multiText
= wx
.TextCtrl(panel
, -1,
11 "Here is a looooooooooooooong line of text set in the control.\n\n"
12 "See that it wrapped, and that this line is after a blank",
13 size
=(200, 100), style
=wx
.TE_MULTILINE
)
14 multiText
.SetInsertionPoint(0)
16 richLabel
= wx
.StaticText(panel
, -1, "Rich Text")
17 richText
= wx
.TextCtrl(panel
, -1,
18 "If supported by the native control, this is reversed, and this is a different font.",
19 size
=(200, 100), style
=wx
.TE_MULTILINE|wx
.TE_RICH2
)
20 richText
.SetInsertionPoint(0)
21 richText
.SetStyle(44, 52, wx
.TextAttr("white", "black"))
22 points
= richText
.GetFont().GetPointSize()
23 f
= wx
.Font(points
+ 3, wx
.ROMAN
, wx
.ITALIC
, wx
.BOLD
, True)
24 richText
.SetStyle(68, 82, wx
.TextAttr("blue", wx
.NullColour
, f
))
25 sizer
= wx
.FlexGridSizer(cols
=2, hgap
=6, vgap
=6)
26 sizer
.AddMany([multiLabel
, multiText
, richLabel
, richText
])
29 if __name__
== '__main__':
30 app
= wx
.PySimpleApp()