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("<ButtonRelease-1>", 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 |
|
|
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() |
141 |
|
|
142 |
def ResetInputLohn(self): |
def ResetInputLohn(self): |
143 |
self.lohn.delete(0, END) |
self.lohn.delete(0, END) |
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() |