Package Gnumed :: Package wxpython :: Module gmGP_FamilyHistorySummary
[frames] | no frames]

Source Code for Module Gnumed.wxpython.gmGP_FamilyHistorySummary

 1  try: 
 2          import wxversion 
 3          import wx 
 4  except ImportError: 
 5          from wxPython import wx 
 6   
 7  #-------------------------------------------------------------------- 
 8  # A class for displaying social history 
 9  # This code is shit and needs fixing, here for gui development only 
10  # TODO: Pass social history text to this panel not display fixed text 
11  #-------------------------------------------------------------------- 
12 -class FamilyHistorySummary(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_family_history = wx.TextCtrl(self, 30, 17 "FAMILY HISTORY: Stroke(father-died72yrs);NIDDM(general - maternal).\n", 18 wx.DefaultPosition,wx.DefaultSize, style=wxTE_MULTILINE|wx.NO_3D|wx.SIMPLE_BORDER) 19 txt_family_history.SetInsertionPoint(0) 20 txt_family_history.SetFont(wx.Font(12,wx.SWISS,wx.NORMAL, wx.NORMAL, False,'xselfont')) 21 txt_family_history.SetForegroundColour(wx.Colour(1, 1, 255)) 22 sizer.Add(txt_family_history,100,wx.EXPAND) 23 self.SetSizer(sizer) #set the sizer 24 sizer.Fit(self) #set to minimum size as calculated by sizer 25 self.SetAutoLayout(True) #tell frame to use the sizer 26 #self.Show(True) 27 self.text = txt_family_history 28 29 print self.GetValue()
30 31
32 - def GetValue(self):
33 return self.text.GetValue()
34
35 - def SetValue(self, val):
36 self.text.SetValue(val)
37 38 39 40 if __name__ == "__main__": 41 app = wxPyWidgetTester(size = (400, 100)) 42 app.SetWidget(FamilyHistorySummary, -1) 43 app.MainLoop() 44