コード例 #1
0
ファイル: search.py プロジェクト: icefrostpeng/Moviebase
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9'  # X11 color: 'gray85'
        _ana1color = '#d9d9d9'  # X11 color: 'gray85'
        _ana2color = '#ececec'  # Closest X11 color: 'gray92'
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.configure('.', font="TkDefaultFont")
        self.style.map('.',
                       background=[('selected', _compcolor),
                                   ('active', _ana2color)])

        top.geometry("1280x686+212+135")
        top.minsize(120, 1)
        top.maxsize(3004, 1913)
        top.resizable(1, 1)
        top.title("New Toplevel")
        top.configure(background="#000040")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="#000000")

        top.resizable(False, False)
        global img
        img = ImageTk.PhotoImage(file="bg.png")
        self.Background = tk.Label(top, image=img)
        self.Background.place(relx=0, rely=0, height=900, width=1200)
        self.Background = img

        self.menubar = tk.Menu(top,
                               font="TkMenuFont",
                               bg=_bgcolor,
                               fg=_fgcolor)
        top.configure(menu=self.menubar)

        ################################################################Result instance############################################################
        self.Movie1 = tk.Frame(top)
        self.Movie1.place(relx=0.18,
                          rely=0.233,
                          relheight=0.138,
                          relwidth=0.621)

        self.Movie1.configure(relief='groove')
        self.Movie1.configure(borderwidth="2")
        self.Movie1.configure(relief="groove")
        self.Movie1.configure(background="#00002b")

        self.Image1 = tk.Label(self.Movie1)
        self.Image1.place(relx=0.025, rely=0.095, height=73, width=135)
        self.Image1.configure(background="#d9d9d9")
        self.Image1.configure(disabledforeground="#a3a3a3")
        self.Image1.configure(foreground="#000000")
        self.Image1.configure(text='''image''')

        self.Description1 = tk.Label(self.Movie1)
        self.Description1.place(relx=0.239, rely=0.095, height=73, width=573)
        self.Description1.configure(anchor='nw')
        self.Description1.configure(background="#00002b")
        self.Description1.configure(cursor="fleur")
        self.Description1.configure(disabledforeground="#a3a3a3")
        self.Description1.configure(font="-family {Segoe UI} -size 12")
        self.Description1.configure(foreground="#bcfbfe")
        self.Description1.configure(text='''description''')

        ##############################################################################################################################################

        ##################################################################scroller########################################################
        self.Previous = tk.Button(top)
        self.Previous.place(relx=0.383, rely=0.933, height=24, width=47)
        self.Previous.configure(activebackground="#ececec")
        self.Previous.configure(activeforeground="#000000")
        self.Previous.configure(background="#b4eafe")
        self.Previous.configure(disabledforeground="#a3a3a3")
        self.Previous.configure(font="-family {Segoe UI} -size 15")
        self.Previous.configure(foreground="#000000")
        self.Previous.configure(highlightbackground="#d9d9d9")
        self.Previous.configure(highlightcolor="black")
        self.Previous.configure(pady="0")
        self.Previous.configure(text='''<''')

        self.Next = tk.Button(top)
        self.Next.place(relx=0.57, rely=0.933, height=24, width=47)
        self.Next.configure(activebackground="#ececec")
        self.Next.configure(activeforeground="#000000")
        self.Next.configure(background="#b4eafe")
        self.Next.configure(disabledforeground="#a3a3a3")
        self.Next.configure(font="-family {Segoe UI} -size 15")
        self.Next.configure(foreground="#000000")
        self.Next.configure(highlightbackground="#d9d9d9")
        self.Next.configure(highlightcolor="black")
        self.Next.configure(pady="0")
        self.Next.configure(text='''>''')

        self.Page_list = tk.Label(top)
        self.Page_list.place(relx=0.43, rely=0.933, height=21, width=164)
        self.Page_list.configure(activebackground="#f0f0f0f0f0f0")
        self.Page_list.configure(background="#000040")
        self.Page_list.configure(disabledforeground="#a3a3a3")
        self.Page_list.configure(font="-family {Segoe UI} -size 12")
        self.Page_list.configure(foreground="#b4eafe")
        self.Page_list.configure(text='''1 of 4''')

        Searchbar.__init__(self, top=None)
        Memberbar.__init__(self, top=None)
        Homebar.__init__(self, top=None)
        Sidebar.__init__(self, top=None)
