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

# Source Code for Module Gnumed.wxGladeWidgets.wxgEditStaffListDlg

      1  #!/usr/bin/env python
      2  # -*- coding: iso-8859-15 -*-
      3  # generated by wxGlade 0.6.3 from "/home/ncq/Projekte/gm-cvs/branches/HEAD/gnumed/gnumed/client/wxg/wxgEditStaffListDlg.wxg"
      4
      5  import wx
      6
      7  # begin wxGlade: extracode
      8  # end wxGlade
      9
     10
     11
     12 -class wxgEditStaffListDlg(wx.Dialog):
     13 -    def __init__(self, *args, **kwds):
     14          # begin wxGlade: wxgEditStaffListDlg.__init__
     15          kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME
     16          wx.Dialog.__init__(self, *args, **kwds)
     17          self._LCTRL_staff = wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.LC_ALIGN_LEFT|wx.LC_SINGLE_SEL|wx.LC_SORT_ASCENDING|wx.NO_BORDER)
     18          self._TCTRL_name = wx.TextCtrl(self, -1, "", style=wx.TE_READONLY|wx.NO_BORDER)
     19          self._TCTRL_alias = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
     20          self._TCTRL_account = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
     21          self._TCTRL_comment = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
     22          self._btn_save = wx.Button(self, -1, _("Save"))
     23          self._btn_activate = wx.Button(self, -1, _("Activate"))
     24          self._btn_deactivate = wx.Button(self, -1, _("Deactivate"))
     25          self._btn_delete = wx.Button(self, -1, _("Delete"))
     26          self._btn_close = wx.Button(self, wx.ID_CANCEL, _("Close"))
     27
     28          self.__set_properties()
     29          self.__do_layout()
     30
     31          self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self._on_listitem_deselected, self._LCTRL_staff)
     32          self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_listitem_selected, self._LCTRL_staff)
     33          self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._btn_save)
     34          self.Bind(wx.EVT_BUTTON, self._on_activate_button_pressed, self._btn_activate)
     35          self.Bind(wx.EVT_BUTTON, self._on_deactivate_button_pressed, self._btn_deactivate)
     36          self.Bind(wx.EVT_BUTTON, self._on_delete_button_pressed, self._btn_delete)
     37          # end wxGlade
     38
     39 -    def __set_properties(self):
     40          # begin wxGlade: wxgEditStaffListDlg.__set_properties
     41          self.SetTitle(_("Edit staff list"))
     42          self.SetSize((640, 480))
     43          self._LCTRL_staff.SetToolTipString(_("The list of currently existing GNUmed users."))
     44          self._LCTRL_staff.SetFocus()
     45          self._TCTRL_name.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
     46          self._TCTRL_alias.SetToolTipString(_("Short alias for the GNUmed user. Must be unique for this system."))
     47          self._TCTRL_account.SetToolTipString(_("The database account for this GNUmed user. Note that you cannot change your *own* database account."))
     48          self._TCTRL_comment.SetToolTipString(_("A short comment on this GNUmed user."))
     49          self._btn_save.SetToolTipString(_("Save modified user details.\n\nYou will need to know the password for the GNUmed database administrator <gm-dbo>."))
     50          self._btn_save.Enable(False)
     51          self._btn_activate.SetToolTipString(_("Activate selected user.\n\nYou will need to know the password for the GNUmed database administrator <gm-dbo>."))
     52          self._btn_activate.Enable(False)
     53          self._btn_deactivate.SetToolTipString(_("Deactivate selected user.\n\nYou will need to know the password for the GNUmed database administrator <gm-dbo>."))
     54          self._btn_deactivate.Enable(False)
     55          self._btn_delete.SetToolTipString(_("Entirely remove the GNUmed user (including the database account).\n\nThis will only be possible if no patient data was saved under this account. If any data exists the entry will be deactivated instead.\n\nYou will need to know the password for the GNUmed database administrator <gm-dbo>."))
     56          self._btn_delete.Enable(False)
     57          self._btn_close.SetToolTipString(_("Close this dialog."))
     58          self._btn_close.SetDefault()
     59          # end wxGlade
     60
     61 -    def __do_layout(self):
     62          # begin wxGlade: wxgEditStaffListDlg.__do_layout
     63          __szr_main = wx.BoxSizer(wx.VERTICAL)
     64          __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     65          _gszr_staff_editor = wx.FlexGridSizer(4, 2, 2, 2)
     66          __szr_main.Add(self._LCTRL_staff, 1, wx.EXPAND, 0)
     67          _lbl_name = wx.StaticText(self, -1, _("Name"))
     68          _gszr_staff_editor.Add(_lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     69          _gszr_staff_editor.Add(self._TCTRL_name, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
     70          _lbl_alias = wx.StaticText(self, -1, _("Alias"))
     71          _gszr_staff_editor.Add(_lbl_alias, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     72          _gszr_staff_editor.Add(self._TCTRL_alias, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
     73          _lbl_account = wx.StaticText(self, -1, _("Account"))
     74          _gszr_staff_editor.Add(_lbl_account, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     75          _gszr_staff_editor.Add(self._TCTRL_account, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
     76          _lbl_comment = wx.StaticText(self, -1, _("Comment"))
     77          _gszr_staff_editor.Add(_lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     78          _gszr_staff_editor.Add(self._TCTRL_comment, 0, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
     79          _gszr_staff_editor.AddGrowableCol(1)
     80          __szr_main.Add(_gszr_staff_editor, 0, wx.ALL|wx.EXPAND, 2)
     81          __szr_buttons.Add(self._btn_save, 0, 0, 0)
     82          __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     83          __szr_buttons.Add(self._btn_activate, 0, 0, 0)
     84          __szr_buttons.Add(self._btn_deactivate, 0, 0, 0)
     85          __szr_buttons.Add(self._btn_delete, 0, 0, 0)
     86          __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     87          __szr_buttons.Add(self._btn_close, 0, 0, 0)
     88          __szr_main.Add(__szr_buttons, 0, wx.EXPAND, 0)
     89          self.SetSizer(__szr_main)
     90          self.Layout()
     91          self.Centre()
     92          # end wxGlade
     93
     94 -    def _on_listitem_deselected(self, event): # wxGlade: wxgEditStaffListDlg.<event_handler>
     95          print "Event handler `_on_listitem_deselected' not implemented!"
     96          event.Skip()
     97
     98 -    def _on_listitem_selected(self, event): # wxGlade: wxgEditStaffListDlg.<event_handler>
     99          print "Event handler `_on_listitem_selected' not implemented!"
    100          event.Skip()
    101
    102 -    def _on_save_button_pressed(self, event): # wxGlade: wxgEditStaffListDlg.<event_handler>
    103          print "Event handler `_on_save_button_pressed' not implemented!"
    104          event.Skip()
    105
    106 -    def _on_activate_button_pressed(self, event): # wxGlade: wxgEditStaffListDlg.<event_handler>
    107          print "Event handler `_on_activate_button_pressed' not implemented!"
    108          event.Skip()
    109
    110 -    def _on_deactivate_button_pressed(self, event): # wxGlade: wxgEditStaffListDlg.<event_handler>
    111          print "Event handler `_on_deactivate_button_pressed' not implemented!"
    112          event.Skip()
    113
    114 -    def _on_delete_button_pressed(self, event): # wxGlade: wxgEditStaffListDlg.<event_handler>
    115          print "Event handler `_on_delete_button_pressed' not implemented!"
    116          event.Skip()
    117
    118  # end of class wxgEditStaffListDlg
    119
    120
    121  if __name__ == "__main__":
    122      import gettext
    123      gettext.install("app") # replace with the appropriate catalog name
    124
    125      app = wx.PySimpleApp(0)
    126      wx.InitAllImageHandlers()
    127      dialog_1 = wxgEditStaffListDlg(None, -1, "")
    128      app.SetTopWindow(dialog_1)
    129      dialog_1.Show()
    130      app.MainLoop()
    131