]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxTextCtrl.py
Some Unicode compilation fixes. This Unicode stuff in file functions is
[wxWidgets.git] / wxPython / demo / wxTextCtrl.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
3
4#---------------------------------------------------------------------------
5
6class TestPanel(wxPanel):
7 def __init__(self, parent, log):
8 wxPanel.__init__(self, parent, -1)
9 self.log = log
10
11 wxStaticText(self, -1, "wxTextCtrl", wxPoint(5, 25), wxSize(75, 20))
f6bcfd97
BP
12 t = wxTextCtrl(self, 10, "Test it out and see", wxPoint(80, 25), wxSize(150, 20))
13 t.SetInsertionPoint(0)
cf694132 14 EVT_TEXT(self, 10, self.EvtText)
c368d904
RD
15 EVT_CHAR(t, self.EvtChar)
16
cf694132
RD
17
18 wxStaticText(self, -1, "Passsword", wxPoint(5, 50), wxSize(75, 20))
19 wxTextCtrl(self, 20, "", wxPoint(80, 50), wxSize(150, 20), wxTE_PASSWORD)
20 EVT_TEXT(self, 20, self.EvtText)
21
22 wxStaticText(self, -1, "Multi-line", wxPoint(5, 75), wxSize(75, 20))
c368d904
RD
23 t = wxTextCtrl(self, 30, "How does it work with a long line of text set in the control",
24 wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
f6bcfd97 25 t.SetInsertionPoint(0)
cf694132
RD
26 EVT_TEXT(self, 30, self.EvtText)
27
28 def EvtText(self, event):
29 self.log.WriteText('EvtText: %s\n' % event.GetString())
30
31
c368d904
RD
32 def EvtChar(self, event):
33 self.log.WriteText('EvtChar: %d\n' % event.GetKeyCode())
34 event.Skip()
35
cf694132
RD
36
37#---------------------------------------------------------------------------
38
39def runTest(frame, nb, log):
40 win = TestPanel(nb, log)
41 return win
42
43#---------------------------------------------------------------------------
44
45
46
47
48overview = """\
49"""