Ejemplo n.º 1
0
	def build(self):

		self.mixer = RGB_Mixer(self, self.cms, onchange=self.update)
		self.pack(self.mixer)

		self.pack(wal.HLine(self), fill=True, padding=5)

		bot_panel = wal.HPanel(self)
		self.refpanel = FillColorRefPanel(bot_panel, self.cms, [], [],
										on_orig=self.set_orig_fill)
		bot_panel.pack(self.refpanel)
		bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True)

		minipal = MiniPalette(bot_panel, self.cms, RGB_PALETTE,
							self.on_palette_click)
		bot_panel.pack(minipal, padding_all=5)

		self.pack(bot_panel, fill=True)
Ejemplo n.º 2
0
class RGB_Panel(SolidFillPanel):
    def build(self):

        self.mixer = RGB_Mixer(self, self.cms, onchange=self.update)
        self.pack(self.mixer)

        self.pack(wal.HLine(self), fill=True, padding=5)

        bot_panel = wal.HPanel(self)
        self.refpanel = FillColorRefPanel(bot_panel,
                                          self.cms, [], [],
                                          on_orig=self.set_orig_fill)
        bot_panel.pack(self.refpanel)
        bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True)

        minipal = MiniPalette(bot_panel, self.cms, RGB_PALETTE,
                              self.on_palette_click)
        bot_panel.pack(minipal, padding_all=5)

        self.pack(bot_panel, fill=True)

    def on_palette_click(self, color):
        self.new_color = color
        self.update()

    def update(self):
        self.mixer.set_color(self.new_color)
        self.refpanel.update(self.orig_fill, self.new_color)

    def activate(self, cms, orig_fill, new_color):
        fill = None
        if orig_fill and orig_fill[1] == sk2_const.FILL_SOLID:
            fill = orig_fill
        if not new_color and fill:
            new_color = cms.get_rgb_color(fill[2])
        elif not new_color and not fill:
            new_color = [uc2const.COLOR_RGB, [0.0, 0.0, 0.0], 1.0, '']
        else:
            new_color = cms.get_rgb_color(new_color)
        SolidFillPanel.activate(self, cms, orig_fill, new_color)
        self.update()
Ejemplo n.º 3
0
class RGB_Panel(SolidFillPanel):

	def build(self):

		self.mixer = RGB_Mixer(self, self.cms, onchange=self.update)
		self.pack(self.mixer)

		self.pack(wal.HLine(self), fill=True, padding=5)

		bot_panel = wal.HPanel(self)
		self.refpanel = FillColorRefPanel(bot_panel, self.cms, [], [],
										on_orig=self.set_orig_fill)
		bot_panel.pack(self.refpanel)
		bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True)

		minipal = MiniPalette(bot_panel, self.cms, RGB_PALETTE,
							self.on_palette_click)
		bot_panel.pack(minipal, padding_all=5)

		self.pack(bot_panel, fill=True)

	def on_palette_click(self, color):
		self.new_color = color
		self.update()

	def update(self):
		self.mixer.set_color(self.new_color)
		self.refpanel.update(self.orig_fill, self.new_color)

	def activate(self, cms, orig_fill, new_color):
		fill = None
		if orig_fill and orig_fill[1] == sk2_const.FILL_SOLID:
			fill = orig_fill
		if not new_color and fill:
			new_color = cms.get_rgb_color(fill[2])
		elif not new_color and not fill:
			new_color = [uc2const.COLOR_RGB, [0.0, 0.0, 0.0], 1.0, '']
		else:
			new_color = cms.get_rgb_color(new_color)
		SolidFillPanel.activate(self, cms, orig_fill, new_color)
		self.update()
Ejemplo n.º 4
0
	def build(self):

		self.mixer = RGB_Mixer(self, self.cms, onchange=self.update)
		self.pack(self.mixer)

		self.pack(wal.HLine(self), fill=True, padding=5)

		bot_panel = wal.HPanel(self)
		self.refpanel = FillColorRefPanel(bot_panel, self.cms, [], [],
										on_orig=self.set_orig_fill)
		bot_panel.pack(self.refpanel)
		bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True)

		minipal = MiniPalette(bot_panel, self.cms, RGB_PALETTE,
							self.on_palette_click)
		bot_panel.pack(minipal, padding_all=5)

		self.pack(bot_panel, fill=True)