/[lohnrechner]/trunk/lohnrechner2006.py
ViewVC logotype

Diff of /trunk/lohnrechner2006.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by wilde, Fri Jan 14 13:46:49 2005 UTC revision 24 by wilde, Mon Jan 17 14:30:00 2005 UTC
# Line 89  class Lohnrechner(LST2005.LStRechner2005 Line 89  class Lohnrechner(LST2005.LStRechner2005
89          Label(frame, text="Bundesland:").grid(row=4, sticky=E)          Label(frame, text="Bundesland:").grid(row=4, sticky=E)
90          landframe = Frame(frame)          landframe = Frame(frame)
91          scrollbar = Scrollbar(landframe, orient=VERTICAL)          scrollbar = Scrollbar(landframe, orient=VERTICAL)
92          self.land = Listbox(landframe, height=4, selectmode=SINGLE,          self.landbox = Listbox(landframe, height=4, selectmode=SINGLE,
93                              yscrollcommand=scrollbar.set)                                 yscrollcommand=scrollbar.set)
94          for land in self.laender:          for land in self.laender:
95              self.land.insert(END, land[0])              self.landbox.insert(END, land[0])
96          self.land.select_set(0)          self.landbox.bind("<<ListboxSelect>>", self.NewLandSel)
97          self.land.bind("<<ListboxSelect>>", self.NewInput)          self.landbox.select_set(0)
98          self.land.pack(side=RIGHT, fill=Y)          self.landbox.pack(side=RIGHT, fill=Y)
99          scrollbar.config(command=self.land.yview)          scrollbar.config(command=self.landbox.yview)
100          scrollbar.pack(side=LEFT, fill=BOTH, expand=1)          scrollbar.pack(side=LEFT, fill=BOTH, expand=1)
101          landframe.grid(row=4, column=1, sticky=W)          landframe.grid(row=4, column=1, sticky=W)
102            self.NewLandSel()
103                    
104          self.ResetInput()          self.ResetInput()
105    
# Line 123  class Lohnrechner(LST2005.LStRechner2005 Line 124  class Lohnrechner(LST2005.LStRechner2005
124          self.CalcOutput()          self.CalcOutput()
125    
126      def NewInput(self, event):      def NewInput(self, event):
127            # Es ist m�glich alle Eintr�ge in der Listbox zu deselektieren,
128            # es ist aber immer genau ein Eintrag aktuell, darum wird er ggf.
129            # zwangsselektiert:
130            # FIX ME: eigendlich w�re das ein Fall f�r ein custom widget!
131            if len(self.landbox.curselection()) == 0:
132                self.landbox.select_set(self.land)            
133          self.CalcOutput()          self.CalcOutput()
134    
135        def NewLandSel(self, event=0):
136            self.land = int(self.landbox.curselection()[0])
137    
138      def ResetInput(self):      def ResetInput(self):
139          self.ResetInputLohn()          self.ResetInputLohn()
140          self.ResetInputKfb()          self.ResetInputKfb()
# Line 150  class Lohnrechner(LST2005.LStRechner2005 Line 160  class Lohnrechner(LST2005.LStRechner2005
160    
161          self.SetSteuerklasse(self.stkl.get())          self.SetSteuerklasse(self.stkl.get())
162          self.SetKirchensteuer(self.kirche.get() *          self.SetKirchensteuer(self.kirche.get() *
163                                self.laender[int(self.land.curselection()[0])][1])                                self.laender[self.land][1])
164    
165      def CalcOutput(self):      def CalcOutput(self):
166          self.InitCalc()          self.InitCalc()

Legend:
Removed from v.23  
changed lines
  Added in v.24

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26