def __init__(self, parent, font=None, **kwargs): super().__init__(parent, **kwargs) self.apply = lib.LabelButton(self, "Apply", font=font, width=6) self.save = lib.LabelButton(self, "Save", font=font, width=6) self.reset = lib.LabelButton(self, "Reset", font=font, width=6, bg="yellow") self.apply.grid(row=0, column=0, sticky="nswe", pady=2, padx=2) self.save.grid(row=1, column=0, sticky="nswe", pady=2, padx=2) self.reset.grid(row=2, column=0, sticky="nswe", pady=2, padx=2) self.grid_columnconfigure(0, weight=1)
def __init__(self, parent, **kwargs): super().__init__(parent, **kwargs) self.title("Shutdown") label = tk.Label(self, text="Shutdown Options", font=self.font) shutdown_button = lib.LabelButton(self, "Shutdown", font=self.font, bg="red", command=partial(shutdown)) restart_button = lib.LabelButton(self, "Restart", font=self.font, command=partial(reboot)) close_button = lib.LabelButton(self, "Close", font=self.font, bg="green", command=partial(self.destroy)) label.grid(row=0, column=0, columnspan=2, sticky="nswe", padx=5, ipady=5) shutdown_button.grid(row=1, column=1, sticky="nswe", padx=5, pady=5) restart_button.grid(row=2, column=1, sticky="nswe", padx=5, pady=5) close_button.grid(row=2, column=0, sticky="nswe", padx=5, pady=5)
def open_drawer(self): label = lib.LabelButton(self, text="Open Drawer", font=ToggleFrame.font, command=functools.partial( lib.AsyncTk().forward, "open_drawer")) label.grid(row=0, column=3, sticky="nswe", padx=3, pady=3, ipadx=5)
def __init__(self, parent, keyboard, font=None,**kwargs): super().__init__(parent, **kwargs) if font is None: font = type(self).font type(self).font = font self.keyboard = keyboard self.on_add = lib.LabelButton.null_cmd self._payment_type = tk.StringVar(self) self.entry = tk.Entry(self, textvariable=self._payment_type, font=self.font, width=15) self.add_button = lib.LabelButton(self, text="Add", command=self.on_add, font=self.font) self.entry.grid(row=0, column=0, sticky="nswe", pady=4, padx=2, ipady=2, ipadx=2) self.add_button.grid( row=0, column=1, pady=4, padx=2, ipady=2, ipadx=2) self.bind("<FocusIn>", self.on_focus_in)
def daily_sales_printer(self): command = functools.partial(lib.AsyncTk().forward, "print_daily_sales") label = tk.Label(self, text="Daily Sales", font=ToggleFrame.font) button = lib.LabelButton(self, text="Print", command=command, font=ToggleFrame.font) label.grid(row=1, column=1, sticky="nswe", padx=3, pady=3) button.grid(row=1, column=2, sticky="nswe", padx=3, pady=3)
def add_invoice_printer(self): command = functools.partial(lib.AsyncTk().forward, "print_invoice") label = tk.Label(self, text="Invoice Receipt", font=ToggleFrame.font) button = lib.LabelButton(self, text="Print", command=command, font=ToggleFrame.font) label.grid(row=0, column=1, sticky="nswe", padx=3, pady=3) button.grid(row=0, column=2, sticky="nswe", padx=3, pady=3)
def __init__(self, parent, menu_item=None): super().__init__(parent) if menu_item is None: menu_item = lib.MenuItem("", "", 0, {}, "", 0) self.removed = True self.category = menu_item.category self.item = menu_item.name self.price = menu_item.price self.price_entry["font"] = self.font self.item_entry.configure(font=self.font, state=tk.DISABLED, disabledforeground="black") self.options_bt = lib.LabelButton(self, text="Options", width=7, font=self.font) self.remove_bt = lib.LabelButton(self, text="Remove", width=7, font=self.font, command=self.grid_remove) self.options_bt.grid(row=0, column=2, sticky="nswe", padx=2) self.remove_bt.grid(row=0, column=3, sticky="nswe", padx=2)
def __init__(self, parent, option="", price=0, **kwargs): super().__init__(parent, **kwargs) self.item = option self.price = price self.item_entry.grid(row=0, column=0, columnspan=2, sticky="nswe", padx=2) self.price_entry.grid(row=0, column=2, sticky="nswe", padx=2) self.removed = False self.remove_bt = lib.LabelButton(self, "Remove", width=7, font=self.font, command=self.destroy) self.remove_bt.grid(row=0, column=3, sticky="nswe", padx=2)
def __init__(self, parent, keyboard, font=None, **kwargs): super().__init__(parent, **kwargs) self.keyboard = keyboard self._category = tk.StringVar(self) self._has_focus = False self.cat_entry = tk.Entry(self, textvariable=self._category, font=font) self.entry = PriceEntry(self, font=font) self.add_item = lib.LabelButton(self, "Add", font=font) self.cat_entry.grid(row=0, column=0, sticky="nswe", padx=2, pady=2) self.entry.grid(row=0, column=1, sticky="nswe", padx=2, pady=2) self.add_item.grid(row=0, column=2, sticky="nswe", ipadx=2, pady=2) self.cat_entry.bind("<FocusIn>", self.acquire) self.cat_entry.bind("<FocusOut>", self.on_focus_out)
def __init__(self, parent, options, **kwargs): super().__init__(parent, **kwargs) self.options = options self.add_button = lib.LabelButton(self, "add", width=5, font=ItemOptionsEditor.font, command=self._add_callback) self.close_button = lib.LabelButton(self, "close", width=5, font=ItemOptionsEditor.font, command=self._close_callback) self.widgets = [ItemOptionsEditor(self, option=option, price=self.options[option]) for option in self.options] self.add_button.grid(row=0, column=0, sticky="nswe", padx=2, pady=2) self.close_button.grid(row=0, column=1, sticky="nswe", padx=2, pady=2) for i, widget in enumerate(self.widgets): widget.grid(row=i +1, column=0, columnspan=4, sticky="nswe")
def __init__(self, parent, payment_option, **kwargs): super().__init__(parent, **kwargs) self._payment_type = tk.Label(self, text=payment_option, font=self.font, width=15, relief=tk.SUNKEN, bd=2) self._remove_bt = lib.LabelButton(self, "remove", command=self.remove, font=self.font) self._payment_type.grid(row=0, column=0, sticky="nswe", pady=2, padx=2, ipady=2, ipadx=2) self._remove_bt.grid(row=0, column=1, sticky="nswe", pady=2, padx=2, ipadx=2, ipady=2)