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

# Source Code for Module Gnumed.wxGladeWidgets.wxgEditStaffListDlg

      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 wxgEditStaffListDlg(wx.Dialog):
     17 -        def __init__(self, *args, **kwds):
     18                  # begin wxGlade: wxgEditStaffListDlg.__init__
     19                  kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX | wx.RESIZE_BORDER
     20                  wx.Dialog.__init__(self, *args, **kwds)
     21                  self.SetSize((682, 480))
     22                  self._LCTRL_staff = wx.ListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_ALIGN_LEFT | wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_SORT_ASCENDING)
     23                  self._TCTRL_name = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_READONLY)
     24                  self._TCTRL_alias = wx.TextCtrl(self, wx.ID_ANY, "")
     25                  self._TCTRL_account = wx.TextCtrl(self, wx.ID_ANY, "")
     26                  from Gnumed.wxpython.gmStaffWidgets import cUserRolePRW
     27                  self._PRW_user_role = cUserRolePRW(self, wx.ID_ANY, "")
     28                  self._TCTRL_comment = wx.TextCtrl(self, wx.ID_ANY, "")
     29                  self._btn_save = wx.Button(self, wx.ID_ANY, _("Save"))
     30                  self._btn_activate = wx.Button(self, wx.ID_ANY, _("Activate"))
     31                  self._btn_deactivate = wx.Button(self, wx.ID_ANY, _("Deactivate"))
     32                  self._btn_delete = wx.Button(self, wx.ID_ANY, _("Delete"))
     33                  self._btn_close = wx.Button(self, wx.ID_CANCEL, _("Close"))
     34
     35                  self.__set_properties()
     36                  self.__do_layout()
     37
     38                  self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self._on_listitem_deselected, self._LCTRL_staff)
     39                  self.Bind(wx.EVT_LIST_ITEM_SELECTED, self._on_listitem_selected, self._LCTRL_staff)
     40                  self.Bind(wx.EVT_BUTTON, self._on_save_button_pressed, self._btn_save)
     41                  self.Bind(wx.EVT_BUTTON, self._on_activate_button_pressed, self._btn_activate)
     42                  self.Bind(wx.EVT_BUTTON, self._on_deactivate_button_pressed, self._btn_deactivate)
     43                  self.Bind(wx.EVT_BUTTON, self._on_delete_button_pressed, self._btn_delete)
     44                  # end wxGlade
     45
     46 -        def __set_properties(self):
     47                  # begin wxGlade: wxgEditStaffListDlg.__set_properties
     48                  self.SetTitle(_("Edit staff list"))
     49                  self.SetSize((682, 480))
     50                  self._LCTRL_staff.SetToolTip(_("The list of currently existing GNUmed users."))
     51                  self._LCTRL_staff.SetFocus()
     52                  self._TCTRL_name.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
     53                  self._TCTRL_alias.SetToolTip(_("Short alias for the GNUmed user. Must be unique for this system."))
     54                  self._TCTRL_account.SetToolTip(_("The database account for this GNUmed user. Note that you cannot change your *own* database account."))
     55                  self._PRW_user_role.SetToolTip(_("Select the role of this GNUmed staff member.\n\nThe selected role defines the range of access rights."))
     56                  self._TCTRL_comment.SetToolTip(_("A short comment on this GNUmed user."))
     57                  self._btn_save.SetToolTip(_("Save modified user details.\n\nYou will need to know the password for the GNUmed database administrator <gm-dbo>."))
     58                  self._btn_save.Enable(False)
     59                  self._btn_activate.SetToolTip(_("Activate selected user.\n\nYou will need to know the password for the GNUmed database administrator <gm-dbo>."))
     60                  self._btn_activate.Enable(False)
     61                  self._btn_deactivate.SetToolTip(_("Deactivate selected user.\n\nYou will need to know the password for the GNUmed database administrator <gm-dbo>."))
     62                  self._btn_deactivate.Enable(False)
     63                  self._btn_delete.SetToolTip(_("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>."))
     64                  self._btn_delete.Enable(False)
     65                  self._btn_close.SetToolTip(_("Close this dialog."))
     66                  self._btn_close.SetDefault()
     67                  # end wxGlade
     68
     69 -        def __do_layout(self):
     70                  # begin wxGlade: wxgEditStaffListDlg.__do_layout
     71                  __szr_main = wx.BoxSizer(wx.VERTICAL)
     72                  __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
     73                  _gszr_staff_editor = wx.FlexGridSizer(4, 2, 2, 2)
     74                  __szr_account_details = wx.BoxSizer(wx.HORIZONTAL)
     75                  __szr_main.Add(self._LCTRL_staff, 1, wx.EXPAND, 0)
     76                  _lbl_name = wx.StaticText(self, wx.ID_ANY, _("Name"))
     77                  _gszr_staff_editor.Add(_lbl_name, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     78                  _gszr_staff_editor.Add(self._TCTRL_name, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     79                  _lbl_alias = wx.StaticText(self, wx.ID_ANY, _("Alias"))
     80                  _gszr_staff_editor.Add(_lbl_alias, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     81                  _gszr_staff_editor.Add(self._TCTRL_alias, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     82                  _lbl_account = wx.StaticText(self, wx.ID_ANY, _("Account"))
     83                  _gszr_staff_editor.Add(_lbl_account, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     84                  __szr_account_details.Add(self._TCTRL_account, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.RIGHT, 10)
     85                  __lbl_role = wx.StaticText(self, wx.ID_ANY, _("Role:"))
     86                  __szr_account_details.Add(__lbl_role, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
     87                  __szr_account_details.Add(self._PRW_user_role, 1, wx.ALIGN_CENTER_VERTICAL, 0)
     88                  _gszr_staff_editor.Add(__szr_account_details, 1, wx.EXPAND, 0)
     89                  _lbl_comment = wx.StaticText(self, wx.ID_ANY, _("Comment"))
     90                  _gszr_staff_editor.Add(_lbl_comment, 0, wx.ALIGN_CENTER_VERTICAL, 0)
     91                  _gszr_staff_editor.Add(self._TCTRL_comment, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
     92                  _gszr_staff_editor.AddGrowableCol(1)
     93                  __szr_main.Add(_gszr_staff_editor, 0, wx.ALL | wx.EXPAND, 2)
     94                  __szr_buttons.Add(self._btn_save, 0, 0, 0)
     95                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
     96                  __szr_buttons.Add(self._btn_activate, 0, 0, 0)
     97                  __szr_buttons.Add(self._btn_deactivate, 0, 0, 0)
     98                  __szr_buttons.Add(self._btn_delete, 0, 0, 0)
     99                  __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
    100                  __szr_buttons.Add(self._btn_close, 0, 0, 0)
    101                  __szr_main.Add(__szr_buttons, 0, wx.EXPAND, 0)
    102                  self.SetSizer(__szr_main)
    103                  self.Layout()
    104                  self.Centre()
    105                  # end wxGlade
    106
    107 -        def _on_listitem_deselected(self, event):  # wxGlade: wxgEditStaffListDlg.<event_handler>
    108                  print("Event handler '_on_listitem_deselected' not implemented!")
    109                  event.Skip()
    110
    111 -        def _on_listitem_selected(self, event):  # wxGlade: wxgEditStaffListDlg.<event_handler>
    112                  print("Event handler '_on_listitem_selected' not implemented!")
    113                  event.Skip()
    114
    115 -        def _on_save_button_pressed(self, event):  # wxGlade: wxgEditStaffListDlg.<event_handler>
    116                  print("Event handler '_on_save_button_pressed' not implemented!")
    117                  event.Skip()
    118
    119 -        def _on_activate_button_pressed(self, event):  # wxGlade: wxgEditStaffListDlg.<event_handler>
    120                  print("Event handler '_on_activate_button_pressed' not implemented!")
    121                  event.Skip()
    122
    123 -        def _on_deactivate_button_pressed(self, event):  # wxGlade: wxgEditStaffListDlg.<event_handler>
    124                  print("Event handler '_on_deactivate_button_pressed' not implemented!")
    125                  event.Skip()
    126
    127 -        def _on_delete_button_pressed(self, event):  # wxGlade: wxgEditStaffListDlg.<event_handler>
    128                  print("Event handler '_on_delete_button_pressed' not implemented!")
    129                  event.Skip()
    130
    131  # end of class wxgEditStaffListDlg
    132