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

import wx
import wx.adv

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
# end wxGlade


class wxgDrugProductEAPnl(wx.ScrolledWindow):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgDrugProductEAPnl.__init__
		kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		from Gnumed.wxpython.gmSubstanceMgmtWidgets import cDrugProductPhraseWheel
		self._PRW_product_name = cDrugProductPhraseWheel(self, wx.ID_ANY, "")
		from Gnumed.wxpython.gmMedicationWidgets import cSubstancePreparationPhraseWheel
		self._PRW_preparation = cSubstancePreparationPhraseWheel(self, wx.ID_ANY, "")
		self._CHBOX_is_fake = wx.CheckBox(self, wx.ID_ANY, _("Fake product"))
		self._TCTRL_components = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY)
		self._BTN_manage_components = wx.Button(self, wx.ID_ANY, _("&Manage"), style=wx.BU_EXACTFIT)
		self._HL_atc_list = wx.adv.HyperlinkCtrl(self, wx.ID_ANY, _("ATC Code"), _("http://www.whocc.no/atc_ddd_index/"), style=wx.adv.HL_DEFAULT_STYLE)
		from Gnumed.wxpython.gmATCWidgets import cATCPhraseWheel
		self._PRW_atc = cATCPhraseWheel(self, wx.ID_ANY, "")
		self._TCTRL_external_code = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		from Gnumed.wxpython.gmPhraseWheel import cPhraseWheel
		self._PRW_external_code_type = cPhraseWheel(self, wx.ID_ANY, "", style=wx.TE_READONLY)

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_BUTTON, self._on_manage_components_button_pressed, self._BTN_manage_components)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgDrugProductEAPnl.__set_properties
		self.SetScrollRate(10, 10)
		self._CHBOX_is_fake.SetForegroundColour(wx.Colour(255, 127, 0))
		self._CHBOX_is_fake.SetToolTip(_("Mark as a fake: use if product does not commercially exist and you want to create a \"generic\" product."))
		self._TCTRL_components.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._BTN_manage_components.SetToolTip(_("Manage the components of this drug."))
		self._HL_atc_list.SetToolTip(_("Browse ATC list."))
		self._TCTRL_external_code.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._TCTRL_external_code.SetToolTip(_("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."))
		self._PRW_external_code_type.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
		self._PRW_external_code_type.SetToolTip(_("The type of the external code of this drug, if any."))
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgDrugProductEAPnl.__do_layout
		_gszr_main = wx.FlexGridSizer(6, 2, 1, 3)
		__szr_external_code = wx.BoxSizer(wx.HORIZONTAL)
		__szr_prep = wx.BoxSizer(wx.HORIZONTAL)
		__lbl_name = wx.StaticText(self, wx.ID_ANY, _("Product name"))
		__lbl_name.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_product_name, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_preparation = wx.StaticText(self, wx.ID_ANY, _("Preparation"))
		__lbl_preparation.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_preparation, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_prep.Add(self._PRW_preparation, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 10)
		__szr_prep.Add(self._CHBOX_is_fake, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add(__szr_prep, 1, wx.EXPAND, 0)
		__lbl_components = wx.StaticText(self, wx.ID_ANY, _("Components"))
		__lbl_components.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_components, 0, wx.TOP, 3)
		_gszr_main.Add(self._TCTRL_components, 1, wx.EXPAND | wx.RIGHT, 5)
		_gszr_main.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add(self._BTN_manage_components, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM | wx.TOP, 3)
		_gszr_main.Add(self._HL_atc_list, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_atc, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_external_code = wx.StaticText(self, wx.ID_ANY, _("External code"))
		_gszr_main.Add(__lbl_external_code, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_external_code.Add(self._TCTRL_external_code, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 10)
		__lbl_external_code_type = wx.StaticText(self, wx.ID_ANY, _("Type:"))
		__szr_external_code.Add(__lbl_external_code_type, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
		__szr_external_code.Add(self._PRW_external_code_type, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_gszr_main.Add(__szr_external_code, 1, wx.EXPAND, 0)
		self.SetSizer(_gszr_main)
		_gszr_main.Fit(self)
		_gszr_main.AddGrowableRow(2)
		_gszr_main.AddGrowableCol(1)
		self.Layout()
		# end wxGlade

	def _on_manage_components_button_pressed(self, event):  # wxGlade: wxgDrugProductEAPnl.<event_handler>
		print("Event handler '_on_manage_components_button_pressed' not implemented!")
		event.Skip()

# end of class wxgDrugProductEAPnl
