--- trunk/RCS/lohnrechner.py 2005/01/13 13:01:58 16 +++ trunk/RCS/lohnrechner.py 2005/01/14 11:43:17 19 @@ -1,4 +1,5 @@ #! /usr/bin/python +# -*- coding: iso-8859-1 -*- # -------------------------------------------------------------------- # Lohnsteuer und Sozialabgaben Rechner # $Id$ @@ -16,7 +17,7 @@ __version__ = "$Revision$" # $Source$ -_release_version = "0.1alpha" +_release_version = "0.%s alpha" % __version__[11:-2] import LST2005 from Tkinter import * @@ -27,6 +28,8 @@ LST2005.LStRechner2005.__init__(self) root.title("Lohnrechner 2005 - v%s" % _release_version) + root.resizable(NO, NO) + self.root = root Label(root, text="Lohn:").grid(row=0, sticky=E) self.lohn = Entry(root) @@ -64,6 +67,11 @@ kircheradio.select() kircheradio.pack(side=LEFT) + Label(root, text="Kinderfreibetrag:").grid(row=3, sticky=E) + self.kfb = Entry(root) + self.kfb.bind("", self.NewInput) + self.kfb.grid(row=3, column=1, sticky=W) + self.ResetInput() Label(root, text="Lohnsteuer:").grid(row=0, column=2, sticky=E) @@ -78,8 +86,11 @@ self.kist = Entry(root) self.kist.grid(row=2, column=3, sticky=W) - self.calcbutton = Button(root, text="Berechnen", command=self.CalcOutput) - self.calcbutton.grid(row=3, columnspan=4) + buttons = Frame() + buttons.grid(row=4, columnspan=4) + Button(buttons, text="Quit", command=root.quit).pack(side=LEFT) + Button(buttons, text="Info", command=self.Info).pack(side=LEFT) + Button(buttons, text="Berechnen", command=self.CalcOutput).pack(side=LEFT) self.CalcOutput() @@ -93,12 +104,21 @@ self.lohn.delete(0, END) self.lohn.insert(0, "0") + def ResetInputKfb(self): + self.kfb.delete(0, END) + self.kfb.insert(0, "0") + def InitCalc(self): try: self.SetLohn(float(self.lohn.get())) except: self.ResetInputLohn() + try: + self.SetKinderfreibetrag(float(self.kfb.get())) + except: + self.ResetInputKfb() + self.SetSteuerklasse(int(self.stkl.get())) self.SetKirchensteuer(int(self.kirche.get())) @@ -112,6 +132,20 @@ self.kist.delete(0, END) self.kist.insert(0, "%.2f" % self.GetKirchensteuer()) + def Info(self): + infowin = Toplevel(self.root) + infowin.title("Info") + Label(infowin, text="Lohnrechner 2005 v%s" % _release_version, + font=("Times", 14, "bold italic")).grid(row=0, pady=20) + Label(infowin, text= + "Copyright (C) 2005 Intevation GmbH \n\n\ +Lohnrechner 2005 comes with ABSOLUTELY NO WARRANTY.\n\ +This is free software, and you are welcome to redistribute it\n\ +under the terms of the GNU General Public License.\n\ +For more information about these matters, see the file named COPYING.\n\n\ +Dieses Programm verwendet LST2005 %s" % LST2005._ModulVersion()).grid(row=1, padx=10) + Button(infowin, text="Ok", command=infowin.destroy).grid(row=2, pady=10) + if __name__ == "__main__": root = Tk()