#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.6.8
#

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"] = wx.NO_BORDER | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		self._TCTRL_title = cTextCtrl(self, wx.ID_ANY, "", style=wx.NO_BORDER)
		self._TCTRL_hint = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.NO_BORDER)
		self._TCTRL_query = cTextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.NO_BORDER)
		self._TCTRL_source = cTextCtrl(self, wx.ID_ANY, "", style=wx.NO_BORDER)
		self._TCTRL_url = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_AUTO_URL | wx.NO_BORDER)
		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, _("is &active"))

		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.SetToolTipString(_("Required: A concise, unique title for this automatic hint."))
		self._TCTRL_hint.SetToolTipString(_("Required: The full text to be displayed when the conditions for this automatic hint apply."))
		self._TCTRL_query.SetToolTipString(_("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_source.SetToolTipString(_("Required: Who is responsible for this automatic hint (inhouse and possibly externally)."))
		self._TCTRL_url.SetToolTipString(_("Optional: An URL under which additional information can be found."))
		self._BTN_check_url.SetToolTipString(_("Explicitely check the URL given."))
		self._CHBOX_is_active.SetToolTipString(_("Whether or not this automatic hint is active. If not active it will not be displayed even if the SQL-defined conditions do match."))
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgAutoHintEAPnl.__do_layout
		_gszr_main = wx.FlexGridSizer(6, 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, 0, 0)
		_gszr_main.Add(self._TCTRL_hint, 1, wx.EXPAND, 0)
		__lbl_query = wx.StaticText(self, wx.ID_ANY, _("Conditions\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, 0, 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_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.RIGHT | wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 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, 0)
		_gszr_main.Add(__szr_options, 1, wx.EXPAND, 0)
		self.SetSizer(_gszr_main)
		_gszr_main.Fit(self)
		_gszr_main.AddGrowableRow(2)
		_gszr_main.AddGrowableCol(1)
		# 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
