Gnumed.wxpython.gmGP_SocialHistory

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

# Source Code for Module Gnumed.wxpython.gmGP_SocialHistory

     1  import wx
     2
     3  #--------------------------------------------------------------------
     4  # A class for displaying social history
     5  # This code is shit and needs fixing, here for gui development only
     6  # TODO: Pass social history text to this panel not display fixed text
     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                          #"previously unknown great aunt. Interests include surfing, fishing, carpentry",                       ,
    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          #self.textCtrl1.SetFont(wx.Font(14, wx.SWISS, wxNORMAL, wx.BOLD, False, 'verdana'))
    22          sizer.Add(txt_social_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_social_history
    28
    29          print self.GetValue()
    30
    31 -    def SetValue( self, text):
    32              self.text.SetValue(text)
    33
    34 -    def GetValue(self):
    35              return self.text.GetValue()
    36  if __name__ == "__main__":
    37      app = wxPyWidgetTester(size = (500, 100))
    38      app.SetWidget(SocialHistory, -1)
    39      app.MainLoop()
    40