Advertisement
ALEXANDAR_GEORGIEV

balance_1

Jul 5th, 2022 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.82 KB | None | 0 0
  1.  
  2. class InputCompany(Toplevel):
  3.  
  4.     def __init__(self):
  5.         super().__init__()
  6.         self.title('Данни за предприятието')
  7.         self.geometry('700x500+600+200')
  8.         self.attributes('-topmost', 'true')
  9.         #__cb = IntVar
  10.         self.e_num_e = StringVar
  11.         self.dds_e = StringVar
  12.  
  13.         #self.open_comp()
  14.  
  15.     def open_comp(self):
  16.         # Create Label
  17.         name_l = self.label_n(20, 20, 20, 'Наименование')
  18.         sit_l = self.label_n(20, 60, 20, 'Седалище')
  19.         addr_l = self.label_n(20, 100, 20, 'Адрес на управление')
  20.         e_num_l = self.label_n(20, 140, 20, 'ЕИК (Булстат)')
  21.         men_l = self.label_n(20, 180, 20, 'Ръководител')
  22.         act_num_l = self.label_n(20, 220, 20, 'Код на дейността')
  23.         dds_l = self.label_n(20, 260, 20, 'Рег. ЗДДС')
  24.         phone1_l = self.label_n(20, 300, 20, 'Офис тел:')
  25.         phone2_l = self.label_n(20, 340, 20, 'Счетоводство тел:')
  26.         mail_l = self.label_n(20, 380, 20, 'Счетоводство e-mail:')
  27.         act_place_l = self.label_n(20, 420, 20, 'Търговски обект:')
  28.         # Create Entry
  29.         name_e = self.entry_n(200, 20, 40)
  30.         sit_e = self.entry_n(200, 60, 40)
  31.         addr_e = self.entry_n(200, 100, 40)
  32.         self.e_num_e = str(self.entry_n(200, 140, 40))
  33.         act_num_e = self.entry_n(200, 180, 40)
  34.         self.dds_e = self.entry_n(200, 220, 40)
  35.         phone1_e = self.entry_n(200, 260, 40)
  36.         phone2_e = self.entry_n(200, 300, 40)
  37.         mail_e = self.entry_n(200, 340, 40)
  38.         act_place_e = self.entry_n(200, 380, 40)
  39.         # Create Check_box
  40.         dds_ch = self.check_b(150, 260, '')
  41.  
  42.     def label_n(self, x, y, w, t):
  43.         bord_color = Frame(self, width=w, background='red')
  44.         bord_color.place(x=x, y=y)
  45.         lab = Label(bord_color, text=t, font=('Times', 10, 'italic'))
  46.         lab.pack(padx=0, pady=(0, 1))
  47.  
  48.     def entry_n(self, x, y, w):
  49.         ent = Entry(self, bd=4, width=w)
  50.         ent.place(x=x, y=y)
  51.  
  52.     def check_b(self, x, y, t):
  53.         __cb = IntVar()
  54.         check = Checkbutton(self, text=t, onvalue=1, offvalue=0, variable=__cb, command=lambda: InputCompany.check_x(self, __cb))
  55.         #check.bind('<Button-1>', lambda: InputCompany.check_x(__cb))
  56.         check.place(x=x, y=y)
  57.  
  58.     def check_x(self, __cb):
  59.         dds = StringVar
  60.         self.e_num_e = StringVar
  61.         if __cb.get() == 1:
  62.             print('Не')
  63.             dds = self.e_num_e.get()
  64.             print(dds)
  65.  
  66.             # entry_n() Трябва да се извика функция която попълва Ентрито
  67.         elif __cb.get() == 0:
  68.             print('ддс')
  69.             dds = self.e_num_e.get()
  70.             print(dds)
  71.  
  72.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement