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

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
from Gnumed.wxpython.gmTextCtrl import cTextCtrl
# end wxGlade


class wxgAutoHintEAPnl(wx.ScrolledWindow):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgAutoHintEAPnl.__init__
		kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		self._TCTRL_title = cTextCtrl(self, wx.ID_ANY, "")
		self._TCTRL_hint = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
		self._TCTRL_source = cTextCtrl(self, wx.ID_ANY, "")
		self._TCTRL_query = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
		self._TCTRL_recommendation_query = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
		self._TCTRL_url = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_AUTO_URL)
		self._BTN_check_url = wx.Button(self, wx.ID_ANY, _("Chec&k"), style=wx.BU_EXACTFIT)
		self._CHBOX_is_active = wx.CheckBox(self, wx.ID_ANY, _("&Active"), style=wx.CHK_2STATE)
		self._CHBOX_highlight = wx.CheckBox(self, wx.ID_ANY, _("&Highlight"), style=wx.CHK_2STATE)
		self._RBTN_popup_none = wx.RadioButton(self, wx.ID_ANY, _("None"))
		self._RBTN_popup_single = wx.RadioButton(self, wx.ID_ANY, _("Individual"))
		self._RBTN_popup_multiple = wx.RadioButton(self, wx.ID_ANY, _("Aggregate"))

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_BUTTON, self._on_check_url_button_pressed, self._BTN_check_url)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgAutoHintEAPnl.__set_properties
		self.SetScrollRate(10, 10)
		self._TCTRL_title.SetToolTip(_("Required: A concise, unique title for this automatic hint."))
		self._TCTRL_hint.SetToolTip(_("Required: The full text to be displayed when the conditions for this automatic hint apply."))
		self._TCTRL_source.SetToolTip(_("Required: Who is responsible for this automatic hint (inhouse and possibly externally)."))
		self._TCTRL_query.SetToolTip(_("Required: The SQL query to be run for checking whether this automatic hint applies and should be displayed.\n\nMust return TRUE / FALSE.\n\nAny occurrence of ID_ACTIVE_PATIENT will be replaced by the internal GNUmed ID of the currently active patient."))
		self._TCTRL_recommendation_query.SetToolTip(_("Optional: The SQL query to be run for retrieving further information and perhaps a recommendation in case this automatic hint applies.\n\nMust return NULL or a string (TEXT).\n\nAny occurrence of ID_ACTIVE_PATIENT will be replaced by the internal GNUmed ID of the currently active patient."))
		self._TCTRL_url.SetToolTip(_("Optional: An URL under which additional information can be found."))
		self._BTN_check_url.SetToolTip(_("Explicitely check the URL given."))
		self._CHBOX_is_active.SetToolTip(_("Whether or not this automatic hint is active. If not active it will not be displayed even if the SQL-defined conditions do match.\n\nCave: This setting applies across ALL PATIENTS."))
		self._CHBOX_is_active.SetValue(1)
		self._CHBOX_highlight.SetToolTip(_("Whether or not to highlight this hint among others (where deemed appropriate)."))
		self._CHBOX_highlight.SetValue(1)
		self._RBTN_popup_none.SetToolTip(_("Do not show this hint with a popup."))
		self._RBTN_popup_single.SetToolTip(_("Show hint in individual popup."))
		self._RBTN_popup_multiple.SetToolTip(_("Show hint with other hints in aggregate popup."))
		self._RBTN_popup_multiple.SetValue(1)
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgAutoHintEAPnl.__do_layout
		_gszr_main = wx.FlexGridSizer(7, 2, 1, 3)
		__szr_options = wx.BoxSizer(wx.HORIZONTAL)
		__szr_url = wx.BoxSizer(wx.HORIZONTAL)
		__lbl_title = wx.StaticText(self, wx.ID_ANY, _("Title"))
		__lbl_title.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_title, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_title, 0, wx.EXPAND, 0)
		__lbl_hint = wx.StaticText(self, wx.ID_ANY, _("Description"))
		__lbl_hint.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_hint, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_hint, 1, wx.EXPAND, 0)
		__lbl_source = wx.StaticText(self, wx.ID_ANY, _("Source"))
		__lbl_source.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_source, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_source, 0, wx.EXPAND, 0)
		__lbl_query = wx.StaticText(self, wx.ID_ANY, _("Applicability\ncheck\n(SQL query)"))
		__lbl_query.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_query, 0, 0, 0)
		_gszr_main.Add(self._TCTRL_query, 2, wx.EXPAND, 0)
		__lbl_recommendation_query = wx.StaticText(self, wx.ID_ANY, _("Retrieval of\nrecommendation\n(SQL query)"))
		_gszr_main.Add(__lbl_recommendation_query, 0, 0, 0)
		_gszr_main.Add(self._TCTRL_recommendation_query, 2, wx.EXPAND, 0)
		__lbl_url = wx.StaticText(self, wx.ID_ANY, _("URL"))
		_gszr_main.Add(__lbl_url, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_url.Add(self._TCTRL_url, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 3)
		__szr_url.Add(self._BTN_check_url, 0, 0, 0)
		_gszr_main.Add(__szr_url, 1, wx.EXPAND, 0)
		__lbl_options = wx.StaticText(self, wx.ID_ANY, _("Options"))
		_gszr_main.Add(__lbl_options, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_options.Add(self._CHBOX_is_active, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
		__szr_options.Add(self._CHBOX_highlight, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
		__szr_options.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_popup_type = wx.StaticText(self, wx.ID_ANY, _("Popup:"))
		__szr_options.Add(__lbl_popup_type, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
		__szr_options.Add(self._RBTN_popup_none, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
		__szr_options.Add(self._RBTN_popup_single, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
		__szr_options.Add(self._RBTN_popup_multiple, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
		__szr_options.Add((20, 20), 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__szr_options.Add((0, 0), 0, 0, 0)
		_gszr_main.Add(__szr_options, 1, wx.EXPAND, 0)
		self.SetSizer(_gszr_main)
		_gszr_main.Fit(self)
		_gszr_main.AddGrowableRow(1)
		_gszr_main.AddGrowableRow(3)
		_gszr_main.AddGrowableRow(4)
		_gszr_main.AddGrowableCol(1)
		self.Layout()
		# end wxGlade

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

# end of class wxgAutoHintEAPnl
