Gnumed.wxGladeWidgets.wxgDrugComponentEAPnl

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

# Source Code for Module Gnumed.wxGladeWidgets.wxgDrugComponentEAPnl

     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  # end wxGlade
    14
    15
    16 -class wxgDrugComponentEAPnl(wx.ScrolledWindow):
    17 -        def __init__(self, *args, **kwds):
    18                  # begin wxGlade: wxgDrugComponentEAPnl.__init__
    19                  kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
    20                  wx.ScrolledWindow.__init__(self, *args, **kwds)
    21                  self._TCTRL_product_name = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
    22                  self._TCTRL_components = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
    23                  self._TCTRL_codes = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
    24                  from Gnumed.wxpython.gmSubstanceMgmtWidgets import cSubstancePhraseWheel
    25                  self._PRW_substance = cSubstancePhraseWheel(self, wx.ID_ANY, "")
    26                  self._TCTRL_amount = wx.TextCtrl(self, wx.ID_ANY, "")
    27                  from Gnumed.wxpython.gmMeasurementWidgets import cUnitPhraseWheel
    28                  self._PRW_unit = cUnitPhraseWheel(self, wx.ID_ANY, "")
    29
    30                  self.__set_properties()
    31                  self.__do_layout()
    32                  # end wxGlade
    33
    34 -        def __set_properties(self):
    35                  # begin wxGlade: wxgDrugComponentEAPnl.__set_properties
    36                  self.SetScrollRate(10, 10)
    37                  self._TCTRL_product_name.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
    38                  self._TCTRL_components.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
    39                  self._TCTRL_codes.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
    40                  self._TCTRL_amount.SetToolTip(_("The numeric amount of substance per dose in the product.\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"))
    41                  # end wxGlade
    42
    43 -        def __do_layout(self):
    44                  # begin wxGlade: wxgDrugComponentEAPnl.__do_layout
    45                  _gszr_main = wx.FlexGridSizer(5, 2, 1, 3)
    46                  __szr_amount = wx.BoxSizer(wx.HORIZONTAL)
    47                  __lbl_product = wx.StaticText(self, wx.ID_ANY, _("Product"))
    48                  _gszr_main.Add(__lbl_product, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    49                  _gszr_main.Add(self._TCTRL_product_name, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    50                  _gszr_main.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    51                  _gszr_main.Add(self._TCTRL_components, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    52                  _gszr_main.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    53                  _gszr_main.Add(self._TCTRL_codes, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    54                  __lbl_substance = wx.StaticText(self, wx.ID_ANY, _("Substance"))
    55                  __lbl_substance.SetForegroundColour(wx.Colour(255, 0, 0))
    56                  _gszr_main.Add(__lbl_substance, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    57                  _gszr_main.Add(self._PRW_substance, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
    58                  __lbl_amount = wx.StaticText(self, wx.ID_ANY, _("Amount"))
    59                  __lbl_amount.SetForegroundColour(wx.Colour(255, 0, 0))
    60                  _gszr_main.Add(__lbl_amount, 0, wx.ALIGN_CENTER_VERTICAL, 0)
    61                  __szr_amount.Add(self._TCTRL_amount, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 10)
    62                  __lbl_unit = wx.StaticText(self, wx.ID_ANY, _("Unit"))
    63                  __lbl_unit.SetForegroundColour(wx.Colour(255, 0, 0))
    64                  __szr_amount.Add(__lbl_unit, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
    65                  __szr_amount.Add(self._PRW_unit, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 10)
    66                  _gszr_main.Add(__szr_amount, 1, wx.EXPAND, 0)
    67                  self.SetSizer(_gszr_main)
    68                  _gszr_main.Fit(self)
    69                  _gszr_main.AddGrowableRow(1)
    70                  _gszr_main.AddGrowableCol(1)
    71                  self.Layout()
    72                  # end wxGlade
    73
    74  # end of class wxgDrugComponentEAPnl
    75