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

import wx

# begin wxGlade: extracode
# end wxGlade



class wxgAddPatientAsStaffDlg(wx.Dialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: wxgAddPatientAsStaffDlg.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME
        wx.Dialog.__init__(self, *args, **kwds)
        self._TXT_person = wx.TextCtrl(self, -1, _("Data of current patient to be displayed here."), style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_WORDWRAP|wx.NO_BORDER)
        self._TXT_short_alias = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
        self._TXT_account = wx.TextCtrl(self, -1, "", style=wx.NO_BORDER)
        self._TXT_password = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD|wx.NO_BORDER)
        self._TXT_password_again = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD|wx.NO_BORDER)
        self._TXT_dbo_password = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD|wx.NO_BORDER)
        self._BTN_enlist = wx.Button(self, -1, _("Enlist"))
        self._BTN_cancel = wx.Button(self, -1, _("Cancel"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self._on_enlist_button_pressed, self._BTN_enlist)
        self.Bind(wx.EVT_BUTTON, self._on_cancel_button_pressed, self._BTN_cancel)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: wxgAddPatientAsStaffDlg.__set_properties
        self.SetTitle(_("Enlist person as GNUmed user"))
        self._TXT_person.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_GRAYTEXT))
        self._TXT_person.Enable(False)
        self._TXT_short_alias.SetToolTipString(_("A short alias identifying the GNUmed user. It is used in the clinical record among other places."))
        self._TXT_account.SetToolTipString(_("The database account for this user.\n\nThe account will be created in the database with proper access rights. Privacy restrictions are currently hardcoded to membership in the PostgreSQL group \"gm-doctors\".\n\nYou can use the name of an existing account but it must not be used by any other GNUmed user yet."))
        self._TXT_password.SetToolTipString(_("The password for the new database account. Input will not be shown."))
        self._TXT_password.SetFocus()
        self._TXT_password_again.SetToolTipString(_("The database password must be typed again to enable double-checking to protect against typos."))
        self._TXT_dbo_password.SetToolTipString(_("Enlisting GNUmed users is a priviledged operation.\nYou must enter the password for the database administrator \"gm-dbo\" here."))
        self._BTN_enlist.SetToolTipString(_("Enlist this person as a GNUmed user and associate it with the given database account."))
        self._BTN_enlist.SetDefault()
        self._BTN_cancel.SetToolTipString(_("Cancel this dialog, do not enlist new GNUmed user."))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: wxgAddPatientAsStaffDlg.__do_layout
        __szr_main = wx.BoxSizer(wx.VERTICAL)
        __szr_buttons = wx.BoxSizer(wx.HORIZONTAL)
        __gszr_middle = wx.FlexGridSizer(5, 2, 0, 0)
        __lbl_person = wx.StaticText(self, -1, _("The currently selected patient is:"))
        __szr_main.Add(__lbl_person, 0, wx.ALL, 5)
        __szr_main.Add(self._TXT_person, 1, wx.LEFT|wx.RIGHT|wx.EXPAND, 5)
        __lbl_instructions = wx.StaticText(self, -1, _("User parameters:"))
        __szr_main.Add(__lbl_instructions, 0, wx.ALL|wx.EXPAND, 5)
        __lbl_short_alias = wx.StaticText(self, -1, _("Alias"), style=wx.ALIGN_RIGHT)
        __gszr_middle.Add(__lbl_short_alias, 0, wx.RIGHT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 3)
        __gszr_middle.Add(self._TXT_short_alias, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
        __lbl_account = wx.StaticText(self, -1, _("Account"), style=wx.ALIGN_RIGHT)
        __gszr_middle.Add(__lbl_account, 0, wx.RIGHT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 3)
        __gszr_middle.Add(self._TXT_account, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
        __lbl_password = wx.StaticText(self, -1, _("Password"), style=wx.ALIGN_RIGHT)
        __gszr_middle.Add(__lbl_password, 0, wx.RIGHT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 3)
        __gszr_middle.Add(self._TXT_password, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
        __lbl_password_again = wx.StaticText(self, -1, _("Password, again"), style=wx.ALIGN_RIGHT)
        __gszr_middle.Add(__lbl_password_again, 0, wx.RIGHT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 3)
        __gszr_middle.Add(self._TXT_password_again, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
        __lbl_dbo_password = wx.StaticText(self, -1, _("Admin password"), style=wx.ALIGN_RIGHT)
        __gszr_middle.Add(__lbl_dbo_password, 0, wx.RIGHT|wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 3)
        __gszr_middle.Add(self._TXT_dbo_password, 1, wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 0)
        __gszr_middle.AddGrowableCol(1)
        __szr_main.Add(__gszr_middle, 1, wx.LEFT|wx.RIGHT|wx.EXPAND, 5)
        __szr_buttons.Add((20, 20), 1, wx.EXPAND, 0)
        __szr_buttons.Add(self._BTN_enlist, 0, 0, 0)
        __szr_buttons.Add(self._BTN_cancel, 0, 0, 0)
        __szr_main.Add(__szr_buttons, 0, wx.ALL|wx.EXPAND, 5)
        self.SetSizer(__szr_main)
        __szr_main.Fit(self)
        self.Layout()
        self.Centre()
        # end wxGlade

    def _on_enlist_button_pressed(self, event): # wxGlade: wxgAddPatientAsStaffDlg.<event_handler>
        print "Event handler `_on_enlist_button_pressed' not implemented!"
        event.Skip()

    def _on_cancel_button_pressed(self, event): # wxGlade: wxgAddPatientAsStaffDlg.<event_handler>
        print "Event handler `_on_cancel_button_pressed' not implemented!"
        event.Skip()

# end of class wxgAddPatientAsStaffDlg


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

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