import tkinter
from tkinter import *
from tkinter.ttk import *
from config import conf


class FrameTabsStart(Frame):
    def __init__(self, parent):
        super().__init__(parent)
        self.__frame()
        # self.tk_label_lab_api_base = self.__tk_label_lab_api_base(self)
        # self.tk_input_api_base = self.__tk_input_api_base(self)
        # self.tk_label_lab_api_key = self.__tk_label_lab_api_key(self)
        # self.tk_input_api_key = self.__tk_input_api_key(self)
        self.tk_label_lab_token = self.__tk_label_lab_token(self)
        self.tk_input_token = self.__tk_input_token(self)
        self.tk_button_save = self.__tk_button_save(self)
        self.tk_button_start = self.__tk_button_start(self)
        self.tk_button_pause = self.__tk_button_pause(self)
        self.tk_button_version = self.__tk_button_version(self)

    def __frame(self):
        self.place(x=0, y=0, width=675, height=510)

    # def __tk_label_lab_api_base(self, parent):
    #     label = Label(parent, text="API_BASE", anchor="center", )
    #     label.place(x=30, y=30, width=60, height=30)
    #     return label
    #
    # def __tk_label_lab_api_key(self, parent):
    #     label = Label(parent, text="API_KEY", anchor="center", )
    #     label.place(x=30, y=80, width=60, height=30)
    #     return label
    #
    # def __tk_input_api_base(self, parent):
    #     ipt = Entry(parent, )
    #     ipt.insert(0, conf().get("api_base"))
    #     ipt.place(x=100, y=30, width=520, height=30)
    #     return ipt
    #
    # def __tk_input_api_key(self, parent):
    #     ipt = Entry(parent, )
    #     ipt.insert(0, conf().get("api_key"))
    #     ipt.place(x=100, y=80, width=520, height=30)
    #     return ipt

    def __tk_input_token(self, parent):
        ipt = Entry(parent, )
        ipt.insert(0, conf().get("token"))
        ipt.place(x=100, y=30, width=520, height=30)
        return ipt

    def __tk_label_lab_token(self, parent):
        label = Label(parent, text="TOKEN", anchor="center", )
        label.place(x=30, y=30, width=60, height=30)
        return label

    def __tk_button_save(self, parent):
        btn = Button(parent, text="保存", takefocus=False, )
        btn.place(x=30, y=80, width=80, height=30)
        return btn

    def __tk_button_start(self, parent):
        btn = Button(parent, text="启动", takefocus=False, )
        btn.place(x=130, y=80, width=80, height=30)
        return btn

    def __tk_button_pause(self, parent):
        btn = Button(parent, text="暂停", takefocus=False, state=tkinter.DISABLED)
        btn.place(x=230, y=80, width=50, height=30)
        return btn

    def __tk_button_version(self, parent):
        btn = Button(parent, text="版本", takefocus=False)
        btn.place(x=530, y=80, width=50, height=30)
        return btn
