Package Gnumed :: Package wxGladeWidgets :: Module wxgVaccineEAPnl |
[frames] | no frames]

# Source Code for Module Gnumed.wxGladeWidgets.wxgVaccineEAPnl

      1  #!/usr/bin/env python
      2  # -*- coding: utf8 -*-
      3  # generated by wxGlade 0.6.3 from "/home/ncq/Projekte/gm-git/gnumed/gnumed/client/wxg/wxgVaccineEAPnl.wxg"
      4
      5  import wx
      6
      7  # begin wxGlade: extracode
      8  # end wxGlade
      9
     10
     11
     12 -class wxgVaccineEAPnl(wx.ScrolledWindow):
     13 -    def __init__(self, *args, **kwds):
     14
     15          from Gnumed.wxpython import gmMedicationWidgets
     16          from Gnumed.wxpython import gmPhraseWheel
     17
     18          # begin wxGlade: wxgVaccineEAPnl.__init__
     19          kwds["style"] = wx.NO_BORDER | wx.TAB_TRAVERSAL
     20          wx.ScrolledWindow.__init__(self, *args, **kwds)
     21          self._PRW_brand = gmMedicationWidgets.cBrandedDrugPhraseWheel(self, -1, "", style=wx.NO_BORDER)
     22          self._CHBOX_fake = wx.CheckBox(self, -1, _("Fake"))
     23          self._PRW_route = gmPhraseWheel.cPhraseWheel(self, -1, "", style=wx.NO_BORDER)
     24          self._CHBOX_live = wx.CheckBox(self, -1, _("Live"))
     25          self._TCTRL_indications = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.NO_BORDER)
     26          self._BTN_manage_indications = wx.Button(self, -1, _("&Manage"), style=wx.BU_EXACTFIT)
     27          self._PRW_atc = gmMedicationWidgets.cATCPhraseWheel(self, -1, "", style=wx.NO_BORDER)
     28          self._PRW_age_min = gmPhraseWheel.cPhraseWheel(self, -1, "", style=wx.NO_BORDER)
     29          self._PRW_age_max = gmPhraseWheel.cPhraseWheel(self, -1, "", style=wx.NO_BORDER)
     30          self._TCTRL_comment = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
     31
     32          self.__set_properties()
     33          self.__do_layout()
     34
     35          self.Bind(wx.EVT_BUTTON, self._on_manage_indications_button_pressed, self._BTN_manage_indications)
     36          # end wxGlade
     37
     38 -    def __set_properties(self):
     39          # begin wxGlade: wxgVaccineEAPnl.__set_properties
     40          self.SetScrollRate(10, 10)
     41          self._CHBOX_fake.SetToolTipString(_("Whether this is an actual brand or a generic, fake vaccine."))
     42          self._PRW_route.SetToolTipString(_("The route by which this vaccine is to be administered.\n\nTypically one of i.m., s.c., or orally."))
     43          self._PRW_route.Enable(False)
     44          self._PRW_route.Hide()
     45          self._CHBOX_live.SetToolTipString(_("Check if this is a live attenuated vaccine."))
     46          self._CHBOX_live.Enable(False)
     47          self._CHBOX_live.Hide()
     48          self._TCTRL_indications.Enable(False)
     49          self._BTN_manage_indications.SetToolTipString(_("Manage the indications for this vaccine."))
     50          self._PRW_atc.SetToolTipString(_("The ATC for this vaccine."))
     51          self._PRW_age_min.SetToolTipString(_("The minimum age at which this vaccine should be given."))
     52          self._PRW_age_max.SetToolTipString(_("The maximum age at which this vaccine should be given."))
     53          self._TCTRL_comment.SetToolTipString(_("Any comment you may wish to relate to this vaccine."))
     54          # end wxGlade
     55
     56 -    def __do_layout(self):
     57          # begin wxGlade: wxgVaccineEAPnl.__do_layout
     58          _gszr_main = wx.FlexGridSizer(6, 2, 1, 3)
     59          __szr_age_range = wx.BoxSizer(wx.HORIZONTAL)
     60          _SZR_indications = wx.BoxSizer(wx.VERTICAL)
     61          __szr_manage_button = wx.BoxSizer(wx.HORIZONTAL)
     62          __szr_route_details = wx.BoxSizer(wx.HORIZONTAL)
     63          __szr_brand_details = wx.BoxSizer(wx.HORIZONTAL)
     64          __lbl_name = wx.StaticText(self, -1, _("Name"))
     65          __lbl_name.SetForegroundColour(wx.Colour(255, 0, 0))
     66          _gszr_main.Add(__lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     67          __szr_brand_details.Add(self._PRW_brand, 1, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5)
     68          __szr_brand_details.Add(self._CHBOX_fake, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     69          _gszr_main.Add(__szr_brand_details, 1, wx.EXPAND, 0)
     70          __lbl_route = wx.StaticText(self, -1, _("Route"))
     71          __lbl_route.SetForegroundColour(wx.Colour(255, 0, 0))
     72          __lbl_route.Enable(False)
     73          __lbl_route.Hide()
     74          _gszr_main.Add(__lbl_route, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     75          __szr_route_details.Add(self._PRW_route, 1, wx.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 5)
     76          __szr_route_details.Add(self._CHBOX_live, 0, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
     77          _gszr_main.Add(__szr_route_details, 1, wx.EXPAND, 0)
     78          __lbl_indications = wx.StaticText(self, -1, _("Protects\nfrom"))
     79          __lbl_indications.SetForegroundColour(wx.Colour(255, 0, 0))
     80          _gszr_main.Add(__lbl_indications, 0, 0, 0)
     81          _SZR_indications.Add(self._TCTRL_indications, 1, wx.EXPAND, 0)
     82          __szr_manage_button.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL, 0)
     83          __szr_manage_button.Add(self._BTN_manage_indications, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     84          __szr_manage_button.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL, 0)
     85          _SZR_indications.Add(__szr_manage_button, 0, wx.EXPAND, 0)
     86          _gszr_main.Add(_SZR_indications, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     87          __lbl_atc = wx.StaticText(self, -1, _("ATC"))
     88          _gszr_main.Add(__lbl_atc, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     89          _gszr_main.Add(self._PRW_atc, 1, wx.EXPAND, 0)
     90          __lbl_age_range = wx.StaticText(self, -1, _("Age range"))
     91          _gszr_main.Add(__lbl_age_range, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     92          __szr_age_range.Add(self._PRW_age_min, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     93          __lbl_from_to = wx.StaticText(self, -1, _(u"→"))
     94          __szr_age_range.Add(__lbl_from_to, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 10)
     95          __szr_age_range.Add(self._PRW_age_max, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
     96          _gszr_main.Add(__szr_age_range, 1, wx.EXPAND, 0)
     97          __lbl_comment = wx.StaticText(self, -1, _("Comment"))
     98          _gszr_main.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     99          _gszr_main.Add(self._TCTRL_comment, 0, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0)
    100          self.SetSizer(_gszr_main)
    101          _gszr_main.Fit(self)
    102          _gszr_main.AddGrowableRow(2)
    103          _gszr_main.AddGrowableCol(1)
    104          # end wxGlade
    105
    106 -    def _on_manage_indications_button_pressed(self, event):  # wxGlade: wxgVaccineEAPnl.<event_handler>
    107          print "Event handler `_on_manage_indications_button_pressed' not implemented"
    108          event.Skip()
    109
    110  # end of class wxgVaccineEAPnl
    111