Exemple #1
0
    def createinputserial(self):
        gui(tktk=self.root,
            pathico=None,
            width=400,
            height=300,
            widthx=420,
            widthy=0,
            resizable=[True, True],
            title="AZB").setcfbs()

        self.canvas1 = tk.Canvas(root, width=400, height=300, bg="#5b9bd5")
        self.canvas1.pack()
        self.canvas1.create_text(200,
                                 100,
                                 text="Input Serial Number",
                                 fill="darkblue",
                                 font="Times 20 italic bold")
        self.entry1 = tk.Entry(root,
                               width=25,
                               justify=tk.CENTER,
                               font="Times 15 italic")
        self.canvas1.create_window(200, 140, window=self.entry1)
        button1 = tk.Button(text='OK',
                            command=self.getSquareRoot,
                            font="Times 15 italic")
        self.canvas1.create_window(200, 180, window=button1)
Exemple #2
0
    def __init__(
        self,
        tktk=None,
        br_image=None,
        pathico=None,
        br_image_path=None,
    ):

        self.tktk = tktk
        self.br_image = br_image
        self.pathico = pathico
        self.br_image_path = br_image_path

        filewin = Toplevel(self.tktk)
        gui(tktk=filewin,
            pathico=self.pathico,
            width=700,
            height=450,
            widthx=700,
            widthy=0,
            resizable=[True, True]).setcfbs()
        menu(tktk=filewin).createmenu()

        self.container = Frame(filewin, bg="white")

        self.container.pack(fill=BOTH, expand=True)
Exemple #3
0
        def __init__(self,tktk = None,
                        br_image = None,
                        pathico = None,
                        br_image_path = None):

                Frame.__init__(self, tktk)
                self.tktk = tktk

                self.br_image_path  = br_image_path

                self.br_image = br_image

                self.pathico = pathico

                self.filewin = Toplevel(self.tktk)

                gui (tktk=self.filewin,
                        pathico=self.pathico,
                        width=1280,
                        height=1024,
                        widthx=300,
                        widthy=0,
                        resizable=[True,True]).setcfbs()
                        
                # set data
                data = createData()
                menu (tktk=self.filewin).createmenu()

                #create label 
                self.framelb = Frame(self.filewin,bg = "slate gray")
                self.framelb.pack(side = TOP)

                #creare frame for infomation
                self.frameinfor = Frame(self.filewin,bg = "slate gray")
                self.frameinfor.pack(side = TOP)


                #create title 
                self.framett = Frame(self.filewin,bg = "slate gray")
                self.framett.pack(side = TOP)

                # creare frame for table  
                self.tframe = Frame(self.filewin)
                self.tframe.pack(fill = X,side = TOP)

                model = TableModel()
                table = TableCanvas(self.tframe, model=model,data=data,height=650)
                table.show()

               #update quotation
                self.frameupdate = Frame(self.filewin,bg = "slate gray")
                self.frameupdate.pack(side = TOP)
                
                # import and export excel 
                self.frameimeex = Frame(self.filewin,bg = "slate gray")
                self.frameimeex.pack(side = TOP)


                self.createguiin()
Exemple #4
0
    def __init__(self,tktk = None,
                br_image = None,
                pathico = None,
                br_image_path = None):

        Frame.__init__(self, tktk)
        self.tktk = tktk

        self.br_image_path  = br_image_path

        self.br_image = br_image

        self.pathico = pathico

        self.filewin = Toplevel(self.tktk)

        gui (tktk=self.filewin,
                    pathico=self.pathico,
                    width=1280,
                    height=1024,
                    widthx=300,
                    widthy=0,
                    resizable=[True,True]).setcfbs()
        # set menu 
        menu (tktk=self.filewin).createmenu()

        #gui for data 
        self.sc  = ScrolledCanvas(self.filewin)
        self.listframeindata = self.sc.framea
        self.listFramevp =  createcroll(listFrame=self.listframeindata,
                                        cavheight=850,
                                        cavwidth=473).createy1()
        self.creategui()

        #set frame image 
        self.listframefim = self.sc.framec
        self.listFramevp4 =createcroll(listFrame=self.listframefim,
                                        cavwidth=1355,
                                        cavheight=850,
                                        scrollbarr=False).createy1()
        self.addimage()

        self.canv = self.sc.returncavas()
        
        # add buttom next and previous
        self.buttomandnext()
        self.createbutton(crheight= 900)
