Beispiel #1
0
 def __init__(self, parent, dlg, orig_color):
     self.dlg = dlg
     wal.VPanel.__init__(self, parent)
     cms = dlg.presenter.cms
     self.color_panel = SolidFill(self, dlg, cms)
     self.pack(self.color_panel, fill=True, expand=True)
     fill = []
     if orig_color: fill = [0, 0, orig_color]
     self.color_panel.activate(fill,
                               use_rule=False,
                               onmodechange=self.on_mode_change)
Beispiel #2
0
	def __init__(self, parent, dlg, orig_color):
		self.dlg = dlg
		wal.VPanel.__init__(self, parent)
		cms = dlg.presenter.cms
		self.color_panel = SolidFill(self, dlg, cms)
		self.pack(self.color_panel, fill=True, expand=True)
		fill = []
		if orig_color:fill = [0, 0, orig_color]
		self.color_panel.activate(fill, use_rule=False,
								onmodechange=self.on_mode_change)
Beispiel #3
0
class StrokeColor(wal.VPanel):
    def __init__(self, parent, dlg, orig_color):
        self.dlg = dlg
        wal.VPanel.__init__(self, parent)
        cms = dlg.presenter.cms
        self.color_panel = SolidFill(self, dlg, cms)
        self.pack(self.color_panel, fill=True, expand=True)
        fill = []
        if orig_color: fill = [0, 0, orig_color]
        self.color_panel.activate(fill,
                                  use_rule=False,
                                  onmodechange=self.on_mode_change)

    def on_mode_change(self):
        self.dlg.set_color(self.get_color())

    def get_color(self):
        fill = self.color_panel.get_result()
        if fill: return fill[2]
        return []
Beispiel #4
0
class StrokeColor(wal.VPanel):

	def __init__(self, parent, dlg, orig_color):
		self.dlg = dlg
		wal.VPanel.__init__(self, parent)
		cms = dlg.presenter.cms
		self.color_panel = SolidFill(self, dlg, cms)
		self.pack(self.color_panel, fill=True, expand=True)
		fill = []
		if orig_color:fill = [0, 0, orig_color]
		self.color_panel.activate(fill, use_rule=False,
								onmodechange=self.on_mode_change)

	def on_mode_change(self):
		self.dlg.set_color(self.get_color())

	def get_color(self):
		fill = self.color_panel.get_result()
		if fill: return fill[2]
		return []
Beispiel #5
0
    def build(self):
        self.nb = wal.Notebook(self, on_change=self.on_change)
        self.tabs = [SolidFill(self.nb, self, self.cms),
                     GradientFill(self.nb, self, self.cms),
                     PatternFill(self.nb, self, self.cms)
                     ]
        for item in self.tabs:
            self.nb.add_page(item, item.name)
        self.pack(self.nb, fill=True, expand=True)

        if not self.orig_fill or self.orig_fill[1] == sk2_const.FILL_SOLID:
            self.nb.set_active_index(0)
            self.tabs[0].activate(self.orig_fill)
        elif self.orig_fill[1] == sk2_const.FILL_GRADIENT:
            self.nb.set_active_index(1)
        elif self.orig_fill[1] == sk2_const.FILL_PATTERN:
            self.nb.set_active_index(2)
        self.start = False
Beispiel #6
0
    def build(self):
        self.nb = wal.Notebook(self, on_change=self.on_change)
        self.tabs = [
            SolidFill(self.nb, self, self.cms),
            GradientFill(self.nb, self, self.cms),
            PatternFill(self.nb, self, self.cms)
        ]
        for item in self.tabs:
            self.nb.add_page(item, item.name)
        self.pack(self.nb, fill=True, expand=True)

        index = 0
        if self.orig_fill:
            if self.orig_fill[1] == sk2const.FILL_GRADIENT:
                index = 1
            elif self.orig_fill[1] == sk2const.FILL_PATTERN:
                index = 2
        self.tabs[index].activate(self.orig_fill)
        self.nb.set_active_index(index)
        self.start = False