Ejemplo n.º 1
0
 def on_draw(self, dt=0):
     self.try_redraw()
     if not graphics.drawing:
         #toolbar background
         #draw.rect(0,graphics.canvas_y,graphics.canvas_x,graphics.height)
         draw.gradient(
             0, graphics.canvas_y, graphics.canvas_x, graphics.height,
             self.toolbar_bg_1, self.toolbar_bg_2,
             self.toolbar_bg_2, self.toolbar_bg_1
         )
         #draw.rect(0,0,graphics.width,graphics.canvas_y)
         draw.gradient(
             0, 0, graphics.width, graphics.canvas_y,
             self.toolbar_bg_1, self.toolbar_bg_2,
             self.toolbar_bg_2, self.toolbar_bg_1
         )
         #buttons
         graphics.set_color(1,1,1,1)
         for button in self.toolbar: button.draw()   #toolbar buttons
         for button in self.buttons: button.draw()   #bottom buttons
         for label in self.labels: draw.label(label) #text labels
         self.colorpicker.draw()                     #color picker
         #self.colordisplay.draw()                    #line/fill color selector
         tool.controlspace.draw()
         #divider lines
         graphics.set_color(0,0,0,1)
         graphics.set_line_width(1.0)
         graphics.call_twice(pyglet.gl.glDisable,pyglet.gl.GL_BLEND)
         draw.line(0, graphics.canvas_y, graphics.width, graphics.canvas_y)
         draw.line(graphics.canvas_x, graphics.canvas_y, graphics.canvas_x, graphics.height)
         graphics.call_twice(pyglet.gl.glEnable,pyglet.gl.GL_BLEND)
     self.drawn_this_frame = False
Ejemplo n.º 2
0
 def draw(self):
     """Internal use only."""
     color = (1,1,1,1)
     if self.parent_group != None and self.selected: color = (0.8, 0.8, 0.8, 1)
     if self.pressed: color = (0.7, 0.7, 0.7, 1)
     draw.set_color(color=color)
     draw.image(self.image,self.x,self.y)
     draw.set_color(1,1,1,1)
     draw.label(self.label)
     if self.more_draw != None: self.more_draw()
Ejemplo n.º 3
0
 def draw(self):
     """Internal use only."""
     if not self.visible: return
     if self.image != None:
         color = (1,1,1,1)
         if self.parent_group != None and self.selected: color = (0.8, 0.8, 0.8, 1)
         if self.pressed: color = (0.7, 0.7, 0.7, 1)
         graphics.set_color(*color)
         draw.image(self.image,self.x,self.y)
     else:
         color = (0,0,0,0)
         if self.parent_group != None and self.selected: color = (0,0,0, 0.3)
         if self.pressed: color = (0,0,0, 0.6)
         graphics.set_color(*color)
         draw.rect(self.x, self.y, self.x + self.width, self.y+self.height)
     if self.label != None:    
         graphics.set_color(1,1,1,1)
         draw.label(self.label)
     if self.more_draw != None: self.more_draw()
Ejemplo n.º 4
0
 def draw_tools(self):
     #toolbar background
     draw.set_color(0.8, 0.8, 0.8, 1)
     draw.rect(0,graphics.canvas_y,graphics.canvas_x,graphics.height)
     draw.rect(0,0,graphics.width,graphics.canvas_y)
     
     #buttons
     draw.set_color(1,1,1,1)
     for button in self.toolbar: button.draw()   #toolbar buttons
     for button in self.buttons: button.draw()   #bottom buttons
     for label in self.labels: draw.label(label) #text labelsr
     
     tool.controlspace.draw()
     
     #divider lines
     draw.set_color(0,0,0,1)
     graphics.set_line_width(1.0)
     draw.line(0, graphics.canvas_y, graphics.width, graphics.canvas_y)
     draw.line(
         graphics.canvas_x, graphics.canvas_y, 
         graphics.canvas_x, graphics.height
     )