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

# Source Code for Module Gnumed.wxpython.gmGP_SocialHistory

     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 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                          #"previously unknown great aunt. Interests include surfing, fishing, carpentry",                       ,
    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          #self.textCtrl1.SetFont(wx.Font(14, wx.SWISS, wxNORMAL, wx.BOLD, False, 'verdana'))
    26          sizer.Add(txt_social_history,100,wx.EXPAND)
    27          self.SetSizer(sizer)  #set the sizer
    28          sizer.Fit(self)             #set to minimum size as calculated by sizer
    29          self.SetAutoLayout(True)                 #tell frame to use the sizer
    30          #self.Show(True)
    31          self.text = txt_social_history
    32
    33          print self.GetValue()
    34
    35 -    def SetValue( self, text):
    36              self.text.SetValue(text)
    37
    38 -    def GetValue(self):
    39              return self.text.GetValue()
    40  if __name__ == "__main__":
    41      app = wxPyWidgetTester(size = (500, 100))
    42      app.SetWidget(SocialHistory, -1)
    43      app.MainLoop()
    44