コード例 #2
0
    def __init__(self, name, mem, email, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9'  # X11 color: 'gray85'
        _ana1color = '#d9d9d9'  # X11 color: 'gray85'
        _ana2color = '#ececec'  # Closest X11 color: 'gray92'
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.configure('.', font="TkDefaultFont")
        self.style.map('.',
                       background=[('selected', _compcolor),
                                   ('active', _ana2color)])

        top.geometry("1280x686+297+168")
        top.minsize(120, 1)
        top.maxsize(3004, 1913)
        top.resizable(1, 1)
        top.title("New Toplevel")
        top.configure(background="#000040")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="#000000")

        top.resizable(False, False)
        img = ImageTk.PhotoImage(file="bg.png")
        self.Background = tk.Label(top, image=img)
        self.Background.place(relx=0, rely=0, height=1000, width=1500)
        self.Background = img

        self.menubar = tk.Menu(top,
                               font="TkMenuFont",
                               bg=_bgcolor,
                               fg=_fgcolor)
        top.configure(menu=self.menubar)

        ####################################################################Movies Slider###################################################################
        global d
        global to
        to = top
        img = ImageTk.PhotoImage(
            Image.open(d[0][0]).resize((560, 277), Image.ANTIALIAS))
        self.Movie_image = tk.Label(top, image=img)
        self.Movie_image.place(relx=0.202, rely=0.286, height=277, width=560)
        self.Movie_image = img

        self.Previous_b = tk.Button(top, command=lambda: self.bac(top))
        self.Previous_b.place(relx=0.172, rely=0.277, height=284, width=27)
        self.Previous_b.configure(activebackground="#000040")
        self.Previous_b.configure(activeforeground="white")
        self.Previous_b.configure(activeforeground="#ffffff")
        self.Previous_b.configure(background="#b3eaff")
        self.Previous_b.configure(disabledforeground="#a3a3a3")
        self.Previous_b.configure(
            font="-family {Segoe UI} -size 20 -weight bold")
        self.Previous_b.configure(foreground="#000000")
        self.Previous_b.configure(highlightbackground="#d9d9d9")
        self.Previous_b.configure(highlightcolor="black")
        self.Previous_b.configure(pady="0")
        self.Previous_b.configure(text='''<''')

        self.Next_b = tk.Button(top, command=lambda: self.ahead(top))
        self.Next_b.place(relx=0.648, rely=0.277, height=284, width=27)
        self.Next_b.configure(activebackground="#000040")
        self.Next_b.configure(activeforeground="white")
        self.Next_b.configure(activeforeground="#ffffff")
        self.Next_b.configure(background="#b3eaff")
        self.Next_b.configure(disabledforeground="#a3a3a3")
        self.Next_b.configure(font="-family {Segoe UI} -size 20 -weight bold")
        self.Next_b.configure(foreground="#000000")
        self.Next_b.configure(highlightbackground="#d9d9d9")
        self.Next_b.configure(highlightcolor="black")
        self.Next_b.configure(pady="0")
        self.Next_b.configure(text='''>''')

        #########################################################################################################################################

        ##########################################################Main##########################################################
        self.Label3 = tk.Label(top)
        self.Label3.place(relx=0.172, rely=0.131, height=48, width=193)
        self.Label3.configure(activebackground="#f9f9f9")
        self.Label3.configure(activeforeground="black")
        self.Label3.configure(background="#000040")
        self.Label3.configure(borderwidth="5")
        self.Label3.configure(disabledforeground="#a3a3a3")
        self.Label3.configure(font="-family {Segoe UI} -size 22")
        self.Label3.configure(foreground="#ffffff")
        self.Label3.configure(highlightbackground="#d9d9d9")
        self.Label3.configure(highlightcolor="black")
        self.Label3.configure(text='''Recommended!''')

        self.Movie_image = tk.Label(top)
        self.Movie_image.place(relx=0.202, rely=0.286, height=277, width=560)
        self.Movie_image.configure(activebackground="#f9f9f9")
        self.Movie_image.configure(activeforeground="black")
        self.Movie_image.configure(background="#d9d9d9")
        self.Movie_image.configure(disabledforeground="#a3a3a3")
        self.Movie_image.configure(foreground="#000000")
        self.Movie_image.configure(highlightbackground="#d9d9d9")
        self.Movie_image.configure(highlightcolor="black")

        self.Book_b = tk.Button(top)
        self.Book_b.place(relx=0.215, rely=0.752, height=54, width=177)
        self.Book_b.configure(activebackground="#000040")
        self.Book_b.configure(activeforeground="white")
        self.Book_b.configure(activeforeground="#ffffff")
        self.Book_b.configure(background="#b3eaff")
        self.Book_b.configure(disabledforeground="#a3a3a3")
        self.Book_b.configure(cursor="hand2")
        self.Book_b.configure(font="-family {Segoe UI} -size 14")
        self.Book_b.configure(foreground="#000000")
        self.Book_b.configure(highlightbackground="#d9d9d9")
        self.Book_b.configure(highlightcolor="black")
        self.Book_b.configure(pady="0")
        self.Book_b.configure(text='''Book Ticket!''')

        self.Description_f = tk.LabelFrame(top)
        self.Description_f.place(relx=0.357,
                                 rely=0.729,
                                 relheight=0.108,
                                 relwidth=0.287)
        self.Description_f.configure(relief='groove')
        self.Description_f.configure(foreground="black")
        self.Description_f.configure(background="#d9d9d9")
        #self.Description_f.configure(cursor="fleur")
        self.Description_f.configure(highlightbackground="#d9d9d9")
        self.Description_f.configure(highlightcolor="black")

        self.Description_l = tk.Label(self.Description_f)
        self.Description_l.place(relx=0.008,
                                 rely=0.041,
                                 height=72,
                                 width=360,
                                 bordermode='ignore')
        self.Description_l.configure(activebackground="#f9f9f9")
        self.Description_l.configure(activeforeground="black")
        self.Description_l.configure(anchor='nw')
        self.Description_l.configure(background="#000040")
        self.Description_l.configure(disabledforeground="#a3a3a3")
        self.Description_l.configure(font="-family {Segoe UI} -size 12")
        self.Description_l.configure(foreground="#ffffff")
        self.Description_l.configure(highlightbackground="#d9d9d9")
        self.Description_l.configure(highlightcolor="black")
        self.Description_l.configure(text='''Description''')

        self.Info_f = tk.LabelFrame(top)
        self.Info_f.place(relx=0.685,
                          rely=0.294,
                          relheight=0.389,
                          relwidth=0.122)
        self.Info_f.configure(relief='groove')
        self.Info_f.configure(foreground="black")
        self.Info_f.configure(background="#000040")
        self.Info_f.configure(highlightbackground="#d9d9d9")
        self.Info_f.configure(highlightcolor="black")

        self.Rating_l = tk.Label(self.Info_f)
        self.Rating_l.place(relx=0.045,
                            rely=0.026,
                            height=27,
                            width=146,
                            bordermode='ignore')
        self.Rating_l.configure(activebackground="#f9f9f9")
        self.Rating_l.configure(activeforeground="black")
        self.Rating_l.configure(background="#000040")
        self.Rating_l.configure(disabledforeground="#a3a3a3")
        self.Rating_l.configure(font="-family {Segoe UI} -size 14")
        self.Rating_l.configure(foreground="#ffffff")
        self.Rating_l.configure(highlightbackground="#d9d9d9")
        self.Rating_l.configure(highlightcolor="black")
        self.Rating_l.configure(text='''Rating''')

        self.TSeparator1 = ttk.Separator(self.Info_f)
        self.TSeparator1.place(relx=0.032,
                               rely=0.236,
                               relwidth=1.269,
                               bordermode='ignore')
        #####################################################Stars###########################################################

        self.Star1 = tk.Label(self.Info_f)
        self.Star1.place(relx=0.173,
                         rely=0.154,
                         height=14,
                         width=16,
                         bordermode='ignore')
        self.Star1.configure(activebackground="#f9f9f9")
        self.Star1.configure(activeforeground="black")
        self.Star1.configure(background="#000040")
        self.Star1.configure(disabledforeground="#a3a3a3")
        self.Star1.configure(foreground="#000000")
        self.Star1.configure(highlightbackground="#d9d9d9")
        self.Star1.configure(highlightcolor="black")

        self.Star2 = tk.Label(self.Info_f)
        self.Star2.place(relx=0.301,
                         rely=0.154,
                         height=14,
                         width=17,
                         bordermode='ignore')
        self.Star2.configure(activebackground="#f9f9f9")
        self.Star2.configure(activeforeground="black")
        self.Star2.configure(background="#000040")
        self.Star2.configure(disabledforeground="#a3a3a3")
        self.Star2.configure(foreground="#000000")
        self.Star2.configure(highlightbackground="#d9d9d9")
        self.Star2.configure(highlightcolor="black")

        self.Star3 = tk.Label(self.Info_f)
        self.Star3.place(relx=0.436,
                         rely=0.154,
                         height=14,
                         width=16,
                         bordermode='ignore')
        self.Star3.configure(activebackground="#f9f9f9")
        self.Star3.configure(activeforeground="black")
        self.Star3.configure(background="#000040")
        self.Star3.configure(disabledforeground="#a3a3a3")
        self.Star3.configure(foreground="#000000")
        self.Star3.configure(highlightbackground="#d9d9d9")
        self.Star3.configure(highlightcolor="black")

        self.Star4 = tk.Label(self.Info_f)
        self.Star4.place(relx=0.564,
                         rely=0.154,
                         height=14,
                         width=16,
                         bordermode='ignore')
        self.Star4.configure(activebackground="#f9f9f9")
        self.Star4.configure(activeforeground="black")
        self.Star4.configure(background="#000040")
        self.Star4.configure(disabledforeground="#a3a3a3")
        self.Star4.configure(foreground="#000000")
        self.Star4.configure(highlightbackground="#d9d9d9")
        self.Star4.configure(highlightcolor="black")

        self.Star5 = tk.Label(self.Info_f)
        self.Star5.place(relx=0.699,
                         rely=0.154,
                         height=14,
                         width=16,
                         bordermode='ignore')
        self.Star5.configure(activebackground="#f9f9f9")
        self.Star5.configure(activeforeground="black")
        self.Star5.configure(background="#000040")
        self.Star5.configure(disabledforeground="#a3a3a3")
        self.Star5.configure(foreground="#000000")
        self.Star5.configure(highlightbackground="#d9d9d9")
        self.Star5.configure(highlightcolor="black")

        #######################################################################################################################################

        self.Cast_l = tk.Label(self.Info_f)
        self.Cast_l.place(relx=0.045,
                          rely=0.558,
                          height=109,
                          width=145,
                          bordermode='ignore')
        self.Cast_l.configure(activebackground="#f9f9f9")
        self.Cast_l.configure(activeforeground="black")
        self.Cast_l.configure(anchor='nw')
        self.Cast_l.configure(background="#000040")
        self.Cast_l.configure(disabledforeground="#a3a3a3")
        self.Cast_l.configure(font="-family {Segoe UI} -size 12")
        self.Cast_l.configure(foreground="#ffffff")
        self.Cast_l.configure(highlightbackground="#d9d9d9")
        self.Cast_l.configure(highlightcolor="black")
        self.Cast_l.configure(text='''Cast''')

        self.Genre_l = tk.Label(self.Info_f)
        self.Genre_l.place(relx=0.045,
                           rely=0.277,
                           height=48,
                           width=145,
                           bordermode='ignore')
        self.Genre_l.configure(activebackground="#f9f9f9")
        self.Genre_l.configure(activeforeground="black")
        self.Genre_l.configure(background="#000040")
        self.Genre_l.configure(disabledforeground="#a3a3a3")
        self.Genre_l.configure(font="-family {Segoe UI} -size 13")
        self.Genre_l.configure(foreground="#ffffff")
        self.Genre_l.configure(highlightbackground="#d9d9d9")
        self.Genre_l.configure(highlightcolor="black")
        self.Genre_l.configure(text='''Genre''')

        self.TSeparator3 = ttk.Separator(top)
        self.TSeparator3.place(relx=0.165, rely=0.168, relheight=0.845)
        self.TSeparator3.configure(orient="vertical")

        self.Label8 = tk.Label(top)
        self.Label8.place(relx=0.172, rely=0.204, height=42, width=547)
        self.Label8.configure(activebackground="#f9f9f9")
        self.Label8.configure(activeforeground="black")
        self.Label8.configure(anchor='w')
        self.Label8.configure(background="#000040")
        self.Label8.configure(disabledforeground="#a3a3a3")
        self.Label8.configure(font="-family {Segoe UI} -size 20")
        self.Label8.configure(foreground="#ffffff")
        self.Label8.configure(highlightbackground="#d9d9d9")
        self.Label8.configure(highlightcolor="black")
        self.Label8.configure(text='''Title''')

        self.Label9 = tk.Label(top)
        self.Label9.place(relx=0.60, rely=0.204, height=42, width=547)
        self.Label9.configure(activebackground="#f9f9f9")
        self.Label9.configure(activeforeground="black")
        self.Label9.configure(anchor='w')
        self.Label9.configure(background="#000040")
        self.Label9.configure(disabledforeground="#a3a3a3")
        self.Label9.configure(font="-family {Segoe UI} -size 20")
        self.Label9.configure(foreground="#ffffff")
        self.Label9.configure(highlightbackground="#d9d9d9")
        self.Label9.configure(highlightcolor="black")
        self.Label9.configure(text='''UA/A''')

        Searchbar.__init__(self, top=None)
        Memberbar.__init__(self, mem, top=None)
        Homebar.__init__(self, name, mem, top=None)
        Sidebar.__init__(self, top=None)