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

# Source Code for Module Gnumed.wxGladeWidgets.wxgConsumableSubstanceEAPnl

     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/wxgConsumableSubstanceEAPnl.wxg"
     4
     5  import wx
     6
     7  # begin wxGlade: extracode
     8  # end wxGlade
     9
    10
    11
    12 -class wxgConsumableSubstanceEAPnl(wx.ScrolledWindow):
    13 -    def __init__(self, *args, **kwds):
    14
    15          from Gnumed.wxpython import gmMedicationWidgets
    16          from Gnumed.wxpython import gmMeasurementWidgets
    17
    18          # begin wxGlade: wxgConsumableSubstanceEAPnl.__init__
    19          kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
    20          wx.ScrolledWindow.__init__(self, *args, **kwds)
    21          self._TCTRL_substance = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
    22          self._TCTRL_amount = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
    23          self._PRW_unit = gmMeasurementWidgets.cUnitPhraseWheel(self, -1, "", style=wx.NO_BORDER)
    24          self._PRW_atc = gmMedicationWidgets.cATCPhraseWheel(self, -1, "", style=wx.NO_BORDER)
    25
    26          self.__set_properties()
    27          self.__do_layout()
    28          # end wxGlade
    29
    30 -    def __set_properties(self):
    31          # begin wxGlade: wxgConsumableSubstanceEAPnl.__set_properties
    32          self.SetScrollRate(10, 10)
    33          self._TCTRL_substance.SetToolTipString(_("Enter the name of the consumable substance.\n\nExamples:\n- metoprolol\n- tobacco\n- alcohol\n- marihuana\n- aloe vera\n- ibuprofen"))
    34          self._TCTRL_amount.SetToolTipString(_("Enter the amount of substance."))
    35          # end wxGlade
    36
    37 -    def __do_layout(self):
    38          # begin wxGlade: wxgConsumableSubstanceEAPnl.__do_layout
    39          _gszr_main = wx.FlexGridSizer(3, 2, 1, 3)
    40          __szr_amount = wx.BoxSizer(wx.HORIZONTAL)
    41          __lbl_substance = wx.StaticText(self, -1, _("Substance"))
    42          __lbl_substance.SetForegroundColour(wx.Colour(255, 0, 0))
    43          _gszr_main.Add(__lbl_substance, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    44          _gszr_main.Add(self._TCTRL_substance, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    45          __lbl_amount = wx.StaticText(self, -1, _("Amount"))
    46          __lbl_amount.SetForegroundColour(wx.Colour(255, 0, 0))
    47          _gszr_main.Add(__lbl_amount, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    48          __szr_amount.Add(self._TCTRL_amount, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10)
    49          __lbl_unit = wx.StaticText(self, -1, _("Unit:"))
    50          __lbl_unit.SetForegroundColour(wx.Colour(255, 0, 0))
    51          __szr_amount.Add(__lbl_unit, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
    52          __szr_amount.Add(self._PRW_unit, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    53          _gszr_main.Add(__szr_amount, 1, wx.EXPAND, 0)
    54          __lbl_atc = wx.StaticText(self, -1, _("ATC code"))
    55          _gszr_main.Add(__lbl_atc, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    56          _gszr_main.Add(self._PRW_atc, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    57          self.SetSizer(_gszr_main)
    58          _gszr_main.Fit(self)
    59          _gszr_main.AddGrowableCol(1)
    60          # end wxGlade
    61
    62  # end of class wxgConsumableSubstanceEAPnl
    63