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

# Source Code for Module Gnumed.wxGladeWidgets.wxgDrugComponentEAPnl

     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/wxgDrugComponentEAPnl.wxg"
     4
     5  import wx
     6
     7  # begin wxGlade: extracode
     8  # end wxGlade
     9
    10
    11
    12 -class wxgDrugComponentEAPnl(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: wxgDrugComponentEAPnl.__init__
    19          kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL
    20          wx.ScrolledWindow.__init__(self, *args, **kwds)
    21          self._TCTRL_brand = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER)
    22          self._TCTRL_components = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER)
    23          self._TCTRL_codes = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER)
    24          self._PRW_substance = gmMedicationWidgets.cSubstancePhraseWheel(self, -1, "", style=wx.NO_BORDER)
    25          self._TCTRL_amount = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
    26          self._PRW_unit = gmMeasurementWidgets.cUnitPhraseWheel(self, -1, "", style=wx.NO_BORDER)
    27
    28          self.__set_properties()
    29          self.__do_layout()
    30          # end wxGlade
    31
    32 -    def __set_properties(self):
    33          # begin wxGlade: wxgDrugComponentEAPnl.__set_properties
    34          self.SetScrollRate(10, 10)
    35          self._TCTRL_brand.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
    36          self._TCTRL_components.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
    37          self._TCTRL_codes.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
    38          self._TCTRL_amount.SetToolTipString(_("The numeric amount of substance per dose in brand.\n\nExamples:\n- 100mg per tablet: amount = 100, unit = mg(/tablet)\n- 10mg/ampulla: amount = 10, unit = mg(/ampulla)\n- 5mg/ml solution: amount = 5, unit = mg/ml"))
    39          # end wxGlade
    40
    41 -    def __do_layout(self):
    42          # begin wxGlade: wxgDrugComponentEAPnl.__do_layout
    43          _gszr_main = wx.FlexGridSizer(5, 2, 1, 3)
    44          __szr_amount = wx.BoxSizer(wx.HORIZONTAL)
    45          __lbl_brand = wx.StaticText(self, -1, _("Brand"))
    46          _gszr_main.Add(__lbl_brand, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    47          _gszr_main.Add(self._TCTRL_brand, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    48          _gszr_main.Add((20, 20), 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    49          _gszr_main.Add(self._TCTRL_components, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    50          _gszr_main.Add((20, 20), 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    51          _gszr_main.Add(self._TCTRL_codes, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    52          __lbl_substance = wx.StaticText(self, -1, _("Substance"))
    53          __lbl_substance.SetForegroundColour(wx.Colour(255, 0, 0))
    54          _gszr_main.Add(__lbl_substance, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    55          _gszr_main.Add(self._PRW_substance, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
    56          __lbl_amount = wx.StaticText(self, -1, _("Amount"))
    57          __lbl_amount.SetForegroundColour(wx.Colour(255, 0, 0))
    58          _gszr_main.Add(__lbl_amount, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    59          __szr_amount.Add(self._TCTRL_amount, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10)
    60          __lbl_unit = wx.StaticText(self, -1, _("Unit"))
    61          __lbl_unit.SetForegroundColour(wx.Colour(255, 0, 0))
    62          __szr_amount.Add(__lbl_unit, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5)
    63          __szr_amount.Add(self._PRW_unit, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10)
    64          _gszr_main.Add(__szr_amount, 1, wx.EXPAND, 0)
    65          self.SetSizer(_gszr_main)
    66          _gszr_main.Fit(self)
    67          _gszr_main.AddGrowableCol(1)
    68          # end wxGlade
    69
    70  # end of class wxgDrugComponentEAPnl
    71