Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class InputCompany(Toplevel):
- def __init__(self):
- super().__init__()
- self.title('Данни за предприятието')
- self.geometry('700x500+600+200')
- self.attributes('-topmost', 'true')
- #__cb = IntVar
- self.e_num_e = StringVar
- self.dds_e = StringVar
- #self.open_comp()
- def open_comp(self):
- # Create Label
- name_l = self.label_n(20, 20, 20, 'Наименование')
- sit_l = self.label_n(20, 60, 20, 'Седалище')
- addr_l = self.label_n(20, 100, 20, 'Адрес на управление')
- e_num_l = self.label_n(20, 140, 20, 'ЕИК (Булстат)')
- men_l = self.label_n(20, 180, 20, 'Ръководител')
- act_num_l = self.label_n(20, 220, 20, 'Код на дейността')
- dds_l = self.label_n(20, 260, 20, 'Рег. ЗДДС')
- phone1_l = self.label_n(20, 300, 20, 'Офис тел:')
- phone2_l = self.label_n(20, 340, 20, 'Счетоводство тел:')
- mail_l = self.label_n(20, 380, 20, 'Счетоводство e-mail:')
- act_place_l = self.label_n(20, 420, 20, 'Търговски обект:')
- # Create Entry
- name_e = self.entry_n(200, 20, 40)
- sit_e = self.entry_n(200, 60, 40)
- addr_e = self.entry_n(200, 100, 40)
- self.e_num_e = str(self.entry_n(200, 140, 40))
- act_num_e = self.entry_n(200, 180, 40)
- self.dds_e = self.entry_n(200, 220, 40)
- phone1_e = self.entry_n(200, 260, 40)
- phone2_e = self.entry_n(200, 300, 40)
- mail_e = self.entry_n(200, 340, 40)
- act_place_e = self.entry_n(200, 380, 40)
- # Create Check_box
- dds_ch = self.check_b(150, 260, '')
- def label_n(self, x, y, w, t):
- bord_color = Frame(self, width=w, background='red')
- bord_color.place(x=x, y=y)
- lab = Label(bord_color, text=t, font=('Times', 10, 'italic'))
- lab.pack(padx=0, pady=(0, 1))
- def entry_n(self, x, y, w):
- ent = Entry(self, bd=4, width=w)
- ent.place(x=x, y=y)
- def check_b(self, x, y, t):
- __cb = IntVar()
- check = Checkbutton(self, text=t, onvalue=1, offvalue=0, variable=__cb, command=lambda: InputCompany.check_x(self, __cb))
- #check.bind('<Button-1>', lambda: InputCompany.check_x(__cb))
- check.place(x=x, y=y)
- def check_x(self, __cb):
- dds = StringVar
- self.e_num_e = StringVar
- if __cb.get() == 1:
- print('Не')
- dds = self.e_num_e.get()
- print(dds)
- # entry_n() Трябва да се извика функция която попълва Ентрито
- elif __cb.get() == 0:
- print('ддс')
- dds = self.e_num_e.get()
- print(dds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement