Exemplo n.º 1
0
    def __init__(self, parent, controller, page_name, back_command):
        self.back_command = back_command
        self.controller = controller
        self.return_frame = "homePage"
        self.yes_command = None

        cw.ThemedFrame.__init__(self, parent, background_color=dark_color)

        self.errortext = cw.ThemedLabel(
            self,
            "Welcome to the error page.\n\nIf you are seeing this, there was an error with the error page.\n\nFML",
            anchor="center",
            wraplength=500)

        errorframeheight = 100
        self.errortext.place(relx=0.5,
                             rely=0.3,
                             x=-250,
                             width=500,
                             height=4 * errorframeheight,
                             y=-(errorframeheight))

        self.backbuttonframe = cw.ThemedFrame(self,
                                              background_color=dark_color)
        self.backbuttonframe.place(relx=0.5,
                                   rely=1,
                                   y=-(navbuttonheight + 2 * separatorwidth),
                                   width=300,
                                   x=-150,
                                   height=navbuttonheight)

        self.backbutton = cw.navbutton(self.backbuttonframe,
                                       command_name=self.on_back,
                                       text_string="RIP. Take me back.",
                                       background=light_color)
        self.backbutton.place(relwidth=1, relheight=1)

        self.yesnobuttonframe = cw.ThemedFrame(self,
                                               background_color=dark_color)
        self.yesnobuttonframe.place(relx=0.5,
                                    rely=1,
                                    y=-(navbuttonheight + 2 * separatorwidth),
                                    width=300,
                                    x=-150,
                                    height=navbuttonheight)

        self.yesbutton = cw.navbutton(self.yesnobuttonframe,
                                      command_name=self.on_yes,
                                      text_string="Yes",
                                      background=light_color)
        self.yesbutton.place(relx=0, relwidth=0.33, relheight=1)

        self.nobutton = cw.navbutton(self.yesnobuttonframe,
                                     command_name=self.on_no,
                                     text_string="No",
                                     background=light_color)
        self.nobutton.place(relx=0.67, relwidth=0.33, relheight=1)

        self.backbuttonframe.tkraise()
Exemplo n.º 2
0
	def buildbuttonrow(self,title,buttonlist,frame):
		global home_page_button_text_highlight_color

		iconspacer = homebuttonspacing
		for button in buttonlist:
			if not button == buttonlist[0]:
				iconspacer += homebuttonwidth-2*homebuttonspacing

			buttonframe = cw.ThemedFrame(frame,background_color=style.homepage_button_background_color)
			buttonframe.place(rely=.5, x=iconspacer, y = -((homebuttonwidth)/2) + 4*homebuttonspacing,width = homebuttonwidth-2*homebuttonspacing, height=homebuttonwidth-2*homebuttonspacing)
			buttonobj = cw.navbutton(buttonframe,image_object=button["image"],command_name=button["callback"],background = style.homepage_button_background_color)
			buttonobj.place(relwidth=1,relheight=1)
			button_ttp = cw.tooltip(buttonobj,button["tooltip"])
			buttonlabel = cw.ThemedLabel(buttonframe,button["shorttip"],anchor="center",label_font=smallboldtext,foreground=style.homepage_button_text_color,background=home_page_button_text_highlight_color)
			buttonlabel.place(rely=1, relx=0.5, x=-0.5*homebuttonwidth, width=homebuttonwidth, y = -20,height=20) #width = homebuttonwidth-2*homebuttonspacing
			iconspacer += 2*homebuttonspacing

		rowlabel = cw.ThemedLabel(frame,title,anchor="w",label_font=largeboldtext,foreground=style.homepage_category_separator_title_color,background=style.homepage_category_separator_color)
		rowlabel.place(x=0, y = 0,relwidth=1)
