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

# Source Code for Module Gnumed.wxGladeWidgets.wxgVaccineEAPnl

     1  # -*- coding: UTF-8 -*-
     2  #
     3  # generated by wxGlade
     4  #
     5
     6  import wx
     7
     8  # begin wxGlade: dependencies
     9  import gettext
    10  # end wxGlade
    11
    12  # begin wxGlade: extracode
    13  from Gnumed.wxpython.gmSubstanceMgmtWidgets import cDrugProductPhraseWheel
    14  from Gnumed.wxpython.gmPhraseWheel import cPhraseWheel
    15  from Gnumed.wxpython.gmATCWidgets import cATCPhraseWheel
    16  # end wxGlade
    17
    18
    19 -class wxgVaccineEAPnl(wx.ScrolledWindow):
    20 -        def __init__(self, *args, **kwds):
    21                  # begin wxGlade: wxgVaccineEAPnl.__init__
    22                  kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
    23                  wx.ScrolledWindow.__init__(self, *args, **kwds)
    24                  self._PRW_drug_product = cDrugProductPhraseWheel(self, wx.ID_ANY, "")
    25                  self._CHBOX_fake = wx.CheckBox(self, wx.ID_ANY, _("Fake"))
    26                  self._PRW_route = cPhraseWheel(self, wx.ID_ANY, "")
    27                  self._CHBOX_live = wx.CheckBox(self, wx.ID_ANY, _("Live"), style=wx.CHK_2STATE)
    28                  self._TCTRL_indications = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
    29                  self._PRW_atc = cATCPhraseWheel(self, wx.ID_ANY, "")
    30                  self._PRW_age_min = cPhraseWheel(self, wx.ID_ANY, "")
    31                  self._PRW_age_max = cPhraseWheel(self, wx.ID_ANY, "")
    32                  self._TCTRL_comment = wx.TextCtrl(self, wx.ID_ANY, "")
    33
    34                  self.__set_properties()
    35                  self.__do_layout()
    36                  # end wxGlade
    37
    38 -        def __set_properties(self):
    39                  # begin wxGlade: wxgVaccineEAPnl.__set_properties
    40                  self.SetScrollRate(10, 10)
    41                  self._CHBOX_fake.SetToolTip(_("Whether this is an actual product or a generic, fake vaccine."))
    42                  self._PRW_route.SetToolTip(_("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.SetToolTip(_("Check if this is a live attenuated vaccine."))
    46                  self._TCTRL_indications.Enable(False)
    47                  self._PRW_atc.SetToolTip(_("The ATC for this vaccine."))
    48                  self._PRW_age_min.SetToolTip(_("The minimum age at which this vaccine should be given."))
    49                  self._PRW_age_max.SetToolTip(_("The maximum age at which this vaccine should be given."))
    50                  self._TCTRL_comment.SetToolTip(_("Any comment you may wish to relate to this vaccine."))
    51                  # end wxGlade
    52
    53 -        def __do_layout(self):
    54                  # begin wxGlade: wxgVaccineEAPnl.__do_layout
    55                  _gszr_main = wx.FlexGridSizer(6, 2, 1, 3)
    56                  __szr_age_range = wx.BoxSizer(wx.HORIZONTAL)
    57                  __szr_route_details = wx.BoxSizer(wx.HORIZONTAL)
    58                  __szr_product_details = wx.BoxSizer(wx.HORIZONTAL)
    59                  __lbl_name = wx.StaticText(self, wx.ID_ANY, _("Name"))
    60                  __lbl_name.SetForegroundColour(wx.Colour(255, 0, 0))
    61                  _gszr_main.Add(__lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    62                  __szr_product_details.Add(self._PRW_drug_product, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
    63                  __szr_product_details.Add(self._CHBOX_fake, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    64                  _gszr_main.Add(__szr_product_details, 1, wx.EXPAND, 0)
    65                  __lbl_route = wx.StaticText(self, wx.ID_ANY, _("Route"))
    66                  __lbl_route.SetForegroundColour(wx.Colour(255, 0, 0))
    67                  __lbl_route.Enable(False)
    68                  __lbl_route.Hide()
    69                  _gszr_main.Add(__lbl_route, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    70                  __szr_route_details.Add(self._PRW_route, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
    71                  __szr_route_details.Add(self._CHBOX_live, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    72                  _gszr_main.Add(__szr_route_details, 1, wx.EXPAND, 0)
    73                  __lbl_indications = wx.StaticText(self, wx.ID_ANY, _("Protects\nfrom"))
    74                  __lbl_indications.SetForegroundColour(wx.Colour(255, 0, 0))
    75                  _gszr_main.Add(__lbl_indications, 0, 0, 0)
    76                  _gszr_main.Add(self._TCTRL_indications, 1, wx.EXPAND, 0)
    77                  __lbl_atc = wx.StaticText(self, wx.ID_ANY, _("ATC"))
    78                  _gszr_main.Add(__lbl_atc, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    79                  _gszr_main.Add(self._PRW_atc, 1, wx.EXPAND, 0)
    80                  __lbl_age_range = wx.StaticText(self, wx.ID_ANY, _("Age range"))
    81                  _gszr_main.Add(__lbl_age_range, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    82                  __szr_age_range.Add(self._PRW_age_min, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    83                  __lbl_from_to = wx.StaticText(self, wx.ID_ANY, _(u"\u2192"))
    84                  __szr_age_range.Add(__lbl_from_to, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, 10)
    85                  __szr_age_range.Add(self._PRW_age_max, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    86                  _gszr_main.Add(__szr_age_range, 1, wx.EXPAND, 0)
    87                  __lbl_comment = wx.StaticText(self, wx.ID_ANY, _("Comment"))
    88                  _gszr_main.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    89                  _gszr_main.Add(self._TCTRL_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    90                  self.SetSizer(_gszr_main)
    91                  _gszr_main.Fit(self)
    92                  _gszr_main.AddGrowableRow(2)
    93                  _gszr_main.AddGrowableCol(1)
    94                  self.Layout()
    95                  # end wxGlade
    96
    97  # end of class wxgVaccineEAPnl
    98