Package Gnumed :: Package wxGladeWidgets :: Module wxgMergePatientsDlg
[frames] | no frames]

Source Code for Module Gnumed.wxGladeWidgets.wxgMergePatientsDlg

 1  # -*- coding: UTF-8 -*- 
 2  # 
 3  # generated by wxGlade 
 4  # 
 5   
 6  import wx 
 7   
 8  # begin wxGlade: dependencies 
 9  import gettext 
10  # end wxGlade 
11   
12  # begin wxGlade: extracode 
13  # end wxGlade 
14   
15   
16 -class wxgMergePatientsDlg(wx.Dialog):
17 - def __init__(self, *args, **kwds):
18 # begin wxGlade: wxgMergePatientsDlg.__init__ 19 kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER 20 wx.Dialog.__init__(self, *args, **kwds) 21 from Gnumed.wxpython.gmPatSearchWidgets import cPersonSearchCtrl 22 self._TCTRL_patient1 = cPersonSearchCtrl(self, wx.ID_ANY, "") 23 self._TCTRL_patient1_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY) 24 self._RBTN_patient1 = wx.RadioButton(self, wx.ID_ANY, _("Keep *this* patient")) 25 self._TCTRL_patient2 = cPersonSearchCtrl(self, wx.ID_ANY, "") 26 self._TCTRL_patient2_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY) 27 self._RBTN_patient2 = wx.RadioButton(self, wx.ID_ANY, _("Keep *this* patient")) 28 self._BTN_merge = wx.Button(self, wx.ID_ANY, _("Merge")) 29 self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "") 30 31 self.__set_properties() 32 self.__do_layout() 33 34 self.Bind(wx.EVT_BUTTON, self._on_merge_button_pressed, self._BTN_merge)
35 # end wxGlade 36
37 - def __set_properties(self):
38 # begin wxGlade: wxgMergePatientsDlg.__set_properties 39 self.SetTitle(_("Merging patients")) 40 self._TCTRL_patient1_details.Enable(False) 41 self._RBTN_patient1.SetToolTip(_("Select this if you want to keep this patient.")) 42 self._RBTN_patient1.SetValue(1) 43 self._TCTRL_patient2_details.Enable(False) 44 self._RBTN_patient2.SetToolTip(_("Select this if you want to keep this patient.")) 45 self._BTN_cancel.SetFocus() 46 self._BTN_cancel.SetDefault()
47 # end wxGlade 48
49 - def __do_layout(self):
50 # begin wxGlade: wxgMergePatientsDlg.__do_layout 51 __szr_main = wx.BoxSizer(wx.VERTICAL) 52 __szr_buttons = wx.BoxSizer(wx.HORIZONTAL) 53 __szr_details = wx.BoxSizer(wx.HORIZONTAL) 54 __szr_details_right = wx.BoxSizer(wx.VERTICAL) 55 __szr_details_left = wx.BoxSizer(wx.VERTICAL) 56 __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.")) 57 __szr_main.Add(__lbl_instructions, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) 58 __lbl_msg = wx.StaticText(self, wx.ID_ANY, _("Details of the patients to merge")) 59 __szr_main.Add(__lbl_msg, 0, wx.ALIGN_CENTER | wx.LEFT | wx.RIGHT | wx.TOP, 5) 60 __szr_details_left.Add(self._TCTRL_patient1, 0, wx.EXPAND, 0) 61 __szr_details_left.Add(self._TCTRL_patient1_details, 1, wx.EXPAND, 0) 62 __szr_details_left.Add(self._RBTN_patient1, 0, wx.ALIGN_CENTER | wx.TOP, 3) 63 __szr_details.Add(__szr_details_left, 1, wx.EXPAND, 0) 64 __divider_top = wx.StaticLine(self, wx.ID_ANY, style=wx.LI_VERTICAL) 65 __szr_details.Add(__divider_top, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) 66 __szr_details_right.Add(self._TCTRL_patient2, 0, wx.EXPAND, 0) 67 __szr_details_right.Add(self._TCTRL_patient2_details, 1, wx.EXPAND, 0) 68 __szr_details_right.Add(self._RBTN_patient2, 0, wx.ALIGN_CENTER | wx.TOP, 3) 69 __szr_details.Add(__szr_details_right, 1, wx.EXPAND, 0) 70 __szr_main.Add(__szr_details, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) 71 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0) 72 __szr_buttons.Add(self._BTN_merge, 0, wx.EXPAND, 0) 73 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0) 74 __szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND, 0) 75 __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0) 76 __szr_main.Add(__szr_buttons, 0, wx.ALL | wx.EXPAND, 5) 77 self.SetSizer(__szr_main) 78 __szr_main.Fit(self) 79 self.Layout()
80 # end wxGlade 81
82 - def _on_merge_button_pressed(self, event): # wxGlade: wxgMergePatientsDlg.<event_handler>
83 print("Event handler '_on_merge_button_pressed' not implemented!") 84 event.Skip()
85 86 # end of class wxgMergePatientsDlg 87