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

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
from Gnumed.wxpython.gmPhraseWheel import cPhraseWheel
from Gnumed.wxpython.gmDateTimeInput import cFuzzyTimestampInput
from Gnumed.wxpython.gmOrganizationWidgets import cOrgUnitPhraseWheel
from Gnumed.wxpython.gmTextCtrl import cTextCtrl
from Gnumed.wxpython.gmDocumentWidgets import cDocumentPhraseWheel
from Gnumed.wxpython.gmHospitalStayWidgets import cHospitalStayPhraseWheel
from Gnumed.wxpython.gmEMRStructWidgets import cEpisodeSelectionPhraseWheel
from Gnumed.wxpython.gmCodingWidgets import cGenericCodesPhraseWheel
# end wxGlade


class wxgProcedureEAPnl(wx.ScrolledWindow):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgProcedureEAPnl.__init__
		kwds["style"] = wx.BORDER_NONE | wx.TAB_TRAVERSAL
		wx.ScrolledWindow.__init__(self, *args, **kwds)
		self._PRW_procedure = cPhraseWheel(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self._DPRW_date = cFuzzyTimestampInput(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self._DPRW_end = cFuzzyTimestampInput(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self._CHBOX_ongoing = wx.CheckBox(self, wx.ID_ANY, _("Ongoing"))
		self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
		self._PRW_location = cOrgUnitPhraseWheel(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self._BTN_add_location = wx.Button(self, wx.ID_ANY, _("+"), style=wx.BU_EXACTFIT)
		self._PRW_episode = cEpisodeSelectionPhraseWheel(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self.static_line_2 = wx.StaticLine(self, wx.ID_ANY)
		self._PRW_hospital_stay = cHospitalStayPhraseWheel(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self._BTN_add_stay = wx.Button(self, wx.ID_ANY, _("+"), style=wx.BU_EXACTFIT)
		self._LBL_hospital_details = wx.StaticText(self, wx.ID_ANY, "")
		self._TCTRL_comment = cTextCtrl(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self._PRW_document = cDocumentPhraseWheel(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
		self._PRW_codes = cGenericCodesPhraseWheel(self, wx.ID_ANY, "", style=wx.BORDER_NONE)

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_CHECKBOX, self._on_ongoing_checkbox_checked, self._CHBOX_ongoing)
		self.Bind(wx.EVT_BUTTON, self._on_add_location_button_pressed, self._BTN_add_location)
		self.Bind(wx.EVT_BUTTON, self._on_add_hospital_stay_button_pressed, self._BTN_add_stay)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgProcedureEAPnl.__set_properties
		self.SetScrollRate(10, 10)
		self._PRW_procedure.SetToolTipString(_("The actual procedure performed on the patient."))
		self._DPRW_date.SetToolTipString(_("When did this procedure take place ?"))
		self._DPRW_end.SetToolTipString(_("When did this procedure end ?\n\nLeave empty for ongoing or \"one-off\" procedures without a significant duration."))
		self._CHBOX_ongoing.SetToolTipString(_("Select if procedure is ongoing (say, desensibilization)."))
		self._PRW_location.SetToolTipString(_("The location (praxis, clinic, ...) this procedure was performed at.\n\nMutually exclusive with \"Hospitalization\". Requires \"Episode\"."))
		self._BTN_add_location.SetToolTipString(_("Manage organizations and units."))
		self._PRW_episode.SetToolTipString(_("Select, or enter for creation, the episode to which this procedure will relate.\n\nMutually exclusive with \"Hospitalization\". Requires \"Location\"."))
		self._PRW_hospital_stay.SetToolTipString(_("During which hospitalization was this procedure performed."))
		self._BTN_add_stay.SetToolTipString(_("Add a hospitalization."))
		self._TCTRL_comment.SetToolTipString(_("A comment on the procedure (say, the relevant outcome)."))
		self._PRW_document.SetToolTipString(_("The document most relevant to this procedure (say, the most recent one)."))
		self._PRW_codes.SetToolTipString(_("Codes relevant to this procedure."))
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgProcedureEAPnl.__do_layout
		_gszr_main = wx.FlexGridSizer(12, 2, 1, 3)
		__szr_stay = wx.BoxSizer(wx.HORIZONTAL)
		__szr_location = wx.BoxSizer(wx.HORIZONTAL)
		__szr_end_details = wx.BoxSizer(wx.HORIZONTAL)
		__lbl_procedure = wx.StaticText(self, wx.ID_ANY, _("Procedure"))
		__lbl_procedure.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_procedure, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_procedure, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_date = wx.StaticText(self, wx.ID_ANY, _("Date"))
		__lbl_date.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_date, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._DPRW_date, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_end = wx.StaticText(self, wx.ID_ANY, _("End"))
		_gszr_main.Add(__lbl_end, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_end_details.Add(self._DPRW_end, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 10)
		__szr_end_details.Add(self._CHBOX_ongoing, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(__szr_end_details, 1, wx.EXPAND, 0)
		_gszr_main.Add((20, 20), 0, wx.EXPAND, 0)
		_gszr_main.Add(self.static_line_1, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT | wx.RIGHT, 5)
		__lbl_location = wx.StaticText(self, wx.ID_ANY, _("Location"))
		__lbl_location.SetForegroundColour(wx.Colour(255, 127, 0))
		_gszr_main.Add(__lbl_location, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_location.Add(self._PRW_location, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
		__szr_location.Add(self._BTN_add_location, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(__szr_location, 1, wx.EXPAND, 0)
		__lbl_episode = wx.StaticText(self, wx.ID_ANY, _("and Episode"))
		__lbl_episode.SetForegroundColour(wx.Colour(255, 127, 0))
		_gszr_main.Add(__lbl_episode, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_episode, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_or = wx.StaticText(self, wx.ID_ANY, _("... or ..."))
		__lbl_or.SetForegroundColour(wx.Colour(255, 0, 0))
		_gszr_main.Add(__lbl_or, 0, wx.ALIGN_CENTER, 0)
		_gszr_main.Add(self.static_line_2, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.LEFT | wx.RIGHT, 20)
		__lbl_stay = wx.StaticText(self, wx.ID_ANY, _("Hospitalization"))
		__lbl_stay.SetForegroundColour(wx.Colour(255, 127, 0))
		_gszr_main.Add(__lbl_stay, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		__szr_stay.Add(self._PRW_hospital_stay, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 5)
		__szr_stay.Add(self._BTN_add_stay, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(__szr_stay, 1, wx.EXPAND, 0)
		_gszr_main.Add((20, 20), 0, wx.EXPAND, 0)
		_gszr_main.Add(self._LBL_hospital_details, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_comment = wx.StaticText(self, wx.ID_ANY, _("Comment"))
		_gszr_main.Add(__lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._TCTRL_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		__lbl_document = wx.StaticText(self, wx.ID_ANY, _("Document"))
		_gszr_main.Add(__lbl_document, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_document, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		_lbl_codes = wx.StaticText(self, wx.ID_ANY, _("Codes"))
		_gszr_main.Add(_lbl_codes, 0, wx.ALIGN_CENTER_VERTICAL, 0)
		_gszr_main.Add(self._PRW_codes, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
		self.SetSizer(_gszr_main)
		_gszr_main.Fit(self)
		_gszr_main.AddGrowableCol(1)
		self.Layout()
		# end wxGlade

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

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

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

# end of class wxgProcedureEAPnl