Exemple #5
0
    def __init__(self, 
                    tktk = None,
                    pathicon =None,
                    *args,
                    labelfont = ('times', 20),
                    labelfont_sm = ('times', 16),
                    labelfont_botton = ('times', 11), 
                    pathclayout = None,
                    namequotation = "quotation.xlsx",
                    **kwargs):
       
        self.__tktk = tktk
        self.__labelfont = labelfont
        self.__labelfont_sm = labelfont_sm
        self.__pathclayout = pathclayout
        self.__labelfont_botton = labelfont_botton
        self.__filewin = tk.Toplevel(self.__tktk)
        self.__namequotation = namequotation
        gui (tktk=self.__filewin,
            pathico=pathicon,
            width=800,
            height=800,
            widthx="center",
            widthy="center",
            resizable=[True,True],
            condv=2.7
            )\
            .setcfbs()
        container = tk.Frame(self.__filewin,
                            bg = "white")
        container.pack(side="top",
                        fill="both", 
                        expand=True)

        #gui for data 
        self.__sc = scbg(parent = container,
                        cavheight=600,
                        cavwidth=600,
                        bg = "white", 
                        bgpr = "#5b9bd5"
                        )

        self.__listFramevp = self.__sc.framecv
        self.__creategui()
    def __init__(self,
                 tktk=None,
                 pathtokey=None,
                 pathtovaluecsv_key=None,
                 valueser_key=None,
                 ser_key=None,
                 product_id=None,
                 using_permanent_key=False,
                 path_mc_id=None,
                 **kw):

        self.__tktk = tktk

        tktk['bg'] = "#5b9bd5"

        self.pathtokey = pathtokey
        self.pathtovaluecsv_key = pathtovaluecsv_key
        self.valueser_key = valueser_key
        self.ser_key = ser_key
        self.product_id = product_id
        self.using_permanent_key = using_permanent_key
        self.path_mc_id = path_mc_id
        gui(tktk=tktk, **kw).setcfbs()
        self.gui_ser()
Exemple #7
0
    def __init__(self,
                 tktk=None,
                 br_image=None,
                 pathico=None,
                 br_image_path=None,
                 logoicon=None,
                 imagenext=None,
                 imagepre=None,
                 imagenextlayout=None,
                 imageprelayout=None,
                 dirfolder=None,
                 pathclayout=None,
                 *args,
                 **kwargs):
        self.tktk = tktk
        self.br_image = br_image
        self.pathico = pathico
        self.br_image_path = br_image_path
        self.logoicon = logoicon
        self.imagenext = imagenext
        self.imagepre = imagepre
        self.imagenextlayout = imagenextlayout
        self.imageprelayout = imageprelayout
        self.dirfolder = dirfolder
        tk.Frame.__init__(self, tktk)

        # the container is where we'll stack a bunch of frames
        # on top of each other, then the one we want visible
        # will be raised above the others
        self.filewin = tk.Toplevel(self.tktk)
        container = tk.Frame(self.filewin, bg="white")
        container.pack(side="top", fill="both", expand=True)

        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)
        gui(tktk=self.filewin,
            pathico=self.pathico,
            width=800,
            height=800,
            widthx="center",
            widthy="center",
            condv=2.7,
            resizable=[True, True]).setcfbs()

        # set menu
        menu(tktk=self.filewin, pathicon=pathico,
             pathclayout=pathclayout).createmenu()
        self.frames = {}
        for F in (incus, reqbuild):
            page_name = F.__name__
            frame = F(tktk=container,
                      controller=self,
                      br_image=self.br_image,
                      pathico=self.pathico,
                      br_image_path=self.br_image_path,
                      logoicon=self.logoicon,
                      imagenext=self.imagenext,
                      imagepre=self.imagepre,
                      imagenextlayout=self.imagenextlayout,
                      imageprelayout=self.imageprelayout,
                      dirfolder=self.dirfolder)
            self.frames[page_name] = frame
            # put all of the pages in the same location;
            # the one on the top of the stacking order
            # will be the one that is visible.
            frame.grid(row=0, column=0, sticky="nsew")
        self.show_frame("incus")
