Module progstart
[hide private]
[frames] | no frames]

Source Code for Module progstart

  1  # -*- coding: utf-8 -*- 
  2  # 
  3  # 
  4  #    filename:  progstart.py 
  5  # 
  6  #    filename:  bearbeiteanmerkung.py 
  7  # 
  8  # 
  9  # ---------------------------------------------------------------------------------------- 
 10  # 
 11  # 
 12  #    Copyright (C) 2010  Michael Bellair 
 13  # 
 14  #    This file is part of wxvf. 
 15  # 
 16  #    wxvf is free software: you can redistribute it and/or modify 
 17  #    it under the terms of the GNU General Public License as published by 
 18  #    the Free Software Foundation, either version 3 of the License, or 
 19  #    (at your option) any later version. 
 20  # 
 21  #    wxvf is distributed in the hope that it will be useful, 
 22  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
 23  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 24  #    GNU General Public License for more details. 
 25  # 
 26  #    You should have received a copy of the GNU General Public License 
 27  #    along with wxvf.  If not, see <http://www.gnu.org/licenses/>. 
 28  # 
 29  #    Michael Bellair 
 30  #    Sportplatzstrasse 11 
 31  #    01259 Dresden 
 32  # 
 33  #    E-Mail:    bellair@freenet.de 
 34  #    homepage:  http://freenet-homepage.de/bellair/vf/index.html 
 35  # 
 36  # 
 37  # ---------------------------------------------------------------------------------------- 
 38  # 
 39   
 40  import wx 
 41   
 42  # begin wxGlade: dependencies 
 43  # end wxGlade 
 44   
45 -class ProgStart(wx.Dialog):
46 """ 47 Klasse, die das Fenster zur Datenbankanmeldung repräsentiert. 48 """
49 - def __init__(self, *args, **kwds):
50 # begin wxGlade: ProgStart.__init__ 51 kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.THICK_FRAME 52 wx.Dialog.__init__(self, *args, **kwds) 53 self.label_Aufforderung = wx.StaticText(self, -1, u"Bitte gib Benutzername und Paßwort ein, um Dich an der\nDatenbank anzumelden und 'wxvf' zu starten.", style=wx.ALIGN_CENTRE) 54 self.label_dbBenutzerName = wx.StaticText(self, -1, u"Datenbankbenutzername:") 55 self.text_ctrl_dbBenutzerName = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_ENTER) 56 self.label_dbKennwort = wx.StaticText(self, -1, u"Datenbankkennwort:") 57 self.text_ctrl_dbKennwort = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_ENTER|wx.TE_PASSWORD) 58 self.button_Ende = wx.Button(self, wx.ID_CANCEL, u"Beende 'wxvf'") 59 self.button_Start = wx.Button(self, wx.ID_OK, u"Starte 'wxvf'") 60 61 self.__set_properties() 62 self.__do_layout()
63 # end wxGlade 64
65 - def __set_properties(self):
66 # begin wxGlade: ProgStart.__set_properties 67 self.SetTitle(u"Datenbankanmeldung und Programmstart") 68 self.SetSize((400, 201)) 69 self.text_ctrl_dbBenutzerName.SetMinSize((160, 21)) 70 self.text_ctrl_dbKennwort.SetMinSize((160, 21)) 71 self.text_ctrl_dbKennwort.SetFocus() 72 self.button_Ende.SetMinSize((95, 30)) 73 self.button_Start.SetMinSize((95, 30))
74 # end wxGlade 75
76 - def __do_layout(self):
77 # begin wxGlade: ProgStart.__do_layout 78 sizer_2 = wx.BoxSizer(wx.VERTICAL) 79 sizer_3 = wx.BoxSizer(wx.HORIZONTAL) 80 grid_sizer_2 = wx.GridSizer(2, 2, 5, 5) 81 grid_sizer_1 = wx.GridSizer(1, 3, 0, 0) 82 sizer_2.Add((20, 10), 0, wx.ALIGN_CENTER_HORIZONTAL, 0) 83 grid_sizer_1.Add((20, 20), 2, wx.EXPAND, 0) 84 grid_sizer_1.Add(self.label_Aufforderung, 0, 0, 0) 85 grid_sizer_1.Add((5, 20), 0, wx.EXPAND|wx.FIXED_MINSIZE, 0) 86 sizer_2.Add(grid_sizer_1, 0, wx.ALIGN_CENTER_HORIZONTAL, 0) 87 sizer_2.Add((10, 20), 0, wx.ALIGN_CENTER_HORIZONTAL, 0) 88 grid_sizer_2.Add(self.label_dbBenutzerName, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) 89 grid_sizer_2.Add(self.text_ctrl_dbBenutzerName, 0, wx.ALIGN_CENTER_VERTICAL, 0) 90 grid_sizer_2.Add(self.label_dbKennwort, 0, wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL, 0) 91 grid_sizer_2.Add(self.text_ctrl_dbKennwort, 0, wx.ALIGN_CENTER_VERTICAL, 0) 92 sizer_2.Add(grid_sizer_2, 1, wx.ALIGN_CENTER_HORIZONTAL, 0) 93 sizer_3.Add(self.button_Ende, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) 94 sizer_3.Add((20, 20), 0, wx.EXPAND, 0) 95 sizer_3.Add(self.button_Start, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0) 96 sizer_2.Add(sizer_3, 1, wx.ALIGN_CENTER_HORIZONTAL, 0) 97 self.SetSizer(sizer_2) 98 self.Layout() 99 self.Centre() 100 # end wxGlade 101 102 # 103 # ---------------------------------------------------------------------------------------- 104 # ---------------------------------------------------------------------------------------- 105 # -- ---------------------------------------------------------- 106 # -- Beginn Bellair ---------------------------------------------------------- 107 # -- ---------------------------------------------------------- 108 # ---------------------------------------------------------------------------------------- 109 # ---------------------------------------------------------------------------------------- 110 # 111 112 # 113 # -------------------------------------------------------------------------------- 114 # -- Ereignisse behandeln -------------------------------------------------- 115 # -------------------------------------------------------------------------------- 116 # 117 self.text_ctrl_dbKennwort.Bind(wx.EVT_TEXT_ENTER, self.Ende_OK)
118 119 # 120 # ------------------------------------------------------------------------------------ 121 # -- Funktionen ---------------------------------------------------------- 122 # ------------------------------------------------------------------------------------ 123 #
124 - def Ende_OK(self, event):
125 """ 126 Methode die aufgerufen wird, wenn zur Herstellung der Datenbankverbindung alle Daten übergeben werden sollen. 127 """ 128 self.EndModal( wx.ID_OK )
129 130 # 131 # ---------------------------------------------------------------------------------------- 132 # ---------------------------------------------------------------------------------------- 133 # -- ---------------------------------------------------------- 134 # -- Ende Bellair ---------------------------------------------------------- 135 # -- ---------------------------------------------------------- 136 # ---------------------------------------------------------------------------------------- 137 # ---------------------------------------------------------------------------------------- 138 # 139 140 # end of class ProgStart 141