80 lines
2.6 KiB
Python
80 lines
2.6 KiB
Python
from tkinter import *
|
||
|
||
root = Tk()
|
||
root.title("Розрахунки спрощеного виразу")
|
||
|
||
# Віджети введених множин
|
||
sets_frame = Frame(root, bd=5)
|
||
|
||
set_A_label = Label(sets_frame, text="Множина A:", bd=5)
|
||
elements_A_label = Label(sets_frame)
|
||
|
||
set_B_label = Label(sets_frame, text="Множина B:", bd=5)
|
||
elements_B_label = Label(sets_frame)
|
||
|
||
set_C_label = Label(sets_frame, text="Множина C:", bd=5)
|
||
elements_C_label = Label(sets_frame)
|
||
|
||
# Пакувальники введених множин
|
||
sets_frame.grid(row=0, column=0)
|
||
|
||
set_A_label.grid(row=0, column=0, sticky=E)
|
||
elements_A_label.grid(row=0, column=1, sticky=W)
|
||
|
||
set_B_label.grid(row=1, column=0, sticky=E)
|
||
elements_B_label.grid(row=1, column=1, sticky=W)
|
||
|
||
set_C_label.grid(row=2, column=0, sticky=E)
|
||
elements_C_label.grid(row=2, column=1, sticky=W)
|
||
|
||
set_labels = [elements_A_label, elements_B_label, elements_C_label]
|
||
|
||
# Кнопка початку розрахунків
|
||
start_calculations_button = Button(root, text="Почати розрахунки")
|
||
start_calculations_button.grid(row=1, column=0)
|
||
|
||
# Віджети покрокового розв'язання
|
||
calculations_frame = Frame(root, bd=5)
|
||
|
||
expression_label = Label(calculations_frame, text="Вираз: D = ¬A ∪ B ∪ ¬C", bd=5)
|
||
|
||
first_step_label = Label(calculations_frame, text="¬A = ", bd=5)
|
||
first_step_result = Label(calculations_frame)
|
||
|
||
second_step_label = Label(calculations_frame, text="¬A ∪ B = ", bd=5)
|
||
second_step_result = Label(calculations_frame)
|
||
|
||
third_step_label = Label(calculations_frame, text="¬A ∪ B ∪ ¬C = ", bd=5)
|
||
third_step_result = Label(calculations_frame)
|
||
|
||
calculation_result_labels = [first_step_result, second_step_result, third_step_result]
|
||
|
||
# Пакувальники покрокового розв'язання
|
||
calculations_frame.grid(row=2, column=0)
|
||
|
||
expression_label.grid(row=0, column=0, columnspan=2)
|
||
|
||
first_step_label.grid(row=1, column=0, sticky=E)
|
||
second_step_label.grid(row=2, column=0, sticky=E)
|
||
third_step_label.grid(row=3, column=0, sticky=E)
|
||
|
||
first_step_result.grid(row=1, column=1, sticky=W)
|
||
second_step_result.grid(row=2, column=1, sticky=W)
|
||
third_step_result.grid(row=3, column=1, sticky=W)
|
||
|
||
# Віджети множини D
|
||
d_frame = Frame(root, bd=5)
|
||
|
||
set_D_label = Label(d_frame, text="Множина D:", bd=5)
|
||
elements_D_label = Label(d_frame)
|
||
|
||
save_D_button = Button(d_frame, text="Зберегти D")
|
||
|
||
# Пакувальники множини D
|
||
d_frame.grid(row=3, column=0)
|
||
|
||
set_D_label.grid(row=0, column=0)
|
||
elements_D_label.grid(row=0, column=1)
|
||
|
||
save_D_button.grid(row=1, column=0, columnspan=2)
|