1 try:
2 import wxversion
3 import wx
4 except ImportError:
5 from wxPython import wx
6
7
8
9
10
11
12 -class SocialHistory(wx.Panel):
13 - def __init__(self, parent,id):
14 wx.Panel.__init__(self, parent, id, wx.DefaultPosition, wx.DefaultSize, 0 )
15 sizer = wx.BoxSizer(wx.VERTICAL)
16 txt_social_history = wx.TextCtrl(self, 30,
17 "Born in QLD, son of an itinerant drover. Mother worked as a bush nurse. "
18 "Two brothers, Fred and Peter. Left school aged 15yrs, apprentice fitter "
19 "then worked in industry for 10ys. At 22yrs age married Joan, two children"
20 "Peter b1980 and Rachaelb1981. Retired in 1990 due to receiving a fortune.",
21
22 wx.DefaultPosition,wx.DefaultSize, style=wxTE_MULTILINE|wx.NO_3D|wx.SIMPLE_BORDER)
23 txt_social_history.SetInsertionPoint(0)
24 txt_social_history.SetFont(wx.Font(12,wx.SWISS, wx.NORMAL, wx.NORMAL, False, 'xselfont'))
25
26 sizer.Add(txt_social_history,100,wx.EXPAND)
27 self.SetSizer(sizer)
28 sizer.Fit(self)
29 self.SetAutoLayout(True)
30
31 self.text = txt_social_history
32
33 print self.GetValue()
34
35 - def SetValue( self, text):
36 self.text.SetValue(text)
37
39 return self.text.GetValue()
40 if __name__ == "__main__":
41 app = wxPyWidgetTester(size = (500, 100))
42 app.SetWidget(SocialHistory, -1)
43 app.MainLoop()
44