# -*- coding: UTF-8 -*-
#
# generated by wxGlade
#

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
# end wxGlade


class wxgDrugComponentEAPnl(wx.ScrolledWindow):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgDrugComponentEAPnl.__init__
		kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		self._TCTRL_product_name = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		self._TCTRL_components = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
		self._TCTRL_codes = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		from Gnumed.wxpython.gmSubstanceMgmtWidgets import cSubstancePhraseWheel
		self._PRW_substance = cSubstancePhraseWheel(self, wx.ID_ANY, "")
		self._TCTRL_amount = wx.TextCtrl(self, wx.ID_ANY, "")
		from Gnumed.wxpython.gmMeasurementWidgets import cUnitPhraseWheel
		self._PRW_unit = cUnitPhraseWheel(self, wx.ID_ANY, "")

		self.__set_properties()
		self.__do_layout()
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgDrugComponentEAPnl.__set_properties
		self.SetScrollRate(10, 10)
		self._TCTRL_product_name.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._TCTRL_components.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._TCTRL_codes.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		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"))
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgDrugComponentEAPnl.__do_layout
		_gszr_main = wx.FlexGridSizer(5, 2, 1, 3)
		__szr_amount = wx.BoxSizer(wx.HORIZONTAL)
		__lbl_product = wx.StaticText(self, wx.ID_ANY, _("Product"))
		_gszr_main.Add(__lbl_product, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_product_name, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add(self._TCTRL_components, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add(self._TCTRL_codes, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_substance = wx.StaticText(self, wx.ID_ANY, _("Substance"))
		__lbl_substance.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_substance, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_substance, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_amount = wx.StaticText(self, wx.ID_ANY, _("Amount"))
		__lbl_amount.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_amount, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_amount.Add(self._TCTRL_amount, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 10)
		__lbl_unit = wx.StaticText(self, wx.ID_ANY, _("Unit"))
		__lbl_unit.SetForegroundColour(wx.Colour(255, 0, 0))
		__szr_amount.Add(__lbl_unit, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
		__szr_amount.Add(self._PRW_unit, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 10)
		_gszr_main.Add(__szr_amount, 1, wx.EXPAND, 0)
		self.SetSizer(_gszr_main)
		_gszr_main.Fit(self)
		_gszr_main.AddGrowableRow(1)
		_gszr_main.AddGrowableCol(1)
		self.Layout()
		# end wxGlade

# end of class wxgDrugComponentEAPnl
