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

Source Code for Module Gnumed.wxGladeWidgets.wxgSingleComponentGenericDrugEAPnl

 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   
14  # end wxGlade 
15   
16   
17 -class wxgSingleComponentGenericDrugEAPnl(wx.ScrolledWindow):
18 - def __init__(self, *args, **kwds):
19 # begin wxGlade: wxgSingleComponentGenericDrugEAPnl.__init__ 20 kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL 21 wx.ScrolledWindow.__init__(self, *args, **kwds) 22 self._LBL_drug_name = wx.StaticText(self, wx.ID_ANY, "") 23 from Gnumed.wxpython.gmSubstanceMgmtWidgets import cSubstancePhraseWheel 24 self._PRW_substance = cSubstancePhraseWheel(self, wx.ID_ANY, "") 25 from Gnumed.wxpython.gmTextCtrl import cTextCtrl 26 self._TCTRL_amount = cTextCtrl(self, wx.ID_ANY, "") 27 from Gnumed.wxpython.gmMeasurementWidgets import cUnitPhraseWheel 28 self._PRW_unit = cUnitPhraseWheel(self, wx.ID_ANY, "") 29 from Gnumed.wxpython.gmMeasurementWidgets import cUnitPhraseWheel 30 self._PRW_dose_unit = cUnitPhraseWheel(self, wx.ID_ANY, "") 31 from Gnumed.wxpython.gmMedicationWidgets import cSubstancePreparationPhraseWheel 32 self._PRW_preparation = cSubstancePreparationPhraseWheel(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: wxgSingleComponentGenericDrugEAPnl.__set_properties 40 self.SetScrollRate(10, 10) 41 self._PRW_substance.SetToolTip(_("The active component of this generic drug.")) 42 self._TCTRL_amount.SetToolTip(_("Enter the amount of substance (such as the \"5\" in \"5mg/ml\").")) 43 self._PRW_unit.SetToolTip(_("The unit of the amount of substance (such as the \"mg\" in \"5mg/ml\").")) 44 self._PRW_dose_unit.SetToolTip(_("The unit of the reference amount (such as the \"ml\" in \"5mg/ml\"). If left empty it means \"per delivery unit\" (such as tablet, sachet, capsule, suppository)."))
45 # end wxGlade 46
47 - def __do_layout(self):
48 # begin wxGlade: wxgSingleComponentGenericDrugEAPnl.__do_layout 49 _gszr_main = wx.FlexGridSizer(5, 2, 1, 3) 50 __szr_unit = wx.BoxSizer(wx.HORIZONTAL) 51 __lbl_drug_name = wx.StaticText(self, wx.ID_ANY, _("Drug name")) 52 _gszr_main.Add(__lbl_drug_name, 0, wx.ALIGN_CENTER_VERTICAL, 0) 53 _gszr_main.Add(self._LBL_drug_name, 0, wx.EXPAND, 0) 54 __lbl_substance = wx.StaticText(self, wx.ID_ANY, _("Substance")) 55 _gszr_main.Add(__lbl_substance, 0, wx.ALIGN_CENTER_VERTICAL, 0) 56 _gszr_main.Add(self._PRW_substance, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0) 57 __lbl_amount = wx.StaticText(self, wx.ID_ANY, _("Amount")) 58 _gszr_main.Add(__lbl_amount, 0, wx.ALIGN_CENTER_VERTICAL, 0) 59 _gszr_main.Add(self._TCTRL_amount, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 10) 60 __lbl_unit = wx.StaticText(self, wx.ID_ANY, _("Unit")) 61 _gszr_main.Add(__lbl_unit, 0, wx.ALIGN_CENTER_VERTICAL, 0) 62 __szr_unit.Add(self._PRW_unit, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5) 63 __lbl_dose_unit = wx.StaticText(self, wx.ID_ANY, _("per")) 64 __szr_unit.Add(__lbl_dose_unit, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) 65 __szr_unit.Add(self._PRW_dose_unit, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 10) 66 _gszr_main.Add(__szr_unit, 1, 0, 0) 67 __lbl_preparation = wx.StaticText(self, wx.ID_ANY, _("Preparation")) 68 _gszr_main.Add(__lbl_preparation, 0, wx.ALIGN_CENTER_VERTICAL, 0) 69 _gszr_main.Add(self._PRW_preparation, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 10) 70 self.SetSizer(_gszr_main) 71 _gszr_main.Fit(self) 72 _gszr_main.AddGrowableCol(1) 73 self.Layout()
74 # end wxGlade 75 76 # end of class wxgSingleComponentGenericDrugEAPnl 77