Exemplo n.º 3
0
	def __init__(self, parent, controller,page_name,back_command):
		self.back_command = back_command
		self.controller = controller

		width = guicore.checkguisetting("dimensions","guiwidth")
		height = guicore.checkguisetting("dimensions","guiheight")

		cw.ThemedFrame.__init__(self,parent,background_color= style.about_page_background_color)
		self.outer_frame = cw.ThemedFrame(self,background_color=style.about_page_background_color)
		self.outer_frame.place(relx=0.5,rely=0.5,x=-(width/2),y=-(height/2),width=width,height=height)
		

		#Credits and stuff 
		self.devlabel = cw.ThemedLabel(self.outer_frame, "DEVELOPERS", label_font = columnlabelfont, background = style.about_page_background_color, foreground = columnlabelcolor, anchor="center")
		self.devlabel.place(y=+separatorwidth,x=(2*separatorwidth+0.5*navbuttonheight),relwidth=1,width=-2*(2*separatorwidth+0.5*navbuttonheight))

		self.devframe = cw.ThemedFrame(self.outer_frame, background_color=style.about_page_background_color)
		self.devframe.place(y=+4*separatorwidth+0.5*navbuttonheight,x=separatorwidth,relwidth=1,width=-2*separatorwidth,height=3*navbuttonheight)

		self.lyfeframe = cw.ThemedFrame(self.devframe, background_color=style.about_page_background_color)
		self.lyfeframe.place(relx=0,rely=0,relwidth=0.5,relheight=1)

		self.mintframe = cw.ThemedFrame(self.devframe, background_color=style.about_page_background_color)
		self.mintframe.place(relx=0.5,rely=0,relwidth=0.5,relheight=1)

		try:
			lyfeimage = webhandler.getcachedimage("lyfeonedge") or webhandler.grabgravatar("lyfeonedge") or os.path.join(guicore.assetfolder,notfoundimage)
		except:
			lyfeimage = os.path.join(guicore.assetfolder,notfoundimage)

		#I get an object named after me :D
		self.lyfeonedgeimage = tk.PhotoImage(file=lyfeimage)
		self.lyfeonedge = cw.devbox(self.lyfeframe,"LyfeOnEdge",developers["LyfeOnEdge"]["dev_flavor_text"],self.lyfeonedgeimage,command_name=lambda: webhandler.opentab(developers["LyfeOnEdge"]["project_page_url"]),background=dark_color)
		self.lyfeonedge.place(relx=0.125, relheight=1,relwidth=0.875)

		try:
			pprmntimage = webhandler.getcachedimage("npprmint") or webhandler.grabgravatar("npprmint") or os.path.join(guicore.assetfolder,notfoundimage)
		except:
			pprmntimage = os.path.join(guicore.assetfolder,notfoundimage)

		self.pprmintimage = tk.PhotoImage(file=pprmntimage)
		self.pprmint = cw.devbox(self.mintframe,"pprmint",developers["pprmint"]["dev_flavor_text"],self.pprmintimage,command_name=lambda: webhandler.opentab(developers["pprmint"]["project_page_url"]),background=dark_color)
		self.pprmint.place(relx=0.125, relheight=1,relwidth=0.875)

		self.creditsseparator = cw.Separator(self.outer_frame,color=style.about_page_separator_color)
		self.creditsseparator.place(y=+1*separatorwidth+3*navbuttonheight,x=+separatorwidth,relwidth=1,width=-2*separatorwidth,height=separatorwidth)

		self.thankslabel = cw.ThemedLabel(self.outer_frame,"SPECIAL THANKS", label_font = columnlabelfont, background = style.about_page_background_color, foreground = columnlabelcolor,anchor="center")
		self.thankslabel.place(y=+2*separatorwidth+3*navbuttonheight,x=(2*separatorwidth+0.5*navbuttonheight),relwidth=1,width=-(2*separatorwidth+0.5*navbuttonheight),height=navbuttonheight)

		self.thankstext = cw.ScrolledText(self.outer_frame,background=style.about_page_background_color,borderwidth=0,highlightthickness=0,foreground=lgray,font=smallboldtext,wrap="word")
		self.thankstext.place(y=+0*separatorwidth+4*navbuttonheight,x=separatorwidth,relwidth=1,width=-(2*separatorwidth),relheight=1,height=-(+0*separatorwidth+4*navbuttonheight))
		self.thankstext.insert(END, thankyoutext)
		self.thankstext.config(state=DISABLED)

		#back to main page image and button
		self.returnimage = tk.PhotoImage(file=os.path.join(guicore.assetfolder,"returnbutton.png"))
		self.returnimage = self.returnimage.zoom((3)).subsample(5)

		self.return_button = cw.navbutton(self.outer_frame, image_object=self.returnimage, command_name=back_command)
		self.return_button.place(relx=1, rely=1, x=-(separatorwidth+navbuttonheight), y=-(separatorwidth+navbuttonheight), height=navbuttonheight, width=navbuttonheight)
