first commit
This commit is contained in:
commit
70d3a7fdf6
|
@ -0,0 +1,2 @@
|
|||
customtkinter==4.6.3
|
||||
darkdetect==0.7.1
|
|
@ -0,0 +1,535 @@
|
|||
from faulthandler import disable
|
||||
from tkinter import END
|
||||
from customtkinter import CTk, CTkFrame, CTkLabel, CTkEntry, CTkButton
|
||||
|
||||
class App(CTk):
|
||||
WIDTH = 800
|
||||
HEIGHT = 480
|
||||
|
||||
CAL_PADX = 2
|
||||
CAL_PADY = 2
|
||||
CAL_WIDTH = 71
|
||||
CAL_HEIGHT = 40
|
||||
CAL_NUM_FG = "#134266"
|
||||
CAL_MATH_FG = "#0C2940"
|
||||
CAL_CLEAR_FG = "#990000"
|
||||
|
||||
BUT_FONT = "Roboto Medium"
|
||||
BUT_FONT_S = 16
|
||||
|
||||
NUMBOX_FONT = "Roboto Medium"
|
||||
NUMBOX_FONT_S = 37
|
||||
|
||||
PRE_B_WIDTH = 90
|
||||
PRE_B_HEIGHT = 40
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.geometry(f"{App.WIDTH}x{App.HEIGHT}")
|
||||
self.resizable(width=0, height=0)
|
||||
self.grid_columnconfigure(2, weight=1)
|
||||
self.grid_rowconfigure(0, weight=1)
|
||||
self.title("Table Saw Controls")
|
||||
|
||||
def formatNumber(num):
|
||||
if num % 1 == 0:
|
||||
return int(num)
|
||||
else:
|
||||
return num
|
||||
|
||||
|
||||
|
||||
def button_click(number):
|
||||
current = self.numbox.get()
|
||||
self.numbox.delete("0", "end")
|
||||
self.numbox.insert(0, str(current) + str(number))
|
||||
def convert(type):
|
||||
if not self.numbox.get():
|
||||
C_num = 0.00
|
||||
else:
|
||||
C_num= float(self.numbox.get())
|
||||
if type == "mm":
|
||||
ans_in_mm = float(C_num) * 25.4
|
||||
self.numbox.delete("0", "end")
|
||||
self.numbox.insert(0, ans_in_mm)
|
||||
if type =="in":
|
||||
ans_in_inch = float(C_num) / 25.4
|
||||
self.numbox.delete("0", "end")
|
||||
self.numbox.insert(0, ans_in_inch)
|
||||
|
||||
def import_to(option, location):
|
||||
if not self.numbox.get():
|
||||
C_num = 0.00
|
||||
else:
|
||||
C_num= float(self.numbox.get())
|
||||
C_num = round(C_num, 3)
|
||||
self.numbox.delete("0", "end")
|
||||
if option == "fence":
|
||||
if location == "cur":
|
||||
self.fence_cur_num.delete("0", "end")
|
||||
self.fence_cur_num.insert(0, C_num)
|
||||
clear("calc")
|
||||
if location == "dest":
|
||||
self.fence_dest_num.delete("0", "end")
|
||||
self.fence_dest_num.insert(0, C_num)
|
||||
clear("calc")
|
||||
if option == "angle":
|
||||
if location == "cur":
|
||||
self.angle_cur_num.delete("0", "end")
|
||||
self.angle_cur_num.insert(0, C_num)
|
||||
clear("calc")
|
||||
if location == "dest":
|
||||
self.angle_dest_num.delete("0", "end")
|
||||
self.angle_dest_num.insert(0, C_num)
|
||||
clear("calc")
|
||||
if option == "height":
|
||||
if location == "cur":
|
||||
self.height_cur_num.delete("0", "end")
|
||||
self.height_cur_num.insert(0, C_num)
|
||||
clear("calc")
|
||||
if location == "dest":
|
||||
self.height_dest_num.delete("0", "end")
|
||||
self.height_dest_num.insert(0, C_num)
|
||||
clear("calc")
|
||||
|
||||
def clear(location):
|
||||
if location == "calc":
|
||||
self.numbox.delete("0", "end")
|
||||
self.numbox.configure(placeholder_text="0")
|
||||
if location == "fence_cur":
|
||||
self.fence_cur_num.delete("0", "end")
|
||||
if location == "fence_dest":
|
||||
self.fence_dest_num.delete("0", "end")
|
||||
if location == "angle_cur":
|
||||
self.angle_cur_num.delete("0", "end")
|
||||
if location == "angle_dest":
|
||||
self.angle_dest_num.delete("0", "end")
|
||||
if location == "height_cur":
|
||||
self.height_cur_num.delete("0", "end")
|
||||
if location == "height_dest":
|
||||
self.height_dest_num.delete("0", "end")
|
||||
|
||||
def calculate(type):
|
||||
if type == "add" or "sub" or "mult" or "div":
|
||||
if not self.numbox.get():
|
||||
first_number = 0.00
|
||||
else:
|
||||
first_number = self.numbox.get()
|
||||
global f_num
|
||||
global math
|
||||
# f_num = float(first_number)
|
||||
f_num = first_number
|
||||
if type == "add":
|
||||
math = "addition"
|
||||
ph_string = f'{first_number} + '
|
||||
self.numbox.configure(placeholder_text=ph_string)
|
||||
if type == "sub":
|
||||
math = "subtraction"
|
||||
ph_string = f'{first_number} - '
|
||||
self.numbox.configure(placeholder_text=ph_string)
|
||||
if type == "mult":
|
||||
math = "multiplication"
|
||||
ph_string = f'{first_number} x '
|
||||
self.numbox.configure(placeholder_text=ph_string)
|
||||
if type == "div":
|
||||
math = "division"
|
||||
ph_string = f'{first_number} ÷ '
|
||||
self.numbox.configure(placeholder_text=ph_string)
|
||||
|
||||
f_num = float(first_number)
|
||||
self.numbox.delete("0", "end")
|
||||
|
||||
def button_percent():
|
||||
first_number = self.numbox.get()
|
||||
global f_num
|
||||
global math
|
||||
math = "percent"
|
||||
f_num = float(first_number)
|
||||
self.numbox.delete("0", "end")
|
||||
|
||||
def button_equal():
|
||||
global f_num
|
||||
if not self.numbox.get():
|
||||
second_number = 0.00
|
||||
else:
|
||||
second_number = self.numbox.get()
|
||||
self.numbox.delete("0", "end")
|
||||
if math == "addition":
|
||||
total = f_num + float(second_number)
|
||||
formatted = formatNumber(total)
|
||||
self.numbox.insert(0, formatted)
|
||||
f_num = 0
|
||||
if math == "subtraction":
|
||||
total = f_num - float(second_number)
|
||||
formatted = formatNumber(total)
|
||||
self.numbox.insert(0, formatted)
|
||||
f_num = 0
|
||||
if math == "multiplication":
|
||||
total = f_num * float(second_number)
|
||||
formatted = formatNumber(total)
|
||||
self.numbox.insert(0, formatted)
|
||||
f_num = 0
|
||||
if math == "division":
|
||||
total = f_num / float(second_number)
|
||||
formatted = formatNumber(total)
|
||||
self.numbox.insert(0, formatted)
|
||||
f_num = 0
|
||||
if math == "percent":
|
||||
total = f_num / float(second_number) * 100
|
||||
formatted = formatNumber(total)
|
||||
self.numbox.insert(0, formatted)
|
||||
f_num = 0
|
||||
|
||||
def button_subtract():
|
||||
first_number = self.numbox.get()
|
||||
global f_num
|
||||
global math
|
||||
math = "subtraction"
|
||||
f_num = float(first_number)
|
||||
self.numbox.delete("0", "end")
|
||||
def button_multiply():
|
||||
first_number = self.numbox.get()
|
||||
global f_num
|
||||
global math
|
||||
math = "multiplication"
|
||||
f_num = float(first_number)
|
||||
self.numbox.delete("0", "end")
|
||||
|
||||
def button_divide():
|
||||
first_number = self.numbox.get()
|
||||
global f_num
|
||||
global math
|
||||
math = "division"
|
||||
f_num = float(first_number)
|
||||
self.numbox.delete("0", "end")
|
||||
|
||||
#Calculator Frame
|
||||
self.calc_f = CTkFrame(self)
|
||||
self.calc_f.configure(width=300, height=480, corner_radius=10)
|
||||
self.calc_f.grid(row=0, column=0, sticky="n")
|
||||
|
||||
self.calc_label = CTkLabel(self.calc_f)
|
||||
self.calc_label.configure(justify="center", text_font=(App.NUMBOX_FONT, 19), text="Total")
|
||||
self.calc_label.grid(row=0, column=0, columnspan=4)
|
||||
|
||||
# self.button = CTkButton(self.calc_f, text="Settings", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, command=self.settings)
|
||||
# self.button.grid(row=7, column=0)
|
||||
|
||||
self.numbox = CTkEntry(self.calc_f)
|
||||
self.numbox.configure(height=75, width=300, borderwidth=0, text_font=(App.NUMBOX_FONT, App.NUMBOX_FONT_S), state="normal", justify="center", placeholder_text="0")
|
||||
self.numbox.grid(row=1, column=0, columnspan=4)
|
||||
#self.numbox.insert("0", "0")
|
||||
|
||||
self.calc_label_con = CTkLabel(self.calc_f)
|
||||
self.calc_label_con.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Conversions")
|
||||
self.calc_label_con.grid(row=2, column=0, columnspan=4)
|
||||
|
||||
self.cal_conv_m = CTkButton(self.calc_f)
|
||||
self.cal_conv_m.configure(text="MM → IN", width=146, height=30, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_MATH_FG, command=lambda: convert("in"))
|
||||
self.cal_conv_m.grid(row=3, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY, columnspan=2)
|
||||
|
||||
self.cal_conv_i = CTkButton(self.calc_f)
|
||||
self.cal_conv_i.configure(text="IN → MM", width=146, height=30, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_MATH_FG, command=lambda: convert("mm"))
|
||||
self.cal_conv_i.grid(row=3, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY, columnspan=2)
|
||||
|
||||
self.calc_label_keypad = CTkLabel(self.calc_f)
|
||||
self.calc_label_keypad.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Keypad")
|
||||
self.calc_label_keypad.grid(row=4, column=0, columnspan=4)
|
||||
|
||||
self.cal_1 = CTkButton(self.calc_f)
|
||||
self.cal_1.configure(text="1", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(1))
|
||||
self.cal_1.grid(row=7, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_2 = CTkButton(self.calc_f)
|
||||
self.cal_2.configure(text="2", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(2))
|
||||
self.cal_2.grid(row=7, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_3 = CTkButton(self.calc_f)
|
||||
self.cal_3.configure(text="3", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(3))
|
||||
self.cal_3.grid(row=7, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_4 = CTkButton(self.calc_f)
|
||||
self.cal_4.configure(text="4", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(4))
|
||||
self.cal_4.grid(row=6, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_5 = CTkButton(self.calc_f)
|
||||
self.cal_5.configure(text="5", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(5))
|
||||
self.cal_5.grid(row=6, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_6 = CTkButton(self.calc_f)
|
||||
self.cal_6.configure(text="6", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(6))
|
||||
self.cal_6.grid(row=6, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_7 = CTkButton(self.calc_f)
|
||||
self.cal_7.configure(text="7", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(7))
|
||||
self.cal_7.grid(row=5, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_8 = CTkButton(self.calc_f)
|
||||
self.cal_8.configure(text="8", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(8))
|
||||
self.cal_8.grid(row=5, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_9 = CTkButton(self.calc_f)
|
||||
self.cal_9.configure(text="9", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(9))
|
||||
self.cal_9.grid(row=5, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_0 = CTkButton(self.calc_f)
|
||||
self.cal_0.configure(text="0", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click(0))
|
||||
self.cal_0.grid(row=8, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_dec = CTkButton(self.calc_f)
|
||||
self.cal_dec.configure(text=".", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=lambda: button_click('.'))
|
||||
self.cal_dec.grid(row=8, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_perc = CTkButton(self.calc_f)
|
||||
self.cal_perc.configure(text="%", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_NUM_FG, command=button_percent)
|
||||
self.cal_perc.grid(row=8, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_div = CTkButton(self.calc_f)
|
||||
self.cal_div.configure(text="÷", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_MATH_FG, command=lambda: calculate("div"))
|
||||
self.cal_div.grid(row=8, column=3, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_mult = CTkButton(self.calc_f)
|
||||
self.cal_mult.configure(text="x", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_MATH_FG, command=lambda: calculate("mult"))
|
||||
self.cal_mult.grid(row=5, column=3, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_sub = CTkButton(self.calc_f)
|
||||
self.cal_sub.configure(text="-", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_MATH_FG, command=lambda: calculate("sub"))
|
||||
self.cal_sub.grid(row=6, column=3, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_add = CTkButton(self.calc_f)
|
||||
self.cal_add.configure(text="+", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_MATH_FG, command=lambda: calculate("add"))
|
||||
self.cal_add.grid(row=7, column=3, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_clear = CTkButton(self.calc_f)
|
||||
self.cal_clear.configure(text="CLEAR", width=146, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), fg_color=App.CAL_CLEAR_FG, command=lambda: clear("calc"))
|
||||
self.cal_clear.grid(row=9, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY, columnspan=2)
|
||||
|
||||
self.cal_equal = CTkButton(self.calc_f)
|
||||
self.cal_equal.configure(text="=", width=146, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=button_equal)
|
||||
self.cal_equal.grid(row=9, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY, columnspan=2)
|
||||
|
||||
self.calc_label_frac = CTkLabel(self.calc_f)
|
||||
self.calc_label_frac.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Fractions")
|
||||
self.calc_label_frac.grid(row=10, column=0, columnspan=4)
|
||||
|
||||
self.cal_eighth = CTkButton(self.calc_f)
|
||||
self.cal_eighth.configure(text="⅛", width=App.CAL_WIDTH, height=5, text_font=(App.BUT_FONT, 12), command=lambda: button_click(".125"))
|
||||
self.cal_eighth.grid(row=11, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_quarter = CTkButton(self.calc_f)
|
||||
self.cal_quarter.configure(text="¼", width=App.CAL_WIDTH, height=5, text_font=(App.BUT_FONT, 12), command=lambda: button_click(".25"))
|
||||
self.cal_quarter.grid(row=11, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_half = CTkButton(self.calc_f)
|
||||
self.cal_half.configure(text="½", width=App.CAL_WIDTH, height=5, text_font=(App.BUT_FONT, 12), command=lambda: button_click(".5"))
|
||||
self.cal_half.grid(row=11, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.cal_inch = CTkButton(self.calc_f)
|
||||
self.cal_inch.configure(text="¾", width=App.CAL_WIDTH, height=5, text_font=(App.BUT_FONT, 12), command=lambda: button_click(".75"))
|
||||
self.cal_inch.grid(row=11, column=3, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
#END Calculator Frame
|
||||
|
||||
# Adjustments Frame
|
||||
self.adjustments = CTkFrame(self)
|
||||
self.adjustments.configure(width=370, height=160, corner_radius=10)
|
||||
self.adjustments.grid(row=0, column=1, sticky="nw")
|
||||
|
||||
# Fence Frame
|
||||
self.adjustments.frame_fence = CTkFrame(self.adjustments)
|
||||
self.adjustments.frame_fence.configure(width=500, height=160, corner_radius=10)
|
||||
self.adjustments.frame_fence.grid(row=0, column=1, sticky="nw")
|
||||
|
||||
self.fence_label = CTkLabel(self.adjustments.frame_fence)
|
||||
self.fence_label.configure(justify="center", text_font=(App.NUMBOX_FONT, 19), text="Fence")
|
||||
self.fence_label.grid(row=0, column=0, columnspan=2)
|
||||
|
||||
self.fence_label_cur = CTkLabel(self.adjustments.frame_fence)
|
||||
self.fence_label_cur.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Current")
|
||||
self.fence_label_cur.grid(row=1, column=0, columnspan=1)
|
||||
|
||||
self.fence_label_dest = CTkLabel(self.adjustments.frame_fence)
|
||||
self.fence_label_dest.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Destination")
|
||||
self.fence_label_dest.grid(row=1, column=1, columnspan=1)
|
||||
|
||||
self.fence_cur_num = CTkEntry(self.adjustments.frame_fence)
|
||||
self.fence_cur_num.configure(height=40, width=100, text_font=(App.NUMBOX_FONT, 12), state="normal", justify="center", placeholder_text="0")
|
||||
self.fence_cur_num.grid(row=2, column=0, columnspan=1)
|
||||
|
||||
self.fence_dest_num = CTkEntry(self.adjustments.frame_fence)
|
||||
self.fence_dest_num.configure(height=40, width=100, text_font=(App.NUMBOX_FONT, 12), state="normal", justify="center", placeholder_text="0")
|
||||
self.fence_dest_num.grid(row=2, column=1, columnspan=1)
|
||||
|
||||
self.fence_grab_cur = CTkButton(self.adjustments.frame_fence)
|
||||
self.fence_grab_cur.configure(text="→ Current", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=lambda: import_to("fence", "cur"))
|
||||
self.fence_grab_cur.grid(row=3, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.fence_grab_go = CTkButton(self.adjustments.frame_fence,)
|
||||
self.fence_grab_go.configure(text="→ Desitnation", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=lambda: import_to("fence", "dest"))
|
||||
self.fence_grab_go.grid(row=3, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.fence_go = CTkButton(self.adjustments.frame_fence)
|
||||
self.fence_go.configure(text="GO!!", fg_color="green", hover_color="darkgreen", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.fence_go.grid(row=2, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
# END Fence Frame
|
||||
|
||||
# Angle Frame
|
||||
self.adjustments.frame_angle = CTkFrame(self.adjustments)
|
||||
self.adjustments.frame_angle.configure(width=500, height=160, corner_radius=10)
|
||||
self.adjustments.frame_angle.grid(row=1, column=1, sticky="nw")
|
||||
|
||||
self.angle_label = CTkLabel(self.adjustments.frame_angle)
|
||||
self.angle_label.configure(justify="center", text_font=(App.NUMBOX_FONT, 19), text="Angle")
|
||||
self.angle_label.grid(row=0, column=0, columnspan=2)
|
||||
|
||||
self.angle_label_cur = CTkLabel(self.adjustments.frame_angle)
|
||||
self.angle_label_cur.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Current")
|
||||
self.angle_label_cur.grid(row=1, column=0, columnspan=1)
|
||||
|
||||
self.angle_label_dest = CTkLabel(self.adjustments.frame_angle)
|
||||
self.angle_label_dest.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Destination")
|
||||
self.angle_label_dest.grid(row=1, column=1, columnspan=1)
|
||||
|
||||
self.angle_cur_num = CTkEntry(self.adjustments.frame_angle)
|
||||
self.angle_cur_num.configure(height=40, width=100, text_font=(App.NUMBOX_FONT, 12), state="normal", justify="center", placeholder_text="0")
|
||||
self.angle_cur_num.grid(row=2, column=0, columnspan=1)
|
||||
|
||||
|
||||
self.angle_dest_num = CTkEntry(self.adjustments.frame_angle)
|
||||
self.angle_dest_num.grid(row=2, column=1, columnspan=1)
|
||||
self.angle_dest_num.configure(height=40, width=100, text_font=(App.NUMBOX_FONT, 12), state="normal", justify="center", placeholder_text="0")
|
||||
|
||||
|
||||
self.angle_grab_cur = CTkButton(self.adjustments.frame_angle)
|
||||
self.angle_grab_cur.configure(text="→ Current", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=lambda: import_to("angle", "cur"))
|
||||
self.angle_grab_cur.grid(row=3, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.angle_grab_go = CTkButton(self.adjustments.frame_angle)
|
||||
self.angle_grab_go.configure(text="→ Desitnation", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=lambda: import_to("angle", "dest"))
|
||||
self.angle_grab_go.grid(row=3, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.angle_go_zero = CTkButton(self.adjustments.frame_angle)
|
||||
self.angle_go_zero.configure(text="0°", fg_color="green", hover_color="darkgreen", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.angle_go_zero.grid(row=1, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.angle_go_45 = CTkButton(self.adjustments.frame_angle, text="45", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.angle_go_45.configure(text="45°", fg_color="green", hover_color="darkgreen", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.angle_go_45.grid(row=2, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.angle_go = CTkButton(self.adjustments.frame_angle)
|
||||
self.angle_go.configure(text="GO!!", fg_color="green", hover_color="darkgreen", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.angle_go.grid(row=3, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
# END Angle Frame
|
||||
|
||||
# Height Frame
|
||||
self.adjustments.frame_height = CTkFrame(self.adjustments)
|
||||
self.adjustments.frame_height.configure(width=500, height=160, corner_radius=10)
|
||||
self.adjustments.frame_height.grid(row=2, column=1, sticky="nw")
|
||||
|
||||
self.height_label = CTkLabel(self.adjustments.frame_height, justify="center", text_font=(App.NUMBOX_FONT, 19), text="Height")
|
||||
self.height_label.configure(justify="center", text_font=(App.NUMBOX_FONT, 19), text="Height")
|
||||
self.height_label.grid(row=0, column=0, columnspan=2)
|
||||
|
||||
self.height_label_cur = CTkLabel(self.adjustments.frame_height, justify="center", text_font=(App.NUMBOX_FONT, 12), text="Current")
|
||||
self.height_label_cur.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Current")
|
||||
self.height_label_cur.grid(row=1, column=0, columnspan=1)
|
||||
|
||||
self.height_label_dest = CTkLabel(self.adjustments.frame_height)
|
||||
self.height_label_dest.configure(justify="center", text_font=(App.NUMBOX_FONT, 12), text="Destination")
|
||||
self.height_label_dest.grid(row=1, column=1, columnspan=1)
|
||||
|
||||
self.height_cur_num = CTkEntry(self.adjustments.frame_height)
|
||||
self.height_cur_num.configure(height=40, width=100, text_font=(App.NUMBOX_FONT, 12), state="normal", justify="center", placeholder_text="0")
|
||||
self.height_cur_num.grid(row=2, column=0, columnspan=1)
|
||||
|
||||
|
||||
self.height_dest_num = CTkEntry(self.adjustments.frame_height)
|
||||
self.height_dest_num.configure(height=40, width=100, text_font=(App.NUMBOX_FONT, 12), state="normal", justify="center", placeholder_text="0")
|
||||
self.height_dest_num.grid(row=2, column=1, columnspan=1)
|
||||
|
||||
|
||||
self.height_grab_cur = CTkButton(self.adjustments.frame_height)
|
||||
self.height_grab_cur.configure(text="→ Current", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=lambda: import_to("height", "cur"))
|
||||
self.height_grab_cur.grid(row=3, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.height_grab_go = CTkButton(self.adjustments.frame_height)
|
||||
self.height_grab_go.configure(text="→ Desitnation", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=lambda: import_to("height", "dest"))
|
||||
self.height_grab_go.grid(row=3, column=1, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.height_go_zero = CTkButton(self.adjustments.frame_height)
|
||||
self.height_go_zero.configure(text="0''", fg_color="green", hover_color="darkgreen", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.height_go_zero.grid(row=1, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.height_go_1 = CTkButton(self.adjustments.frame_height)
|
||||
self.height_go_1.configure(text="1''", fg_color="green", hover_color="darkgreen", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.height_go_1.grid(row=2, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.height_go = CTkButton(self.adjustments.frame_height)
|
||||
self.height_go.configure(text="GO!!", fg_color="green", hover_color="darkgreen", width=App.CAL_WIDTH, height=App.CAL_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.height_go.grid(row=3, column=2, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
# END Height Frame
|
||||
# END Adjustments Frame
|
||||
# Presets Frame
|
||||
self.presets = CTkFrame(self)
|
||||
self.presets.configure(width=130, height=480, corner_radius=10)
|
||||
self.presets.grid(row=0, column=2, sticky="n")
|
||||
|
||||
self.presets_label = CTkLabel(self.presets)
|
||||
self.presets_label.configure(justify="center", text_font=(App.NUMBOX_FONT, 19), text="Presets")
|
||||
self.presets_label.grid(row=0, column=0, columnspan=1)
|
||||
|
||||
self.presets_1 = CTkButton(self.presets)
|
||||
self.presets_1.configure(text="1", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_1.grid(row=1, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_2 = CTkButton(self.presets)
|
||||
self.presets_2.configure(text="2", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_2.grid(row=2, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_3 = CTkButton(self.presets)
|
||||
self.presets_3.configure(text="3", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_3.grid(row=3, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_4 = CTkButton(self.presets)
|
||||
self.presets_4.configure(text="4", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_4.grid(row=4, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_5 = CTkButton(self.presets)
|
||||
self.presets_5.configure(text="5", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_5.grid(row=5, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_6 = CTkButton(self.presets)
|
||||
self.presets_6.configure(text="6", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_6.grid(row=6, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_7 = CTkButton(self.presets)
|
||||
self.presets_7.configure(text="7", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_7.grid(row=7, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_8 = CTkButton(self.presets)
|
||||
self.presets_8.configure(text="8", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_8.grid(row=8, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_9 = CTkButton(self.presets)
|
||||
self.presets_9.configure(text="9", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_9.grid(row=9, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
self.presets_10 = CTkButton(self.presets)
|
||||
self.presets_10.configure(text="10", width=App.PRE_B_WIDTH, height=App.PRE_B_HEIGHT, text_font=(App.BUT_FONT, App.BUT_FONT_S), command=self.settings)
|
||||
self.presets_10.grid(row=10, column=0, padx=App.CAL_PADX, pady=App.CAL_PADY)
|
||||
|
||||
def settings(self):
|
||||
def close_set():
|
||||
settings.destroy()
|
||||
settings = CTkToplevel(self)
|
||||
settings.geometry("400x200")
|
||||
|
||||
# create label on CTkToplevel window
|
||||
label = CTkLabel(settings, text="Settings")
|
||||
label.pack(side="top", fill="both", expand=True, padx=40, pady=40)
|
||||
settings.s_quit = CTkButton(settings, text="Quit", command=close_set)
|
||||
settings.s_quit.pack(side="top", padx=40, pady=40)
|
||||
|
||||
|
||||
app = App()
|
||||
app.mainloop()
|
Loading…
Reference in New Issue