def __init__(self, rotated = False, width = 218, height = 58, bgcolor = COLOR_BG, bordercolor = COLOR, hoverbordercolor = COLOR_HOVER, borderwidth = 1, parent = None): colors = [(0xfce94f, 0xedd400, 0xc4a000),\ (0xfcaf3e, 0xf57900, 0xce5c00),\ (0xe9b96e, 0xc17d11, 0x8f5902),\ (0x8ae234, 0x73d216, 0x4e9a06),\ (0x729fcf, 0x3465a4, 0x204a87),\ (0xad7fa8, 0x75507b, 0x5c3566),\ (0xef2929, 0xcc0000, 0xa40000),\ (0xeeeeec, 0xd3d7cf, 0xbabdb6),\ (0x888a85, 0x555753, 0x2e3436)] self.rotated = rotated if rotated == True: width, height = height, width Frame.__init__(self, width, height, bgcolor, bordercolor, hoverbordercolor, borderwidth, parent) self.setPalette(colors)
def __init__(self, name = "Window", width = 80, height = 60, bgcolor = COLOR_BG, bordercolor = COLOR, hoverbordercolor = COLOR_HOVER, borderwidth = 1, parent = None, gui = None): Frame.__init__(self, width, height, bgcolor, bordercolor, hoverbordercolor, borderwidth, parent) self.gui = gui self.name = Label(name, width = width-21, bgcolor = COLOR_BG, borderwidth = 1, parent = self) self.name.setPos(0, 0) self.close_button = ImgButton(self.w-20, 0, 20, 20, "graphics/gui/guibase.png", 1,49,1,70, parent=self) self.close_button.setPos(self.w-20, 0) self.close_button.bind(self.hide) self.drag_button = ImgButton(self.w-20, 0, 20, 20, "graphics/gui/guibase.png", 22,49,22,70, parent=self) self.drag_button.setPos(self.w-20, self.h-20) self.click = False self._resize = False
def __init__( self, text="OK", font=FONT, width=0, height=0, bgcolor=(0, 0, 0), bordercolor=(255, 255, 255), hoverbordercolor=(255, 255, 255), borderwidth=1, ): Frame.__init__(self, width, height, bgcolor, bordercolor, hoverbordercolor, borderwidth=1) self.baseText = text self.padding = 5 self.font = font self.setText(self.baseText)
def __init__(self, minvalue = 0, maxvalue = 100, barcolor = (50,200,100), image = None, width = 100, height = 10, bgcolor = (0,0,0), bordercolor = (200,200,200), hoverbordercolor = (255,255,255), borderwidth = 1, parent = None): Frame.__init__(self, width, height, bgcolor, bordercolor, hoverbordercolor, borderwidth, parent) self.barcolor = barcolor self.minvalue = minvalue self.value = self.maxvalue = maxvalue self.image = image if image: #print 'set renderer as image' self.render = self.drawImage else: self.render = self.drawRect