Exemplo n.º 4
0
    def __init__(self, frame):
        cw.ThemedFrame.__init__(self,
                                frame,
                                background_color=light_color,
                                frame_borderwidth=0)

        #holds author picture
        self.project_art_label = cw.ThemedLabel(self,
                                                label_text="project_art",
                                                anchor="n")
        #Homebrew Title
        self.titlevar = tk.StringVar()
        self.titlevar.set("title_var")
        self.project_title_label = cw.ThemedLabel(
            self,
            label_text="project_title",
            text_variable=self.titlevar,
            foreground=info_softwarename_color,
            label_font=info_softwarename_font,
            anchor="n")
        #Description
        self.project_description = cw.ScrolledText(
            self,
            background=light_color,
            foreground=info_description_color,
            font=info_description_font,
            borderwidth=0,
            state=NORMAL,
            wrap="word",
        )
        #author name
        self.authorvar = tk.StringVar()
        self.authorvar.set("author_var")
        self.author_name_label = cw.ThemedLabel(self,
                                                label_text="author_name",
                                                text_variable=self.authorvar,
                                                foreground=info_author_color,
                                                label_font=info_author_font,
                                                anchor="n")
        #Separator
        self.topsep = cw.ThemedFrame(
            self,
            background_color=lgray,
            frame_borderwidth=2,
        )
        self.botsep = cw.ThemedFrame(
            self,
            background_color=lgray,
            frame_borderwidth=2,
        )

        #Check if author image is disabled
        if guicore.checkguisetting("guisettings", "display_author_image"):
            self.topsep.place(x=(infoframewidth / 2),
                              y=infoframewidth + 52,
                              height=4,
                              relwidth=0.9,
                              anchor="center")
            self.project_art_label.place(relx=0.0,
                                         rely=0.0,
                                         height=infoframewidth,
                                         relwidth=1)
            self.project_title_label.place(relx=0.0,
                                           rely=0.0,
                                           y=infoframewidth,
                                           relwidth=1.0)
            self.author_name_label.place(relx=0.0,
                                         rely=0,
                                         y=infoframewidth + 25,
                                         relwidth=1.0)
            self.project_description.place(relx=0.5,
                                           rely=0.0,
                                           y=+infoframewidth + 55,
                                           relheight=1,
                                           height=-(infoframewidth + 55 + 100),
                                           relwidth=0.85,
                                           anchor="n")
        else:
            self.topsep.place(x=(infoframewidth / 2),
                              y=separatorwidth + 50,
                              height=4,
                              relwidth=0.9,
                              anchor="center")
            self.project_title_label.place(relx=0.0,
                                           rely=0.0,
                                           y=+separatorwidth,
                                           relwidth=1.0)
            self.author_name_label.place(relx=0.0,
                                         rely=0,
                                         y=separatorwidth + 25,
                                         relwidth=1.0)
            self.project_description.place(relx=0.5,
                                           rely=0.0,
                                           y=separatorwidth + 55,
                                           relheight=1,
                                           height=-(separatorwidth + 55 + 100),
                                           relwidth=0.85,
                                           anchor="n")
            self.project_art_label.place_forget()

        self.botsep.place(x=(infoframewidth / 2),
                          rely=1,
                          y=-95,
                          height=4,
                          relwidth=0.9,
                          anchor="center")

        self.project_description.delete('1.0', END)
        self.project_description.insert(END, "Project description")
        self.project_description.configure(state=DISABLED)
Exemplo n.º 5
0
    def __init__(self,
                 parent,
                 controller,
                 page_name,
                 back_command,
                 action=None,
                 entry_text=None,
                 on_key_do=False,
                 title=None):
        framework.Frame.__init__(self, parent, controller)
        self.back_command = back_command
        self.controller = controller
        self.action = action
        self.activestatus = False
        self.on_key_do = on_key_do

        self.title = cw.ThemedLabel(self,
                                    None,
                                    anchor="center",
                                    label_font=hugeboldtext,
                                    background=dark_color)
        self.title.place(relx=0.5,
                         rely=.1,
                         x=-0.5 * entryboxwidth,
                         y=+0.5 * entryboxheight,
                         width=entryboxwidth)
        if title: self.title.set(title)

        self.returnimage = tk.PhotoImage(file=os.path.join(
            guicore.assetfolder, "returnbutton.png")).zoom(3).subsample(5)
        self.returnbutton = cw.navbutton(self,
                                         command_name=self.back,
                                         image_object=self.returnimage)
        self.returnbutton.place(relx=1,
                                rely=1,
                                x=-2 * navbuttonheight,
                                y=-2 * navbuttonheight,
                                width=navbuttonheight,
                                height=navbuttonheight)

        self.entry = cw.entrybox(self,
                                 entry_background=light_color,
                                 command=self.action,
                                 entry_font=mondoboldtext,
                                 placeholder=entry_text,
                                 justification="center")
        self.entry.place(relx=0.5,
                         rely=.5,
                         x=-0.5 * entryboxwidth,
                         y=-0.5 * entryboxheight,
                         width=entryboxwidth,
                         height=entryboxheight)
        self.entry.entry.bind("<KeyRelease>", self.on_key)

        self.status = cw.ThemedLabel(self,
                                     None,
                                     anchor="center",
                                     label_font=hugeboldtext,
                                     background=dark_color)
        self.status.place(relx=0.5,
                          rely=.5,
                          x=-0.5 * entryboxwidth,
                          y=+0.5 * entryboxheight,
                          width=entryboxwidth)