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

Source Code for Module Gnumed.wxGladeWidgets.wxgBrandedDrugEAPnl

  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/wxgBrandedDrugEAPnl.wxg" 
  4   
  5  import wx 
  6   
  7  # begin wxGlade: extracode 
  8  # end wxGlade 
  9   
 10   
 11   
12 -class wxgBrandedDrugEAPnl(wx.ScrolledWindow):
13 - def __init__(self, *args, **kwds):
14 15 from Gnumed.wxpython import gmMedicationWidgets 16 from Gnumed.wxpython import gmPhraseWheel 17 18 # begin wxGlade: wxgBrandedDrugEAPnl.__init__ 19 kwds["style"] = wx.NO_BORDER|wx.TAB_TRAVERSAL 20 wx.ScrolledWindow.__init__(self, *args, **kwds) 21 self._PRW_brand = gmMedicationWidgets.cBrandedDrugPhraseWheel(self, -1, "", style=wx.NO_BORDER) 22 self._PRW_preparation = gmMedicationWidgets.cSubstancePreparationPhraseWheel(self, -1, "", style=wx.NO_BORDER) 23 self._CHBOX_is_fake = wx.CheckBox(self, -1, _("Fake brand")) 24 self._TCTRL_components = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE|wx.TE_READONLY) 25 self._BTN_add_component = wx.Button(self, -1, _("&+"), style=wx.BU_EXACTFIT) 26 self._BTN_remove_component = wx.Button(self, -1, _("&-"), style=wx.BU_EXACTFIT) 27 self._PRW_atc = gmMedicationWidgets.cATCPhraseWheel(self, -1, "", style=wx.NO_BORDER) 28 self._TCTRL_external_code = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER) 29 self._PRW_external_code_type = gmPhraseWheel.cPhraseWheel(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER) 30 31 self.__set_properties() 32 self.__do_layout() 33 34 self.Bind(wx.EVT_BUTTON, self._on_add_component_button_pressed, self._BTN_add_component) 35 self.Bind(wx.EVT_BUTTON, self._on_remove_component_button_pressed, self._BTN_remove_component)
36 # end wxGlade 37
38 - def __set_properties(self):
39 # begin wxGlade: wxgBrandedDrugEAPnl.__set_properties 40 self.SetScrollRate(10, 10) 41 self._CHBOX_is_fake.SetForegroundColour(wx.Colour(255, 127, 0)) 42 self._CHBOX_is_fake.SetToolTipString(_("Mark as a fake (not really existing) brand.")) 43 self._TCTRL_components.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 44 self._BTN_add_component.SetToolTipString(_("Add a component to this drug.")) 45 self._BTN_remove_component.SetToolTipString(_("Remove a component from this drug.")) 46 self._TCTRL_external_code.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 47 self._TCTRL_external_code.SetToolTipString(_("An external code for this drug.\n\nIn most cases either a national drug identifier or the ID of this drug in an external database.\n\nIn any case, GNUmed will never actively do anything with this code apart from display and making it available when passing this drug to external applications.")) 48 self._PRW_external_code_type.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND)) 49 self._PRW_external_code_type.SetToolTipString(_("The type of the external code of this drug, if any."))
50 # end wxGlade 51
52 - def __do_layout(self):
53 # begin wxGlade: wxgBrandedDrugEAPnl.__do_layout 54 _gszr_main = wx.FlexGridSizer(5, 2, 1, 3) 55 __szr_external_code = wx.BoxSizer(wx.HORIZONTAL) 56 __szr_components = wx.BoxSizer(wx.HORIZONTAL) 57 __szr_buttons = wx.BoxSizer(wx.VERTICAL) 58 __szr_prep = wx.BoxSizer(wx.HORIZONTAL) 59 __lbl_brand = wx.StaticText(self, -1, _("Brand name")) 60 __lbl_brand.SetForegroundColour(wx.Colour(255, 0, 0)) 61 _gszr_main.Add(__lbl_brand, 0, wx.ALIGN_CENTER_VERTICAL, 0) 62 _gszr_main.Add(self._PRW_brand, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 63 __lbl_preparation = wx.StaticText(self, -1, _("Preparation")) 64 __lbl_preparation.SetForegroundColour(wx.Colour(255, 0, 0)) 65 _gszr_main.Add(__lbl_preparation, 0, wx.ALIGN_CENTER_VERTICAL, 0) 66 __szr_prep.Add(self._PRW_preparation, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10) 67 __szr_prep.Add(self._CHBOX_is_fake, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 68 _gszr_main.Add(__szr_prep, 1, wx.EXPAND, 0) 69 __lbl_components = wx.StaticText(self, -1, _("Components")) 70 __lbl_components.SetForegroundColour(wx.Colour(255, 0, 0)) 71 _gszr_main.Add(__lbl_components, 0, wx.TOP, 3) 72 __szr_components.Add(self._TCTRL_components, 1, wx.RIGHT|wx.EXPAND, 5) 73 __szr_buttons.Add(self._BTN_add_component, 0, wx.BOTTOM|wx.ALIGN_CENTER_HORIZONTAL, 5) 74 __szr_buttons.Add(self._BTN_remove_component, 0, wx.ALIGN_CENTER_HORIZONTAL, 5) 75 __szr_components.Add(__szr_buttons, 0, 0, 0) 76 _gszr_main.Add(__szr_components, 1, wx.TOP|wx.EXPAND, 3) 77 __lbl_atc = wx.StaticText(self, -1, _("ATC code")) 78 _gszr_main.Add(__lbl_atc, 0, wx.ALIGN_CENTER_VERTICAL, 0) 79 _gszr_main.Add(self._PRW_atc, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 80 __lbl_external_code = wx.StaticText(self, -1, _("External code")) 81 _gszr_main.Add(__lbl_external_code, 0, wx.ALIGN_CENTER_VERTICAL, 0) 82 __szr_external_code.Add(self._TCTRL_external_code, 1, wx.RIGHT|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 10) 83 __lbl_external_code_type = wx.StaticText(self, -1, _("Type:")) 84 __szr_external_code.Add(__lbl_external_code_type, 0, wx.RIGHT|wx.ALIGN_CENTER_VERTICAL, 5) 85 __szr_external_code.Add(self._PRW_external_code_type, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0) 86 _gszr_main.Add(__szr_external_code, 1, wx.EXPAND, 0) 87 self.SetSizer(_gszr_main) 88 _gszr_main.Fit(self) 89 _gszr_main.AddGrowableRow(2) 90 _gszr_main.AddGrowableCol(1)
91 # end wxGlade 92
93 - def _on_add_component_button_pressed(self, event): # wxGlade: wxgBrandedDrugEAPnl.<event_handler>
94 print "Event handler `_on_add_component_button_pressed' not implemented!" 95 event.Skip()
96
97 - def _on_remove_component_button_pressed(self, event): # wxGlade: wxgBrandedDrugEAPnl.<event_handler>
98 print "Event handler `_on_remove_component_button_pressed' not implemented!" 99 event.Skip() 100 101 # end of class wxgBrandedDrugEAPnl 102