Exemple #8
0
    def guiforgd(self):
        """Create interface for software"""
        gui(tktk=self.root,
            pathico=None,
            width=700,
            height=420,
            widthx=420,
            widthy=0,
            resizable=[True, True],
            title="FAPP").setcfbs()

        self.sc = scbg(
            parent=self.root,
            cavheight=250,
            cavwidth=365,
            isonlyaframe=False,
            bg="#e6ecf5",
            bgpr="#5b9bd5",
            framea=[0, 0, 365, 250, "#e6ecf5"],
        )
        large_font = ("times new roman", 12)
        large_font_1 = ("times new roman", 17)
        lb = tk.Label(self.root,
                      text="Mr.Nhuần - [email protected]",
                      font=large_font,
                      bg="#5b9bd5")
        lb.place(relx=0.5, rely=0.87, anchor=tk.CENTER)

        self.framea = self.sc.framea

        lbt = tk.Label(
            self.framea,
            bg="#e6ecf5",
            fg="black",
            text="Input your information",
            font=large_font_1,
        )
        lbt.grid(row=0, column=0, columnspan=6, sticky=tk.EW)
        # path to folder child
        repath = tk.Label(
            self.framea,
            text="Retrieve Path:",
            width=10,
            font=large_font,
            bg="#e6ecf5",
        )
        repath.grid(row=1, column=0, sticky=tk.W, padx=(5, 0))

        self.output1 = tk.Entry(
            self.framea,
            font=large_font,
            justify=tk.CENTER,
            width=20,
            relief=tk.SOLID,
            bg="yellow",
        )
        self.output1.grid(row=2, column=0, padx=(5, 0))

        button = tk.Button(self.framea,
                           height=1,
                           width=2,
                           bd=1,
                           command=lambda: self.mfileopend(
                               outputtk=self.output1, combopc=self.combopc))
        button.grid(row=2, column=1, sticky="we")

        lsheets = None
        self.pc = tk.StringVar()
        self.combopc = ttk.Combobox(
            self.framea,
            textvariable=self.pc,
            width=20,
            values=["Active Sheet", "Select Sheet Name"],
            state="readonly",
            justify='center')

        self.combopc.grid(column=2, row=2, padx=(10, 0))

        self.combopc.bind("<<ComboboxSelected>>", self.selected_rev)
        self.combopc.current(1)

        # destination
        repathdes = tk.Label(
            self.framea,
            text="Destination Path:",
            font=large_font,
            bg="#e6ecf5",
        )
        repathdes.grid(row=3, column=0, sticky=tk.W, pady=(5, 0), padx=(5, 0))

        self.repathdes = tk.Entry(
            self.framea,
            font=large_font,
            justify=tk.CENTER,
            relief=tk.SOLID,
            bg="yellow",
        )
        self.repathdes.grid(row=4, column=0, sticky=tk.EW, padx=(5, 0))

        buttondes = tk.Button(
            self.framea,
            height=1,
            width=4,
            bd=1,
            command=lambda: self.mfileopend(outputtk=self.repathdes,
                                            combopc=self.combo_des))
        buttondes.grid(row=4, column=1, sticky="we")

        self.pc_des = tk.StringVar()
        self.combo_des = ttk.Combobox(
            self.framea,
            textvariable=self.pc_des,
            width=15,
            values=["Active Sheet", "Select Sheet Name"],
            state="readonly",
            justify='center')
        self.combo_des.grid(column=2, row=4, sticky=tk.EW, padx=(10, 0))

        self.combo_des.current(1)

        self.combo_des.bind("<<ComboboxSelected>>", self.selected_des)

        func = tk.Label(
            self.framea,
            text="Function Excel:",
            font=large_font,
            bg="#e6ecf5",
        )
        func.grid(row=5, column=0, sticky=tk.W, padx=(5, 0))
        self.pc_fun = tk.StringVar()

        lfun = ["Select Function In Excel"] + filterlistbylstr(
            liststr=list(returndictrowforcsv(self.pathconfig).keys()),
            criteria_is_not=True,
            criteria=["sub_"],
            upper=True)
        self.combo_fun = ttk.Combobox(self.framea,
                                      textvariable=self.pc_fun,
                                      width=15,
                                      values=lfun,
                                      state="readonly",
                                      justify='center')
        self.combo_fun.grid(column=0,
                            row=6,
                            columnspan=3,
                            sticky=tk.EW,
                            padx=(5, 0))

        self.combo_fun.current(0)

        self.combo_fun.bind("<<ComboboxSelected>>", self.selected_des)

        button_open = tk.Button(
            self.framea,
            height=1,
            width=8,
            text="Open_Conf",
            bd=1,
            command=lambda: openexcelbyxl(self.pathconfigexell))
        button_open.grid(row=7, column=0, sticky="w", padx=(5, 0))

        button_conf = tk.Button(
            self.framea,
            height=1,
            width=8,
            text="Up_Conf",
            bd=1,
            command=lambda: hconfazb(pathconf=self.pathconfig,
                                     pathexconf=self.pathconfigexell
                                     ).convertocsv())
        button_conf.grid(row=7, column=2, sticky="e")

        run = tk.Button(self.framea,
                        height=1,
                        width=4,
                        text="Run",
                        bd=1,
                        command=lambda: fformulas(
                            retr_path=getpathfromtk(
                                self.output1, Warning_path_existing=False),
                            des_path=getpathfromtk(
                                self.repathdes, Warning_path_existing=False),
                            retr_sheetname=self.pc.get(),
                            des_sheetname=self.pc_des.get(),
                            fuction=self.pc_fun.get(),
                            pathconf=self.pathconfig).filltoexcell())
        run.grid(row=9, column=1, sticky="e")

        run = tk.Button(self.framea,
                        height=1,
                        width=4,
                        text="Quit",
                        bd=1,
                        command=self.root.quit)
        run.grid(row=10, column=1, sticky="e")
