]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxTextCtrl.py
merged 2.2 branch
[wxWidgets.git] / wxPython / demo / wxTextCtrl.py
1
2 from wxPython.wx import *
3
4 #---------------------------------------------------------------------------
5
6 class 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))
12 t = wxTextCtrl(self, 10, "Test it out and see", wxPoint(80, 25), wxSize(150, 20))
13 t.SetInsertionPoint(0)
14 EVT_TEXT(self, 10, self.EvtText)
15
16 wxStaticText(self, -1, "Passsword", wxPoint(5, 50), wxSize(75, 20))
17 wxTextCtrl(self, 20, "", wxPoint(80, 50), wxSize(150, 20), wxTE_PASSWORD)
18 EVT_TEXT(self, 20, self.EvtText)
19
20 wxStaticText(self, -1, "Multi-line", wxPoint(5, 75), wxSize(75, 20))
21 t = wxTextCtrl(self, 30, "How does it work with a long line of text set in the control", wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
22 t.SetInsertionPoint(0)
23 EVT_TEXT(self, 30, self.EvtText)
24
25 def EvtText(self, event):
26 self.log.WriteText('EvtText: %s\n' % event.GetString())
27
28
29
30 #---------------------------------------------------------------------------
31
32 def runTest(frame, nb, log):
33 win = TestPanel(nb, log)
34 return win
35
36 #---------------------------------------------------------------------------
37
38
39
40
41 overview = """\
42 """