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

# Source Code for Module Gnumed.wxGladeWidgets.wxgMergePatientsDlg

     1  #!/usr/bin/env python
     2  # -*- coding: utf-8 -*-
     3  # generated by wxGlade 0.6.3 from "/home/ncq/Projekte/gm-cvs/branches/HEAD/gnumed/gnumed/client/wxg/wxgMergePatientsDlg.wxg"
     4
     5  import wx
     6
     7  # begin wxGlade: extracode
     8  # end wxGlade
     9
    10
    11
    12 -class wxgMergePatientsDlg(wx.Dialog):
    13 -    def __init__(self, *args, **kwds):
    14
    15          from Gnumed.wxpython import gmPatSearchWidgets
    16
    17          # begin wxGlade: wxgMergePatientsDlg.__init__
    18          kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.THICK_FRAME
    19          wx.Dialog.__init__(self, *args, **kwds)
    20          self._TCTRL_patient1 = gmPatSearchWidgets.cPersonSearchCtrl(self, -1, "", style=wx.NO_BORDER)
    21          self._TCTRL_patient1_details = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER)
    22          self._RBTN_patient1 = wx.RadioButton(self, -1, _("Keep *this* patient"), style=wx.RB_USE_CHECKBOX)
    23          self._TCTRL_patient2 = gmPatSearchWidgets.cPersonSearchCtrl(self, -1, "", style=wx.NO_BORDER)
    24          self._TCTRL_patient2_details = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER)
    25          self._RBTN_patient2 = wx.RadioButton(self, -1, _("Keep *this* patient"), style=wx.RB_USE_CHECKBOX)
    26          self._BTN_merge = wx.Button(self, -1, _("Merge"))
    27          self._BTN_cancel = wx.Button(self, wx.ID_CANCEL, "")
    28
    29          self.__set_properties()
    30          self.__do_layout()
    31
    32          self.Bind(wx.EVT_BUTTON, self._on_merge_button_pressed, self._BTN_merge)
    33          # end wxGlade
    34
    35 -    def __set_properties(self):
    36          # begin wxGlade: wxgMergePatientsDlg.__set_properties
    37          self.SetTitle(_("Merging patients"))
    38          self._TCTRL_patient1_details.Enable(False)
    39          self._RBTN_patient1.SetToolTipString(_("Select this if you want to keep this patient."))
    40          self._RBTN_patient1.SetValue(1)
    41          self._TCTRL_patient2_details.Enable(False)
    42          self._RBTN_patient2.SetToolTipString(_("Select this if you want to keep this patient."))
    43          self._BTN_cancel.SetFocus()
    44          self._BTN_cancel.SetDefault()
    45          # end wxGlade
    46
    47 -    def __do_layout(self):
    48          # begin wxGlade: wxgMergePatientsDlg.__do_layout
    49          __szr_main = wx.BoxSizer(wx.VERTICAL)
    50          __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
    51          __szr_details = wx.BoxSizer(wx.HORIZONTAL)
    52          __szr_details_right = wx.BoxSizer(wx.VERTICAL)
    53          __szr_details_left = wx.BoxSizer(wx.VERTICAL)
    54          __lbl_msg = wx.StaticText(self, -1, _("Details of the patients to merge:"), style=wx.ALIGN_CENTRE)
    55          __szr_main.Add(__lbl_msg, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 5)
    56          __szr_details_left.Add(self._TCTRL_patient1, 0, wx.EXPAND, 0)
    57          __szr_details_left.Add(self._TCTRL_patient1_details, 1, wx.EXPAND, 0)
    58          __szr_details_left.Add(self._RBTN_patient1, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 3)
    59          __szr_details.Add(__szr_details_left, 1, wx.EXPAND, 0)
    60          __divider_top = wx.StaticLine(self, -1, style=wx.LI_VERTICAL)
    61          __szr_details.Add(__divider_top, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 5)
    62          __szr_details_right.Add(self._TCTRL_patient2, 0, wx.EXPAND, 0)
    63          __szr_details_right.Add(self._TCTRL_patient2_details, 1, wx.EXPAND, 0)
    64          __szr_details_right.Add(self._RBTN_patient2, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 3)
    65          __szr_details.Add(__szr_details_right, 1, wx.EXPAND, 0)
    66          __szr_main.Add(__szr_details, 1, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 5)
    67          __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
    68          __szr_buttons.Add(self._BTN_merge, 0, wx.EXPAND, 0)
    69          __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
    70          __szr_buttons.Add(self._BTN_cancel, 0, wx.EXPAND, 0)
    71          __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
    72          __szr_main.Add(__szr_buttons, 0, wx.ALL|wx.EXPAND, 5)
    73          self.SetSizer(__szr_main)
    74          __szr_main.Fit(self)
    75          self.Layout()
    76          # end wxGlade
    77
    78 -    def _on_merge_button_pressed(self, event): # wxGlade: wxgMergePatientsDlg.<event_handler>
    79          print "Event handler `_on_merge_button_pressed' not implemented"
    80          event.Skip()
    81
    82  # end of class wxgMergePatientsDlg
    83
    84
    85  if __name__ == "__main__":
    86      import gettext
    87      gettext.install("app") # replace with the appropriate catalog name
    88
    89      app = wx.PySimpleApp(0)
    90      wx.InitAllImageHandlers()
    91      dialog_1 = wxgMergePatientsDlg(None, -1, "")
    92      app.SetTopWindow(dialog_1)
    93      dialog_1.Show()
    94      app.MainLoop()
    95