Пример #1
0
    def display(self):
        glTranslatef(*self.pos)
        CairoWidget.display(self)

        glPushMatrix()
        self.get_active_child().display()
        glPopMatrix()
Пример #2
0
	def display(self):
		glTranslatef(*self.pos)
		CairoWidget.display(self)

		glPushMatrix()
		self.get_active_child().display()
		glPopMatrix()
Пример #3
0
	def __init__(self, position, size, bordersize=1, *args, **kwargs):
		if position is None:
			position = get_autopos(size)

		BaseWindow.__init__(self, **kwargs)
		CairoWidget.__init__(self, position, size, *args, **kwargs)
		
		self._bordersize = bordersize
		self._titlefont = self.create_font(size=9)
Пример #4
0
    def __init__(self, position=Vector3(0, 0, 0), size=Vector2i(1, 1), tabs=[], **kwargs):
        for x in tabs:
            if not isinstance(x, Tab):
                raise ValueError, "TabView can only contain Tabs, not %s", type(x)

        self._children = [x.widget for x in tabs]
        self._titles = [x.title for x in tabs]

        Container.__init__(self, children=self._children)
        CairoWidget.__init__(self, position, size, **kwargs)

        self._font = self.create_font(size=9)
        self._selected = 0
Пример #5
0
	def __init__(self, position=Vector3(0,0,0), size=Vector2i(1,1), tabs=[], **kwargs):
		for x in tabs:
			if not isinstance(x, Tab):
				raise ValueError, 'TabView can only contain Tabs, not %s', type(x)
			
		self._children = [x.widget for x in tabs]
		self._titles = [x.title for x in tabs]

		Container.__init__(self, children=self._children)
		CairoWidget.__init__(self, position, size, **kwargs)
		
		self._font = self.create_font(size=9)
		self._selected = 0
Пример #6
0
	def do_render(self):
		cr = self.cr
		
		CairoWidget.clear(cr, (0,0,0,0))
		self.render_decoration()
		
		p = [v * self.size for v in self.points]
		
		cr.set_source_rgba (0., 0.0, 0.0, 1.0);
		cr.move_to (p[0].x, p[0].y);
		cr.curve_to (p[1].x, p[1].y, p[2].x, p[2].y, p[3].x, p[3].y);
		
		cr.set_line_width (10.0);
		cr.stroke ();
		
		cr.set_source_rgba (1, 0.2, 0.2, 0.6);
		cr.set_line_width (6.0);
		cr.move_to (p[0].x, p[0].y);   cr.line_to (p[1].x, p[1].y);
		cr.move_to (p[2].x, p[2].y); cr.line_to (p[3].x, p[3].y);
		cr.stroke ();
Пример #7
0
 def render(self):
     CairoWidget.render(self)
     for x in self.get_children():
         glPushMatrix()
         x.render()
         glPopMatrix()
Пример #8
0
    def on_resize(self, size, *args, **kwargs):
        CairoWidget.on_resize(self, size, *args, **kwargs)

        childsize = Vector2i(size[0], size[1] - self.tab_bar_height)
        for widget in self.get_children():
            widget.on_resize(childsize, *args, **kwargs)
Пример #9
0
	def __init__(self, size, title, *args, **kwargs):
		CairoWidget.__init__(self, Vector2i(0,0 ), size, *args, **kwargs)
		self._title = title
		self._titlefont = self.create_font(size=9)
Пример #10
0
	def __init__(self, info):
		CairoWidget.__init__(self, Vector2i(0,0), Vector2i(1,1))
		info['Minable'] and 'Yes' or 'No'
		info['Cargo'] = ', '.join(['%s:%d' % (x['Type'],y) for x,y in info['Cargo']])
		self._info = info
		self._font = self.create_font('Monospace')
Пример #11
0
	def render(self):
		CairoWidget.render(self)
		for x in self.get_children():
			glPushMatrix()
			x.render()
			glPopMatrix()
Пример #12
0
	def on_resize(self, size, *args, **kwargs):
		CairoWidget.on_resize(self, size, *args, **kwargs)
		
		childsize = Vector2i(size[0], size[1]-self.tab_bar_height)
		for widget in self.get_children():
			widget.on_resize(childsize, *args, **kwargs)