コード例 #1
0
ファイル: fillctrls.py プロジェクト: Scrik/sk1-wx
class CMYK_Panel(SolidFillPanel):

    color_sliders = []
    color_spins = []

    def build(self):

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

        self.pack(wal.HPanel(self), fill=True, expand=True)
        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, CMYK_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_cmyk_color(fill[2])
        elif not new_color and not fill:
            new_color = [uc2const.COLOR_CMYK, [0.0, 0.0, 0.0, 1.0], 1.0, '']
        else:
            new_color = cms.get_cmyk_color(new_color)
        SolidFillPanel.activate(self, cms, orig_fill, new_color)
        self.update()
コード例 #2
0
ファイル: fillctrls.py プロジェクト: Scrik/sk1-wx
class CMYK_Panel(SolidFillPanel):

	color_sliders = []
	color_spins = []

	def build(self):

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

		self.pack(wal.HPanel(self), fill=True, expand=True)
		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, CMYK_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_cmyk_color(fill[2])
		elif not new_color and not fill:
			new_color = [uc2const.COLOR_CMYK, [0.0, 0.0, 0.0, 1.0], 1.0, '']
		else:
			new_color = cms.get_cmyk_color(new_color)
		SolidFillPanel.activate(self, cms, orig_fill, new_color)
		self.update()
コード例 #3
0
	def build(self):

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

		self.pack(wal.HPanel(self), fill=True, expand=True)
		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, CMYK_PALETTE,
							self.on_palette_click)
		bot_panel.pack(minipal, padding_all=5)

		self.pack(bot_panel, fill=True)
コード例 #4
0
ファイル: fillctrls.py プロジェクト: Scrik/sk1-wx
	def build(self):

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

		self.pack(wal.HPanel(self), fill=True, expand=True)
		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, CMYK_PALETTE,
							self.on_palette_click)
		bot_panel.pack(minipal, padding_all=5)

		self.pack(bot_panel, fill=True)