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