Exemple #9
0
    def __init__(self,
                 tktk=None,
                 br_image=None,
                 pathico=None,
                 br_image_path=None):

        Frame.__init__(self, tktk)
        self.tktk = tktk

        self.br_image_path = br_image_path

        self.br_image = br_image

        self.pathico = pathico

        self.filewin = Toplevel(self.tktk)

        gui(tktk=self.filewin,
            pathico=self.pathico,
            width=1280,
            height=1024,
            widthx=300,
            widthy=0,
            resizable=[True, True]).setcfbs()
        # set menu
        menu(tktk=self.filewin).createmenu()

        #gui for inputdata
        self.sc = ScrolledCanvas(self.filewin)
        self.listframeindata = self.sc.framea
        self.listFramevp = createcroll(listFrame=self.listframeindata,
                                       cavheight=450,
                                       cavwidth=473).createy1()

        # gui for resurlt
        self.listframert = self.sc.frameb
        self.listFramevp2 = createcroll(listFrame=self.listframert,
                                        cavwidth=490,
                                        cavheight=442,
                                        scrollbarr=False).createy1()
        self.seleevent()

        #set frame image
        self.listframefim = self.sc.framec
        self.listFramevp4 = createcroll(listFrame=self.listframefim,
                                        cavwidth=1355,
                                        cavheight=455,
                                        scrollbarr=True).createy1()
        self.addimage()

        # add quotation
        self.framequation = self.sc.framed

        self.framequationin = createcroll(listFrame=self.framequation,
                                          cavwidth=1355,
                                          cavheight=440,
                                          scrollbarr=False).createy1()

        self.quotationforctn()

        self.canv = self.sc.returncavas()

        # add buttom next and previous
        self.buttomandnext()

        #create buttom "Next"
        self.createbutton()
        #create buttom modify
        self.createbutton(crheight=530, crwidth=580, namebutton="VIEW FULL")
