#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 from "/home/ncq/Projekte/gm-cvs/branches/HEAD/gnumed/gnumed/client/wxg/wxgMergePatientsDlg.wxg"

import wx

# begin wxGlade: extracode
# end wxGlade



class wxgMergePatientsDlg(wx.Dialog):
    def __init__(self, *args, **kwds):

        from Gnumed.wxpython import gmPatSearchWidgets

        # begin wxGlade: wxgMergePatientsDlg.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        wx.Dialog.__init__(self, *args, **kwds)
        self._TCTRL_patient1 = gmPatSearchWidgets.cPersonSearchCtrl(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
        self._TCTRL_patient1_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.BORDER_NONE | wx.TE_READONLY)
        self._RBTN_patient1 = wx.RadioButton(self, wx.ID_ANY, _("Keep *this* patient"))
        self._TCTRL_patient2 = gmPatSearchWidgets.cPersonSearchCtrl(self, wx.ID_ANY, "", style=wx.BORDER_NONE)
        self._TCTRL_patient2_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.BORDER_NONE | 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.SetToolTipString(_("Select this if you want to keep this patient."))
        self._RBTN_patient1.SetValue(1)
        self._TCTRL_patient2_details.Enable(False)
        self._RBTN_patient2.SetToolTipString(_("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


if __name__ == "__main__":
    import gettext
    gettext.install("app") # replace with the appropriate catalog name

    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    dialog_1 = wxgMergePatientsDlg(None, -1, "")
    app.SetTopWindow(dialog_1)
    dialog_1.Show()
    app.MainLoop()
