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

import wx

# begin wxGlade: dependencies
import gettext
# end wxGlade

# begin wxGlade: extracode
# end wxGlade


class wxgMergePatientsDlg(wx.Dialog):
	def __init__(self, *args, **kwds):
		# begin wxGlade: wxgMergePatientsDlg.__init__
		kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
		wx.Dialog.__init__(self, *args, **kwds)
		from Gnumed.wxpython.gmPatSearchWidgets import cPersonSearchCtrl
		self._TCTRL_patient1 = cPersonSearchCtrl(self, wx.ID_ANY, "")
		self._TCTRL_patient1_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		self._RBTN_patient1 = wx.RadioButton(self, wx.ID_ANY, _("Keep *this* patient"))
		self._TCTRL_patient2 = cPersonSearchCtrl(self, wx.ID_ANY, "")
		self._TCTRL_patient2_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
		self._RBTN_patient2 = wx.RadioButton(self, wx.ID_ANY, _("Keep *this* patient"))
		self._BTN_merge = wx.Button(self, wx.ID_ANY, _("Merge"))
		self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")

		self.__set_properties()
		self.__do_layout()

		self.Bind(wx.EVT_BUTTON, self._on_merge_button_pressed, self._BTN_merge)
		# end wxGlade

	def __set_properties(self):
		# begin wxGlade: wxgMergePatientsDlg.__set_properties
		self.SetTitle(_("Merging patients"))
		self._TCTRL_patient1_details.Enable(False)
		self._RBTN_patient1.SetToolTip(_("Select this if you want to keep this patient."))
		self._RBTN_patient1.SetValue(1)
		self._TCTRL_patient2_details.Enable(False)
		self._RBTN_patient2.SetToolTip(_("Select this if you want to keep this patient."))
		self._BTN_cancel.SetFocus()
		self._BTN_cancel.SetDefault()
		# end wxGlade

	def __do_layout(self):
		# begin wxGlade: wxgMergePatientsDlg.__do_layout
		__szr_main = wx.BoxSizer(wx.VERTICAL)
		__szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
		__szr_details = wx.BoxSizer(wx.HORIZONTAL)
		__szr_details_right = wx.BoxSizer(wx.VERTICAL)
		__szr_details_left = wx.BoxSizer(wx.VERTICAL)
		__lbl_instructions = wx.StaticText(self, wx.ID_ANY, _("Search for - and possible select - a patient in both the left and\nthe right field. The left field will initially show the active patient\n(if there is one) but you can select a different patient on the\nleft as well.\n\nNote that you cannot merge the active patient into another\npatient. You can, however, merge another patient into the\nactive one."))
		__szr_main.Add(__lbl_instructions, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5)
		__lbl_msg = wx.StaticText(self, wx.ID_ANY, _("Details of the patients to merge"))
		__szr_main.Add(__lbl_msg, 0, wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.TOP, 5)
		__szr_details_left.Add(self._TCTRL_patient1, 0, wx.EXPAND, 0)
		__szr_details_left.Add(self._TCTRL_patient1_details, 1, wx.EXPAND, 0)
		__szr_details_left.Add(self._RBTN_patient1, 0, wx.ALIGN_CENTER | wx.TOP, 3)
		__szr_details.Add(__szr_details_left, 1, wx.EXPAND, 0)
		__divider_top = wx.StaticLine(self, wx.ID_ANY, style=wx.LI_VERTICAL)
		__szr_details.Add(__divider_top, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 5)
		__szr_details_right.Add(self._TCTRL_patient2, 0, wx.EXPAND, 0)
		__szr_details_right.Add(self._TCTRL_patient2_details, 1, wx.EXPAND, 0)
		__szr_details_right.Add(self._RBTN_patient2, 0, wx.ALIGN_CENTER | wx.TOP, 3)
		__szr_details.Add(__szr_details_right, 1, wx.EXPAND, 0)
		__szr_main.Add(__szr_details, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5)
		__szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
		__szr_buttons.Add(self._BTN_merge, 0, wx.EXPAND, 0)
		__szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
		__szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND, 0)
		__szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
		__szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 5)
		self.SetSizer(__szr_main)
		__szr_main.Fit(self)
		self.Layout()
		# end wxGlade

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

# end of class wxgMergePatientsDlg