Exemple #10
0
    def guiforgd(self):
        gui(tktk=self.root,
            pathico=None,
            width=700,
            height=700,
            widthx=420,
            widthy=0,
            resizable=[True, True],
            title="AZB").setcfbs()

        self.sc = scbg(parent=self.root,
                       cavheight=420,
                       cavwidth=470,
                       isonlyaframe=False,
                       bg="#e6ecf5",
                       bgpr="#5b9bd5",
                       framea=[0, 0, 470, 130, "#e6ecf5"],
                       frameb=[0, 130, 470, 100, "white"],
                       framec=[0, 240, 470, 160, "#e6ecf5"])
        self.framea = self.sc.framea
        self.frameb = self.sc.frameb
        self.framec = self.sc.framec
        large_font = ("times new roman", 12)
        lbt = tk.Label(
            self.framea,
            bg="#e6ecf5",
            image=self.imagelogo,
        )
        lbt.grid(row=0, column=0, columnspan=3, sticky=tk.EW)
        # path to folder child
        lbt1 = tk.Label(
            self.framea,
            text="Path To Folder:",
            width=10,
            font=large_font,
            bg="#e6ecf5",
        )
        lbt1.grid(row=1, column=0, sticky=tk.W)
        # create output text, it is used to save directory
        self.output1 = tk.Entry(self.framea,
                                font=large_font,
                                justify=tk.CENTER,
                                width=40,
                                relief=tk.SOLID,
                                bg="yellow")
        self.output1.grid(
            row=1,
            column=1,
        )
        button = tk.Button(self.framea,
                           height=1,
                           width=4,
                           bd=1,
                           command=lambda: self.mfolderopenchild())
        button.grid(row=1, column=2, sticky="we")

        # path to folder parent file
        lbt1 = tk.Label(self.framec,
                        text="Path To Pfile:",
                        width=10,
                        font=large_font,
                        bg="#e6ecf5")
        lbt1.grid(row=0, column=0, sticky=tk.W)
        # frame c
        # create output text, it is used to save directory
        self.output1p = tk.Entry(self.framec,
                                 font=large_font,
                                 justify=tk.CENTER,
                                 width=40,
                                 relief=tk.SOLID,
                                 bg="yellow")

        self.output1p.grid(
            row=0,
            column=1,
        )
        button = tk.Button(self.framec,
                           height=1,
                           width=4,
                           bd=1,
                           command=lambda: self.mfileopenparent())
        button.grid(row=0, column=2, sticky="we")
        #copy past range
        self.openfile5 = tk.Button(self.framec,
                                   text="Copy HM",
                                   width=10,
                                   height=1,
                                   command=lambda: crangeactive(
                                       pathconf=self.pathconfig,
                                       pathconfigexcelcopy=self.
                                       pathconfigexcelcopy).copyrangfromconf())
        self.openfile5.grid(row=1, column=1, sticky="w")

        #copy past range
        self.openfile5 = tk.Button(
            self.framec,
            text="Fct",
            width=10,
            height=1,
            command=lambda: hdatahm(pathconf=self.pathconfig))
        self.openfile5.grid(row=1, column=1, sticky="e")

        #only handling data tong hop
        self.openfile2 = tk.Button(
            self.framec,
            text="ValueFTHVT",
            width=10,
            height=1,
            command=lambda: hexcel(pathconf=self.pathconfig
                                   ).valuehangmucforthvt())
        self.openfile2.grid(row=2, column=1, sticky="w")

        #only handling to parent
        self.openfile4 = tk.Button(
            self.framec,
            text="Update Data",
            width=10,
            height=1,
            command=lambda: hexcel(pathconf=self.pathconfig,
                                   pathconfigexcelcopy=self.pathconfigexcelcopy
                                   ).gdatafromothersheet())

        self.openfile4.grid(row=2, column=1, sticky="e")

        #only handling data kid
        self.openfile1 = tk.Button(self.framec,
                                   text="Child",
                                   width=10,
                                   height=1,
                                   command=lambda: self.hdatafilechecked())

        self.openfile1.grid(row=3, column=1, sticky="w")

        #only handling to parent
        self.openfile3 = tk.Button(self.framec,
                                   text="Run To Parent",
                                   width=10,
                                   height=1,
                                   command=lambda: self.getCheckedItem())

        self.openfile3.grid(row=3, column=1, sticky="e")

        # open conf excel
        self.openfile3a = tk.Button(
            self.framec,
            text="open config",
            width=10,
            height=1,
            command=lambda: openexcelbyxl(self.pathconfigexell))
        self.openfile3a.grid(row=4, column=1, sticky="w")

        # open conf excel
        self.openfile3b = tk.Button(
            self.framec,
            text="update config",
            width=10,
            height=1,
            command=lambda: hconfazb(pathconf=self.pathconfig,
                                     pathexconf=self.pathconfigexell
                                     ).convertocsv())
        self.openfile3b.grid(row=4, column=1, sticky="e")

        # open conf excel
        self.openfile3a = tk.Button(
            self.framec,
            text="Temp excelhm",
            width=10,
            height=1,
            command=lambda: openexcelbyxl(self.pathconfigexcelcopy))
        self.openfile3a.grid(row=5, column=1, sticky="w")

        #only handling to parent
        self.openfile5 = tk.Button(
            self.framec,
            text="Update PTVT",
            width=10,
            height=1,
            command=lambda: covertcsvexcel(pathconf=self.pathconfig))
        self.openfile5.grid(row=5, column=1, sticky="e")

        #quit widget
        buttom_quit = tk.Button(self.framec,
                                text="Exit",
                                width=10,
                                height=1,
                                command=self.root.quit)
        buttom_quit.grid(row=3, column=1)