Пример #1
0
    def __init__(self, app, parent):
        self.app = app
        wal.HPanel.__init__(self, parent)
        self.pack(get_bmp(self.panel, icons.PD_MOUSE_MONITOR))

        width = 100
        if wal.IS_MAC:
            width = 130

        self.pointer_txt = wal.Label(self.panel,
                                     text=' ',
                                     fontsize=FONTSIZE[0])
        self.pointer_txt.SetMinSize((width, -1))
        self.pack(self.pointer_txt)
        self.pack(wal.VLine(self.panel), fill=True, padding=2)
        events.connect(events.MOUSE_STATUS, self.set_value)
        events.connect(events.NO_DOCS, self.hide_monitor)
        events.connect(events.DOC_CHANGED, self.doc_changed)
Пример #2
0
 def __init__(self, parent, bg):
     wal.HPanel.__init__(self, parent)
     self.set_bg(wal.UI_COLORS['pressed_border'][:3])
     self.pack((1, SIZE))
     panel = wal.VPanel(self)
     panel.set_bg(wal.UI_COLORS['bg'][:3])
     panel.pack(Spacer(panel))
     self.canvas = ImageCanvas(panel, cms.val_255(bg))
     panel.pack(self.canvas, fill=True, expand=True)
     info_panel = wal.VPanel(panel)
     info_panel.set_bg(wal.WHITE)
     self.info = wal.Label(info_panel, '---')
     info_panel.pack(self.info, padding_all=2)
     panel.pack(Spacer(panel))
     panel.pack(info_panel, fill=True)
     panel.pack(Spacer(panel))
     self.pack(panel, fill=True)
     self.pack((1, SIZE + info_panel.get_size()[1] + 3))
Пример #3
0
    def __init__(self, parent, label='CAPTION'):
        self.title = label.upper()
        wal.VPanel.__init__(self, parent)
        hpanel = wal.HPanel(self)
        hpanel.pack(SPACER)
        self.cont = wal.VPanel(hpanel)
        self.cont.pack(wal.Label(self.cont, self.title, fontsize=3),
                       padding=5,
                       align_center=False)

        self.build()

        hpanel.pack(self.cont, fill=True, expand=True)
        hpanel.pack(SPACER)
        self.pack(hpanel, fill=True)

        self.pack(SPACER)
        self.pack(wal.HLine(self), fill=True)
Пример #4
0
    def __init__(self, parent, app):
        wal.VPanel.__init__(self, parent)
        self.app = app

        self.pack(wal.Label(self, SHAPING_MODE_NAMES[self.pid], fontbold=True))

        self.pic_panel = wal.VPanel(self, border=True)
        self.pic_panel.set_bg(wal.WHITE)
        self.bmp = get_bmp(self.pic_panel, SHAPING_MODE_PICS[self.pid])
        self.pic_panel.pack(self.bmp, padding_all=5)
        self.pack(self.pic_panel, padding=10)

        self.del_check = wal.Checkbox(self, _('Delete originals'))
        self.pack(self.del_check)

        txt = _('Apply')
        if self.pid == TRIM_MODE: txt = _('Apply to...')
        self.apply_btn = wal.Button(self, txt, onclick=self.action)
        self.pack(self.apply_btn, fill=True, padding_all=5)
Пример #5
0
	def build_ui(self):
		self.icon = get_icon(PLUGIN_ICON)
		self.panel.pack(wal.Label(self.panel, _('Layers'), fontbold=True),
					padding=3)
		self.panel.pack(wal.HLine(self.panel), fill=True)

		pnl = wal.HPanel(self.panel)
		self.layer_new = wal.ImageButton(pnl, icons.PD_LAYER_NEW,
			tooltip=_('Create new layer'), onclick=self.new_layer)
		self.layer_to_bottom = wal.ImageButton(pnl, icons.PD_LOWER_TO_BOTTOM,
			tooltip=_('Layer to bottom'), onclick=self.lower_layer_to_bottom)
		self.layer_lower = wal.ImageButton(pnl, icons.PD_LOWER,
			tooltip=_('Lower layer'), onclick=self.lower_layer)
		self.layer_raise = wal.ImageButton(pnl, icons.PD_RAISE,
			tooltip=_('Raise layer'), onclick=self.raise_layer)
		self.layer_to_top = wal.ImageButton(pnl, icons.PD_RAISE_TO_TOP,
			tooltip=_('Layer to top'), onclick=self.raise_layer_to_top)
		self.layer_delete = wal.ImageButton(pnl, icons.PD_LAYER_DELETE,
			tooltip=_('Delete layer'), onclick=self.delete_layer)
		self.layer_edit = wal.ImageButton(pnl, icons.PD_EDIT,
			tooltip=_('Rename layer'), onclick=self.rename_layer)
		pnl.pack(self.layer_new)
		pnl.pack(self.layer_to_bottom)
		pnl.pack(self.layer_lower)
		pnl.pack(self.layer_raise)
		pnl.pack(self.layer_to_top)
		pnl.pack(self.layer_delete)
		pnl.pack(self.layer_edit)
		self.panel.pack(pnl)

		bmp = []
		for item in BITMAPS: bmp.append(make_artid(item))
		pnl = wal.VPanel(self.panel, border=True)
		self.viewer = wal.LayerList(pnl, self.get_data(), bmp,
								on_select=self.update, on_change=self.changed,
								on_double_click=self.rename_layer)
		pnl.pack(self.viewer, fill=True, expand=True)
		self.panel.pack(pnl, padding_all=3, fill=True, expand=True)

		events.connect(events.DOC_CHANGED, self.update)
		events.connect(events.DOC_MODIFIED, self.update)
		self.update()
Пример #6
0
    def __init__(self, parent, prefpanel):
        CmsTab.__init__(self, parent, prefpanel)
        txt = _('Activate Color Management')
        panel = wal.VPanel(self)
        hp = wal.HPanel(panel)
        self.cms_check = wal.Checkbox(hp, txt, config.cms_use,
                                      onclick=self.activate_cms)

        hp.pack(self.cms_check)
        panel.pack(hp, fill=True, padding_all=3)

        self.banner = wal.VPanel(panel)
        self.banner.set_bg(wal.DARK_GRAY)
        bmp = get_bmp(self.banner, icons.PD_PREFS_CMS_BANNER)
        self.banner.pack(bmp, padding=2)
        panel.pack(self.banner, expand=True, fill=True)
        txt = _('Note: If not activated the color values will be not accurate.')
        label = wal.Label(self, txt, fontsize=-1)
        panel.pack(label, fill=True, padding_all=5)
        self.pack(panel, fill=True, expand=True)
Пример #7
0
    def build(self):
        hpanel = wal.HPanel(self)
        title = _('Number of copies:')
        hpanel.pack(wal.Label(hpanel, title), padding=5)
        self.num_copies = wal.IntSpin(hpanel, 1, (1, 9999),
                                      onchange=self.copies_changed)
        hpanel.pack(self.num_copies)
        self.cont.pack(hpanel)

        self.indicator = wal.Bitmap(hpanel, self.icons['00'])
        self.cont.pack(self.indicator, padding=5)

        hpanel = wal.HPanel(self)
        self.collate = wal.Checkbox(hpanel, _('Collate'),
                                    onclick=self.flag_changed)
        hpanel.pack(self.collate)
        hpanel.pack(SPACER)
        self.reverse = wal.Checkbox(hpanel, _('Reverse'),
                                    onclick=self.flag_changed)
        hpanel.pack(self.reverse)
        self.cont.pack(hpanel)
Пример #8
0
    def build(self):

        self.pack((5, 5))

        vpanel = wal.VPanel(self)

        hpanel = wal.HPanel(vpanel)
        hpanel.pack(wal.Label(hpanel, _('Guide color:')))
        hpanel.pack((10, 5))
        self.color = self.doc.methods.get_guide_rgb_color()
        self.guide_color_btn = wal.ColorButton(hpanel,
                                               self.color[:3],
                                               onchange=self.on_change)
        hpanel.pack(self.guide_color_btn)
        hpanel.pack((10, 5))
        hpanel.pack(
            CBMiniPalette(hpanel,
                          colors=GUIDE_COLORS,
                          onclick=self.change_color))
        vpanel.pack(hpanel, fill=True, align_center=False)

        hpanel = wal.HPanel(vpanel)

        val = self.doc.methods.is_guide_visible()
        self.show_guide_check = wal.Checkbox(hpanel,
                                             _('Show guides on canvas'), val)
        hpanel.pack(self.show_guide_check)

        val = self.doc.methods.is_guide_editable()
        self.edit_guide_check = wal.Checkbox(hpanel, _('Edit guides'), val)
        hpanel.pack(self.edit_guide_check, padding=10)

        vpanel.pack(hpanel, fill=True, padding=5)

        self.pack((10, 10))

        self.preview = GuidePreview(vpanel, deepcopy(self.color))
        vpanel.pack(self.preview, fill=True, expand=True)

        self.pack(vpanel, fill=True, expand=True, padding_all=5)
Пример #9
0
    def __init__(self, parent, dlg, canvas, printer):
        self.dlg = dlg
        self.canvas = canvas
        self.printer = printer
        wal.HPanel.__init__(self, parent)

        self.pack(wal.Label(self, _('Page:')), padding=5)
        rng = (1, len(self.canvas.pages))
        self.pager = wal.IntSpin(self, 1, rng, onchange=self.on_pager_change,
                                 onenter=self.on_pager_change)
        self.pack(self.pager, padding=5)
        if len(self.canvas.pages) == 1:
            self.pager.set_enable(False)

        Btn = wal.ImageButton

        buttons = [
            None,
            (icons.PD_PRINT, self.dlg.on_print, _('Print')),
            (icons.PD_PRINT_PREVIEW, self.on_printer_props,
             _('Printer properties')),
            None,
            (icons.PD_ZOOM_IN, self.canvas.zoom_in, _('Zoom in')),
            (icons.PD_ZOOM_OUT, self.canvas.zoom_out, _('Zoom out')),
            (icons.PD_ZOOM_PAGE, self.canvas.zoom_fit_to_page, _('Fit to page')),
            (icons.PD_ZOOM_100, self.canvas.zoom_100, _('Zoom 100%')),
            None,
        ]

        for item in buttons:
            if item:
                self.pack(Btn(self, item[0], wal.SIZE_22,
                              tooltip=item[2], onclick=item[1]))
            elif item is None:
                self.pack(wal.VLine(self), padding_all=5, fill=True)
            else:
                self.pack((5, 5), expand=True)

        prn_events.connect(prn_events.PRINTER_CHANGED, self.printer_changed)
Пример #10
0
    def __init__(self, parent, app):
        self.app = app
        wal.LabeledPanel.__init__(self, parent, _('Align'))

        self.pack((5, 5))
        self.pack(wal.Label(self, _('Relative to:')))
        self.source = wal.Combolist(self,
                                    items=SOURCE_NAMES,
                                    onchange=self.update)
        self.source.set_active(0)
        self.pack(self.source, padding_all=5, fill=True)
        self.pack((5, 5))

        self.halign = wal.HToggleKeeper(self,
                                        H_ALIGN_MODES,
                                        H_ALIGN_MODE_ICONS,
                                        H_ALIGN_MODE_NAMES,
                                        on_change=self.update,
                                        allow_none=True)
        self.pack(self.halign)
        self.halign.set_mode(ALIGN_CENTER)

        self.valign = wal.HToggleKeeper(self,
                                        V_ALIGN_MODES,
                                        V_ALIGN_MODE_ICONS,
                                        V_ALIGN_MODE_NAMES,
                                        on_change=self.update,
                                        allow_none=True)
        self.pack(self.valign, padding_all=5)
        self.valign.set_mode(ALIGN_CENTER)

        self.group = wal.Checkbox(self,
                                  _('Selection as group'),
                                  True,
                                  onclick=self.update)
        self.pack(self.group, padding_all=5)

        self.apply_btn = wal.Button(self, _('Apply'), onclick=self.action)
        self.pack(self.apply_btn, padding_all=5, fill=True)
Пример #11
0
    def __init__(self, parent, prefpanel):
        CMS_Tab.__init__(self, parent, prefpanel)
        txt = _('Activate Color Management')
        self.cms_check = wal.Checkbox(self,
                                      txt,
                                      config.cms_use,
                                      onclick=self.activate_cms)

        self.pack(self.cms_check, align_center=False, padding_all=3)

        self.banner = wal.VPanel(self)
        self.banner.set_bg(wal.DARK_GRAY)
        bmp = get_bmp(self.banner, icons.PD_PREFS_CMS_BANNER)
        self.banner.pack(bmp, padding=2)
        self.pack(self.banner, expand=True, fill=True)
        txt = _(
            'Note: If Color Management is not activated all colors '
            'will be processed using simple calculation procedures. Therefore '
            'resulted color values will be not accurate.')
        label = wal.Label(self, txt, fontsize=-3)
        label.set_enable(False)
        self.pack(label, fill=True, padding_all=5)
Пример #12
0
    def __init__(self, parent):
        wal.VPanel.__init__(self, parent)

        #--- Printer list
        self.prn_dict, default = get_printers()
        self.prn_list = self.prn_dict.keys()
        self.prn_list.sort()

        hpanel = wal.HPanel(self)
        hpanel.pack((10, 1))
        hpanel.pack(wal.Label(hpanel, 'Device name:'))

        self.prn_combo = wal.Combolist(hpanel,
                                       items=self.prn_list,
                                       onchange=self.printer_changed)
        hpanel.pack(self.prn_combo, padding=10)
        if self.prn_list:
            self.prn_combo.set_active(self.prn_list.index(default))

        self.pack(hpanel, padding=10)

        #--- Printer tabs

        self.nb = wal.Notebook(self)

        details = self.prn_dict[default]
        self.details_panel = DetailsPanel(self.nb, details)
        self.nb.add_page(self.details_panel, 'Device details')

        attrs = get_printer_attrs(default)
        self.attrs_panel = AttrsPanel(self.nb, attrs)
        self.nb.add_page(self.attrs_panel, 'Device attributes')

        options = get_printer_options(default)
        self.options_panel = OptionPanel(self.nb, options)
        self.nb.add_page(self.options_panel, 'Device options')

        self.pack(self.nb, fill=True, expand=True, padding_all=10)
Пример #13
0
    def __init__(self, parent, details):
        wal.VPanel.__init__(self, parent)
        hpanel = wal.HPanel(self)

        self.details_list = wal.SimpleList(hpanel, [],
                                           on_select=self.details_changed,
                                           on_activate=self.details_changed)
        hpanel.pack(self.details_list, expand=True, fill=True)

        hpanel.pack((10, 10))

        self.value = wal.Entry(hpanel, '', multiline=True, editable=False)
        hpanel.pack(self.value, expand=True, fill=True)

        self.pack(hpanel, fill=True, expand=True, padding_all=10)

        self.status_label = wal.Label(self, '---')
        self.pack(self.status_label,
                  fill=True,
                  align_center=False,
                  padding_all=10)

        self.set_prn_details(details)
Пример #14
0
	def __init__(self, parent, attrs):
		wal.VPanel.__init__(self, parent)
		hpanel = wal.HPanel(self)

		vp = wal.VPanel(hpanel)
		vp.set_bg(wal.UI_COLORS['border'])
		self.attrs_list = wal.SimpleList(vp, [],
								on_select=self.attrs_changed,
								on_activate=self.attrs_changed)
		vp.pack(self.attrs_list, expand=True, fill=True, padding_all=1)
		hpanel.pack(vp, expand=True, fill=True)

		hpanel.pack((10, 10))

		self.value = wal.Entry(hpanel, '', multiline=True, editable=False)
		hpanel.pack(self.value, expand=True, fill=True)

		self.pack(hpanel, fill=True, expand=True, padding_all=10)

		self.status_label = wal.Label(self, '---')
		self.pack(self.status_label, fill=True, align_center=False, padding_all=10)

		self.set_prn_attrs(attrs)
Пример #15
0
    def __init__(self, mw):

        if wal.IS_MSW:
            FONTSIZE[0] = 0
        elif wal.IS_WX4:
            FONTSIZE[0] = -1
        elif not FONTSIZE[0]:
            FONTSIZE[0] = str(wal.get_system_fontsize()[1])
        self.mw = mw
        wal.HPanel.__init__(self, mw)
        self.pack((5, 20))

        self.mouse_info = MouseMonitor(self.mw.app, self)
        self.pack(self.mouse_info, fill=True)
        self.mouse_info.hide()

        self.zoom = ZoomMonitor(self)
        self.pack(self.zoom, fill=True)

        self.snap_monitor = SnapMonitor(self.mw.app, self)
        self.pack(self.snap_monitor, fill=True)

        self.page_info = PageMonitor(self.mw.app, self)
        self.pack(self.page_info, fill=True)
        self.page_info.hide()

        info_panel = wal.HPanel(self)
        info_panel.pack(get_bmp(info_panel, icons.PD_APP_STATUS))
        info_panel.pack((5, 3))
        self.info = wal.Label(info_panel, text='', fontsize=FONTSIZE[0])
        info_panel.pack(self.info)
        self.pack(info_panel, expand=True)

        self.clr_monitor = ColorMonitor(self.mw.app, self)
        self.pack(self.clr_monitor)
        self.clr_monitor.hide()
        events.connect(events.APP_STATUS, self._on_event)
Пример #16
0
    def __init__(self, parent, printer):
        self.printer = printer
        wal.LabeledPanel.__init__(self, parent, _('Print mode'))

        grid = wal.GridPanel(self, 2, 2, 5, 5)

        self.mono_opt = wal.Radiobutton(grid,
                                        _('Monochrome'),
                                        group=True,
                                        onclick=self.update)
        icon = get_icon(icons.PD_PRINTMODE_MONO, size=wal.DEF_SIZE)
        self.mono_bmp = wal.Bitmap(grid, icon)
        grid.pack(self.mono_bmp)
        grid.pack(self.mono_opt)

        self.color_opt = wal.Radiobutton(grid, _('Color'), onclick=self.update)
        icon = get_icon(icons.PD_PRINTMODE_COLOR, size=wal.DEF_SIZE)
        self.color_bmp = wal.Bitmap(grid, icon)
        grid.pack(self.color_bmp)
        grid.pack(self.color_opt)
        self.color_opt.set_value(True)

        self.pack(grid, padding_all=10, align_center=False)

        hpanel = wal.HPanel(self)

        self.cs_lbl = wal.Label(hpanel, _('Color space:'))
        hpanel.pack(self.cs_lbl, padding=5)

        self.cs_combo = wal.Combolist(hpanel, items=CS)
        hpanel.pack(self.cs_combo)

        self.pack(hpanel)

        self.pack((5, 5))

        self.set_data()
Пример #17
0
	def __init__(self, parent, app):
		wal.VPanel.__init__(self, parent)
		self.app = app

		self.pack(wal.Label(self, SHAPING_MODE_NAMES[self.pid], fontbold=True))

		border = wal.VPanel(self)
		color = wal.GRAY
		if wal.is_gtk():color = wal.UI_COLORS['pressed_border']
		border.set_bg(color)
		self.pic_panel = wal.VPanel(border)
		self.pic_panel.set_bg(wal.WHITE)
		self.bmp = get_bmp(self.pic_panel, SHAPING_MODE_PICS[self.pid])
		self.pic_panel.pack(self.bmp, padding_all=5)
		border.pack(self.pic_panel, padding_all=1)
		self.pack(border, padding=10)

		self.del_check = wal.Checkbox(self, _('Delete originals'))
		self.pack(self.del_check)

		txt = _('Apply')
		if self.pid == TRIM_MODE: txt = _('Apply to...')
		self.apply_btn = wal.Button(self, txt, onclick=self.action)
		self.pack(self.apply_btn, fill=True, padding_all=5)
Пример #18
0
 def build(self):
     name, copyrigth, info = get_profile_descr(self.filepath)
     filename = os.path.basename(self.filepath)
     if not copyrigth: copyrigth = '--'
     if not info: info = '--'
     grid = wal.GridPanel(self.panel, vgap=5, hgap=5)
     grid.add_growable_col(1)
     grid.add_growable_row(2)
     grid.add_growable_row(3)
     grid.pack(wal.Label(grid, _('Name:')))
     grid.pack(wal.Label(grid, name, True))
     grid.pack(wal.Label(grid, _('File:')))
     grid.pack(wal.Label(grid, filename))
     grid.pack(wal.Label(grid, _('Copyrigth:')))
     grid.pack(wal.Entry(grid, copyrigth, multiline=True, editable=False),
               fill=True)
     grid.pack(wal.Label(grid, _('Description:')))
     grid.pack(wal.Entry(grid, info, multiline=True, editable=False),
               fill=True)
     self.panel.pack(grid, fill=True, expand=True)
Пример #19
0
    def __init__(self, parent, prefpanel):
        CmsTab.__init__(self, parent, prefpanel)

        self.intents = INTENTS.keys()
        self.intents.sort()
        self.intents_names = []
        for item in self.intents:
            self.intents_names.append(INTENTS[item])

        panel = wal.VPanel(self.panel)

        # Intents panel
        int_panel = wal.LabeledPanel(panel, _('Rendering intents'))
        grid = wal.GridPanel(int_panel, vgap=5, hgap=5)

        grid.pack(wal.Label(grid, _('Display/RGB intent:')))
        self.display = wal.Combolist(grid, items=self.intents_names)
        self.display.set_active(self.intents.index(config.cms_rgb_intent))
        grid.pack(self.display)

        grid.pack(wal.Label(grid, _('Printer/CMYK intent:')))
        self.printer = wal.Combolist(grid, items=self.intents_names)
        self.printer.set_active(self.intents.index(config.cms_cmyk_intent))
        grid.pack(self.printer)

        int_panel.pack(grid, align_center=False, padding_all=10)
        panel.pack(int_panel, fill=True)

        # Simulate printer panel
        txt = _('Simulate printer on the screen')
        self.simulate_check = wal.Checkbox(panel,
                                           txt,
                                           config.cms_proofing,
                                           onclick=self.activate_simulation)

        sm_panel = wal.LabeledPanel(panel, widget=self.simulate_check)

        txt = _("Highlight colors that are outside of the printer's gamut")
        self.outcolors_check = wal.Checkbox(sm_panel,
                                            txt,
                                            config.cms_gamutcheck,
                                            onclick=self.activate_outcolors)
        sm_panel.pack(self.outcolors_check, align_center=False, padding_all=5)

        clrpanel = wal.HPanel(sm_panel)
        clrpanel.pack((20, 1))
        self.alarm_label = wal.Label(clrpanel, _('Highlight color:'))
        clrpanel.pack(self.alarm_label, padding=5)
        self.color_btn = wal.ColorButton(clrpanel, config.cms_alarmcodes)
        clrpanel.pack(self.color_btn)
        sm_panel.pack(clrpanel, align_center=False, padding_all=2)

        txt = _('Separation for SPOT colors')
        self.separation_check = wal.Checkbox(sm_panel,
                                             txt,
                                             config.cms_proof_for_spot,
                                             onclick=self.activate_outcolors)
        sm_panel.pack(self.separation_check, align_center=False, padding_all=5)

        panel.pack(sm_panel, fill=True, padding=5)

        # Bottom checks
        txt = _('Use Blackpoint Compensation')
        self.bpc_check = wal.Checkbox(panel, txt, config.cms_bpc_flag)
        panel.pack(self.bpc_check, align_center=False)

        if wal.IS_MSW:
            panel.pack((5, 5))

        txt = _('Use Black preserving transforms')
        self.bpt_check = wal.Checkbox(panel, txt, config.cms_bpt_flag)
        panel.pack(self.bpt_check, align_center=False)

        self.panel.pack(panel, fill=True, padding_all=5)
        self.activate_simulation()
Пример #20
0
 def __init__(self, parent, app, onreset=None):
     self.app = app
     self.callback = onreset
     wal.VPanel.__init__(self, parent)
     self.pack(wal.Label(self, self.name, fontbold=True), padding_all=5)
     self.build()
Пример #21
0
    def build(self):
        self.pack(wal.Label(self, _('Size (px):'), fontbold=True))

        grid = wal.GridPanel(self, rows=3, cols=4, hgap=10, vgap=5)

        # Ruler size
        grid.pack(wal.Label(grid, _('Ruler:')))
        self.ruler_size = wal.IntSpin(grid, config.ruler_size,
                                      (15, 30), onchange=self.update_ruler)
        grid.pack(self.ruler_size)

        # Ruler font size
        grid.pack(wal.Label(grid, _('Ruler font:')))
        self.ruler_font_size = wal.IntSpin(grid, config.ruler_font_size,
                                           (5, 8), onchange=self.update_ruler)
        grid.pack(self.ruler_font_size)

        # Small tick size
        grid.pack(wal.Label(grid, _('Small tick:')))
        self.ruler_small_tick = wal.IntSpin(grid, config.ruler_small_tick,
                                            (2, 30), onchange=self.update_ruler)
        grid.pack(self.ruler_small_tick)

        # Large tick size
        grid.pack(wal.Label(grid, _('Large tick:')))
        self.ruler_large_tick = wal.IntSpin(grid, config.ruler_large_tick,
                                            (2, 30), onchange=self.update_ruler)
        grid.pack(self.ruler_large_tick)

        self.pack(grid, padding_all=10)

        self.pack(wal.Label(self, _('Text shift (px):'), fontbold=True))

        grid = wal.GridPanel(self, rows=1, cols=4, hgap=10, vgap=5)

        # Vertical text shift
        grid.pack(wal.Label(grid, _('Vertical:')))
        self.ruler_text_vshift = wal.IntSpin(grid, config.ruler_text_vshift,
                                             (0, 30),
                                             onchange=self.update_ruler)
        grid.pack(self.ruler_text_vshift)

        # Horizontal text shift
        grid.pack(wal.Label(grid, _('Horizontal:')))
        self.ruler_text_hshift = wal.IntSpin(grid, config.ruler_text_hshift,
                                             (0, 30),
                                             onchange=self.update_ruler)
        grid.pack(self.ruler_text_hshift)

        self.pack(grid, padding_all=10)

        grid = wal.GridPanel(self, hgap=15, vgap=5)

        # Ruler bg color
        grid.pack(wal.Label(grid, _('Ruler background color:')))
        self.bg_btn = wal.ColorButton(grid, config.ruler_bg,
                                      onchange=self.update_ruler)
        grid.pack(self.bg_btn)

        # Ruler fg color
        grid.pack(wal.Label(grid, _('Ruler mark color:')))
        self.fg_btn = wal.ColorButton(grid, config.ruler_fg,
                                      onchange=self.update_ruler)
        grid.pack(self.fg_btn)

        self.pack(grid, padding_all=15)

        # Testing ruler
        self.pack(wal.Label(self, _('Testing ruler:'), fontbold=True),
                  padding_all=10)
        panel = wal.HPanel(self)
        panel.add((360, 1))
        panel.set_bg(wal.UI_COLORS['dark_shadow'])
        self.pack(panel)

        self.ruler = RulerTest(self, self)
        self.pack(self.ruler)

        self.built = True
Пример #22
0
    def __init__(self, parent, prefpanel):
        CmsTab.__init__(self, parent, prefpanel)

        txt = _('Color space profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, rows=10, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        self.cs_widgets = {}
        self.cs_profiles = {}
        self.cs_config_profiles = {}

        self.cs_config = {
            COLOR_RGB: config.cms_rgb_profile,
            COLOR_CMYK: config.cms_cmyk_profile,
            COLOR_LAB: config.cms_lab_profile,
            COLOR_GRAY: config.cms_gray_profile,
            COLOR_DISPLAY: config.cms_display_profile
        }

        for colorspace in COLORSPACES[:-1]:
            txt = _('%s profile:') % colorspace
            grid.pack(wal.Label(grid, txt))
            combo = wal.Combolist(grid, items=[])
            self.cs_widgets[colorspace] = combo
            grid.pack(combo, fill=True)
            self.update_combo(colorspace)
            grid.pack(ManageButton(grid, self, colorspace))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Hardware profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        txt = _('Display profile:')
        grid.pack(wal.Label(grid, txt))
        combo = wal.Combolist(grid, items=[])
        self.cs_widgets[COLOR_DISPLAY] = combo
        grid.pack(combo, fill=True)
        self.update_combo(COLOR_DISPLAY)
        grid.pack(ManageButton(grid, self, COLOR_DISPLAY))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Use display profile')
        self.display_check = wal.Checkbox(self,
                                          txt,
                                          config.cms_use_display_profile,
                                          onclick=self.activate_display)
        self.pack(self.display_check, align_center=False)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        txt = _('Note: Display profile for your hardware can be found here:')
        label = wal.Label(self, txt, fontsize=-1)
        self.pack(label, fill=True, padding_all=5)
        self.pack(wal.HyperlinkLabel(self, 'https://icc.opensuse.org/'))
        self.activate_display()
Пример #23
0
    def build(self):

        self.nb = wal.Notebook(self)

        # ========Palette options
        pal_opt = wal.VPanel(self.nb)
        pal_opt.pack((10, 10))

        grid = wal.GridPanel(self, hgap=5, vgap=5)
        grid.add_growable_col(1)

        txt = _('Current palette:')
        grid.pack(wal.Label(grid, txt))

        pal_list = self.get_palette_list()
        self.pal = wal.Combolist(grid,
                                 items=pal_list,
                                 onchange=self.change_palette)
        current_palette = self.get_current_palette()
        current_palette_name = current_palette.model.name
        self.pal.set_active(pal_list.index(current_palette_name))
        grid.pack(self.pal, fill=True)

        txt = _('Palette orientation:')
        grid.pack(wal.Label(grid, txt))
        self.pal_orient = wal.Combolist(grid, items=PAL_ORIENT)
        self.pal_orient.set_active(config.palette_orientation)
        grid.pack(self.pal_orient)

        pal_opt.pack(grid, fill=True, padding_all=5)

        btm_panel = wal.HPanel(pal_opt)
        pal_opt.pack(btm_panel, expand=True, fill=True)

        cell_panel = wal.VPanel(btm_panel)
        btm_panel.pack(cell_panel, expand=True, fill=True, padding_all=5)

        # ===
        txt = _('Vertical palette')
        vcell_panel = wal.LabeledPanel(cell_panel, text=txt)

        grid = wal.GridPanel(vcell_panel, cols=4, hgap=5, vgap=2)

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell width:')))
        self.vcell_width = wal.IntSpin(grid, config.palette_vcell_width,
                                       (10, 20))
        self.vcell_width.set_enable(False)
        grid.pack(self.vcell_width)
        grid.pack(wal.Label(grid, _('px')))

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell height:')))
        self.vcell_height = wal.IntSpin(grid, config.palette_vcell_height,
                                        (10, 100))
        grid.pack(self.vcell_height)
        grid.pack(wal.Label(grid, _('px')))

        vcell_panel.pack(grid, align_center=False, padding_all=5)
        cell_panel.pack(vcell_panel, fill=True)

        # ===
        txt = _('Horizontal palette')
        hcell_panel = wal.LabeledPanel(cell_panel, text=txt)

        grid = wal.GridPanel(hcell_panel, cols=4, hgap=5, vgap=2)

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell width:')))
        self.hcell_width = wal.IntSpin(grid, config.palette_hcell_width,
                                       (10, 100))
        grid.pack(self.hcell_width)
        grid.pack(wal.Label(grid, _('px')))

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell height:')))
        self.hcell_height = wal.IntSpin(grid, config.palette_hcell_height,
                                        (10, 20))
        self.hcell_height.set_enable(False)
        grid.pack(self.hcell_height)
        grid.pack(wal.Label(grid, _('px')))

        hcell_panel.pack(grid, align_center=False, padding_all=5)
        cell_panel.pack(hcell_panel, fill=True, padding=5)
        # ===

        txt = _('Expand short palettes')
        self.expand = wal.Checkbox(cell_panel, txt, config.palette_expand)
        cell_panel.pack(self.expand, align_center=False)

        self.palviewer = PaletteViewer(btm_panel, self.app.default_cms,
                                       current_palette)
        btm_panel.pack(self.palviewer, fill=True, padding_all=5)

        self.nb.add_page(pal_opt, _('Palette options'))

        # ========Palette management
        self.nb.add_page(PaletteManager(self.app, self, self.nb),
                         _('Palette management'))

        self.pack(self.nb, expand=True, fill=True)
        self.built = True
Пример #24
0
 def build(self):
     self.pack(wal.Label(self, self.orig_fill.__str__()))
Пример #25
0
 def build(self):
     self.pack(wal.HPanel(self), fill=True, expand=True)
     self.pack(PaletteSwatch(self, self.cms, [], (250, 150)))
     txt = _('Empty pattern selected')
     self.pack(wal.Label(self, txt), padding=10)
     self.pack(wal.HPanel(self), fill=True, expand=True)
Пример #26
0
    def __init__(self, parent, dlg, new_stroke):
        self.dlg = dlg
        self.app = dlg.app
        self.stroke = new_stroke
        wal.VPanel.__init__(self, parent)

        self.pack((30, 30))

        p = wal.HPanel(self)
        p.pack(wal.Label(p, _('Stroke width:')), padding=5)
        self.width_spin = UnitSpin(self.app, p, self.stroke[1], step=0.1)
        p.pack(self.width_spin)
        p.pack(StaticUnitLabel(self.app, p), padding=5)
        self.pack(p)

        self.pack((20, 20))

        p = wal.HPanel(self)
        p.pack(wal.Label(p, _('Dashes:')), padding=5)
        self.dashes = DashChoice(p, self.stroke[3])
        p.pack(self.dashes)
        txt = _('Edit dash pattern')
        p.pack(wal.ImageButton(p,
                               icons.PD_EDIT,
                               tooltip=txt,
                               flat=False,
                               onclick=self.edit_dash),
               padding=5)
        self.pack(p)

        grid = wal.GridPanel(self, vgap=15, hgap=15)

        caps_p = wal.LabeledPanel(grid, _('Caps:'))
        self.caps = CapChoice(caps_p, self.stroke[4])
        caps_p.pack(self.caps, align_center=False, padding_all=10)
        grid.pack(caps_p)

        join_p = wal.LabeledPanel(grid, _('Join:'))
        self.join = JoinChoice(join_p, self.stroke[5])
        join_p.pack(self.join, align_center=False, padding_all=10)
        grid.pack(join_p)

        self.pack(grid, padding_all=10)

        p = wal.HPanel(self)
        p.pack(wal.Label(p, _('Miter limit:')), padding=5)
        self.miter_limit = wal.FloatSpin(p,
                                         self.stroke[6],
                                         range_val=(0.0, 1000.0),
                                         digits=5)
        p.pack(self.miter_limit)
        self.pack(p)

        p = wal.HPanel(self)
        self.behind = wal.NumCheckbox(p, _('Behind fill'), self.stroke[7])
        p.pack(self.behind)
        p.pack((30, 10))
        self.scalable = wal.NumCheckbox(p, _('Scalable stroke'),
                                        self.stroke[8])
        p.pack(self.scalable)
        self.pack(p, padding=10)
Пример #27
0
    def build(self):
        self.printsys = self.get_printsys()
        self.prn_list = self.printsys.get_printer_names()
        if self.prn_list:
            self.active_printer = self.printsys.get_default_printer()
            hpanel = wal.HPanel(self)
            hpanel.pack(wal.Label(hpanel, _('Printer:')))
            hpanel.pack((5, 5))
            self.prn_combo = wal.Combolist(hpanel,
                                           items=self.prn_list,
                                           onchange=self.set_data)
            hpanel.pack(self.prn_combo, fill=True, expand=True)
            index = self.prn_list.index(self.active_printer.get_name())
            self.prn_combo.set_active(index)
            self.pack(hpanel, fill=True, padding_all=5)

            self.pack((10, 10))

            # ---Panels
            self.insp = self.app.insp
            units = uc2const.UNIT_MM
            if self.insp.is_doc():
                units = self.app.current_doc.model.doc_units
            units_text = uc2const.unit_short_names[units]

            # ---Shift panel
            shifts = self.active_printer.shifts
            hpanel = wal.HPanel(self)
            txt = _('Printing shift') + ' (%s)' % units_text
            spanel = wal.LabeledPanel(hpanel, text=txt)
            spanel.pack((1, 1), expand=True)

            grid = wal.GridPanel(spanel, 2, 2, 5, 5)

            grid.pack(wal.Label(grid, _('Horizontal shift:')))
            self.hshift = StaticUnitSpin(self.app,
                                         grid,
                                         shifts[0],
                                         can_be_negative=True,
                                         onchange=self.save_data,
                                         onenter=self.save_data)
            grid.pack(self.hshift)

            grid.pack(wal.Label(grid, _('Vertical shift:')))
            self.vshift = StaticUnitSpin(self.app,
                                         grid,
                                         shifts[1],
                                         can_be_negative=True,
                                         onchange=self.save_data,
                                         onenter=self.save_data)
            grid.pack(self.vshift)

            spanel.pack(grid, padding_all=5)
            spanel.pack((1, 1), expand=True)

            hpanel.pack(spanel, fill=True, expand=True)

            hpanel.pack((5, 5))

            # ---Margin panel
            txt = _('Printing margins') + ' (%s)' % units_text
            mpanel = wal.LabeledPanel(hpanel, text=txt)
            mpanel.pack((5, 5))

            mrgs = self.active_printer.margins
            self.top_spin = StaticUnitSpin(self.app,
                                           mpanel,
                                           mrgs[0],
                                           onchange=self.save_data,
                                           onenter=self.save_data)
            mpanel.pack(self.top_spin)

            mpanel.pack((5, 5))

            hp = wal.HPanel(self)
            self.left_spin = StaticUnitSpin(self.app,
                                            hp,
                                            mrgs[3],
                                            onchange=self.save_data,
                                            onenter=self.save_data)
            hp.pack(self.left_spin)
            hp.pack((5, 5))
            self.right_spin = StaticUnitSpin(self.app,
                                             hp,
                                             mrgs[1],
                                             onchange=self.save_data,
                                             onenter=self.save_data)
            hp.pack(self.right_spin)

            mpanel.pack(hp)

            mpanel.pack((5, 5))

            self.bottom_spin = StaticUnitSpin(self.app,
                                              mpanel,
                                              mrgs[2],
                                              onchange=self.save_data,
                                              onenter=self.save_data)
            mpanel.pack(self.bottom_spin)

            mpanel.pack((10, 10))
            # ---

            hpanel.pack(mpanel, fill=True, expand=True)

            self.pack(hpanel, fill=True)

            self.pack((10, 10))

            # ---Calibration page
            text = _("To measure actual print area and vertical/horizontal "
                     "printing shift, just print the calibration page on "
                     "A4/Letter paper.")

            label = wal.Label(self, text)
            label.wrap(470)
            self.pack(label, fill=True, padding_all=5, align_center=False)

            self.a4_calibrate_btn = wal.Button(
                self,
                _('Print A4 calibration page'),
                onclick=self.print_calibration_a4)
            self.pack(self.a4_calibrate_btn)

            self.pack((5, 5))

            self.letter_calibrate_btn = wal.Button(
                self,
                _('Print Letter calibration page'),
                onclick=self.print_calibration_letter)
            self.pack(self.letter_calibrate_btn)

            self.pack((5, 5))

        else:
            self.pack((5, 5), expand=True)
            self.pack(get_bmp(self, icons.PD_NO_PRINTERS), padding=10)
            self.pack(wal.Label(self, _('No printers found')))
            self.pack((10, 10))
            self.pack((5, 5), expand=True)
        self.built = True
Пример #28
0
    def build(self):
        self.page_format = self.doc.methods.get_default_page_format()
        self.formats = [
            _('Custom'),
        ] + uc2const.PAGE_FORMAT_NAMES
        self.pack((5, 10))

        # ---
        hpanel = wal.HPanel(self)
        hpanel.pack((5, 5))
        label = wal.Label(hpanel, _('Default page:'))
        hpanel.pack(label)
        hpanel.pack((5, 5))
        self.page_combo = wal.Combolist(self,
                                        items=self.formats,
                                        onchange=self.page_combo_changed)
        index = 0
        state = True
        if self.page_format[0] in uc2const.PAGE_FORMAT_NAMES:
            index = self.formats.index(self.page_format[0])
            state = False
        self.page_combo.set_active(index)

        hpanel.pack(self.page_combo)

        hpanel.pack((15, 5))

        self.orient_keeper = wal.HToggleKeeper(self,
                                               ORIENTS,
                                               ORIENTS_ICONS,
                                               ORIENTS_NAMES,
                                               on_change=self.orient_changed)
        self.orient_keeper.set_mode(self.page_format[2])
        hpanel.pack(self.orient_keeper)

        self.pack(hpanel, fill=True)

        self.pack((5, 5))

        # ---
        w, h = self.page_format[1]
        hpanel = wal.HPanel(self)
        dx = label.get_size()[0] + 10
        hpanel.pack((dx, 5))

        self.page_width = UnitSpin(self.app,
                                   hpanel,
                                   w,
                                   onchange=self.page_spin_changed)
        hpanel.pack(self.page_width)
        hpanel.pack(get_bmp(self, icons.CTX_W_ON_H), padding=5)
        self.page_height = UnitSpin(self.app,
                                    hpanel,
                                    h,
                                    onchange=self.page_spin_changed)
        hpanel.pack(self.page_height)
        hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5)
        self.page_width.set_enable(state)
        self.page_height.set_enable(state)

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

        # ---
        hpanel = wal.HPanel(self)
        hpanel.pack((5, 5))
        self.desktop_bg = self.doc.methods.get_desktop_bg()

        grid = wal.GridPanel(hpanel, 3, 3, 5, 5)
        grid.add_growable_col(2)

        grid.pack(wal.Label(hpanel, _('Desktop:')))
        self.desktop_color_btn = wal.ColorButton(hpanel, self.desktop_bg)
        grid.pack(self.desktop_color_btn)
        grid.pack(CBMiniPalette(grid,
                                onclick=self.desktop_color_btn.set_value))

        self.page_fill = self.doc.methods.get_page_fill()
        if self.page_fill[0] == FILL_SOLID:
            color1 = self.page_fill[1]
            color2 = [1.0, 1.0, 1.0]
        else:
            color1 = self.page_fill[1][0]
            color2 = self.page_fill[1][1]

        grid.pack(wal.Label(hpanel, _('Page:')))
        self.page_color1_btn = wal.ColorButton(hpanel, color1)
        grid.pack(self.page_color1_btn)
        grid.pack(CBMiniPalette(grid, onclick=self.page_color1_btn.set_value))

        grid.pack((5, 5))
        self.page_color2_btn = wal.ColorButton(hpanel, color2)
        grid.pack(self.page_color2_btn)
        self.colors2 = CBMiniPalette(grid,
                                     onclick=self.page_color2_btn.set_value)
        grid.pack(self.colors2)
        if not self.page_fill[0] == FILL_PATTERN:
            self.page_color2_btn.set_enable(False)
            self.colors2.set_enable(False)

        hpanel.pack(grid, fill=True)
        hpanel.pack((5, 5))
        self.pack(hpanel, fill=True)

        # ---
        vpanel = wal.VPanel(self)
        if wal.IS_MSW: vpanel.pack((5, 5))

        self.pattern_check = wal.Checkbox(vpanel,
                                          _('Use pattern for page fill'),
                                          self.page_fill[0] == FILL_PATTERN,
                                          onclick=self.pattern_check_changed)
        vpanel.pack(self.pattern_check, align_center=False)

        if wal.IS_MSW: vpanel.pack((5, 5))

        self.border_flag = self.doc.methods.get_page_border()
        self.border_check = wal.Checkbox(vpanel, _('Show page border'),
                                         self.border_flag)
        vpanel.pack(self.border_check, align_center=False)
        self.pack(vpanel, fill=True, padding_all=5)
Пример #29
0
    def build(self):
        self.pack((5, 5))

        self.geom = self.doc.methods.get_grid_values()
        hpanel = wal.HPanel(self)

        txt = _('Grid origin')
        origin_panel = wal.LabeledPanel(hpanel, text=txt)
        grid = wal.GridPanel(origin_panel, 2, 3, 5, 5)

        grid.pack(wal.Label(grid, 'X:'))
        self.x_val = UnitSpin(self.app, grid, self.geom[0])
        grid.pack(self.x_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        grid.pack(wal.Label(grid, 'Y:'))
        self.y_val = UnitSpin(self.app, grid, self.geom[1])
        grid.pack(self.y_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        origin_panel.pack(grid, padding_all=5)
        hpanel.pack(origin_panel, padding_all=5, fill=True, expand=True)

        txt = _('Grid frequency')
        freq_panel = wal.LabeledPanel(hpanel, text=txt)
        grid = wal.GridPanel(origin_panel, 2, 3, 5, 5)

        grid.pack(wal.Label(grid, 'dX:'))
        self.dx_val = UnitSpin(self.app, grid, self.geom[2])
        grid.pack(self.dx_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        grid.pack(wal.Label(grid, 'dY:'))
        self.dy_val = UnitSpin(self.app, grid, self.geom[3])
        grid.pack(self.dy_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        freq_panel.pack(grid, padding_all=5)
        hpanel.pack(freq_panel, padding_all=5, fill=True, expand=True)

        self.pack(hpanel, fill=True)

        self.pack((5, 5))

        color_panel = wal.HPanel(self)

        color_panel.pack((10, 10))

        vpanel = wal.VPanel(color_panel)

        hpanel = wal.HPanel(vpanel)
        hpanel.pack(wal.Label(hpanel, _('Grid color:')))
        hpanel.pack((10, 5))
        self.color = self.doc.methods.get_grid_rgba_color()
        self.grid_color_btn = wal.ColorButton(hpanel,
                                              self.color[:3],
                                              onchange=self.on_change)
        hpanel.pack(self.grid_color_btn)
        vpanel.pack(hpanel, fill=True)

        hpanel = wal.HPanel(vpanel)
        hpanel.pack(wal.Label(hpanel, _('Grid opacity:')))
        hpanel.pack((10, 5))
        self.alpha_spin = wal.FloatSpin(hpanel,
                                        self.color[3] * 100.0,
                                        range_val=(0.0, 100.0),
                                        onchange=self.on_spin_change,
                                        onenter=self.on_spin_change)
        hpanel.pack(self.alpha_spin)
        hpanel.pack(wal.Label(hpanel, '%'), padding=3)

        vpanel.pack(hpanel, fill=True, padding=5)

        self.alpha_slider = wal.Slider(vpanel,
                                       int(self.color[3] * 100.0),
                                       range_val=(0, 100),
                                       onchange=self.on_slider_change)
        vpanel.pack(self.alpha_slider, fill=True, padding=5)

        val = self.doc.methods.is_grid_visible()
        self.show_grid_check = wal.Checkbox(vpanel, _('Show grid on canvas'),
                                            val)
        vpanel.pack(self.show_grid_check, fill=True, padding=5)

        color_panel.pack(vpanel)

        color_panel.pack((10, 10))

        preview_panel = wal.VPanel(color_panel)
        preview_panel.pack(wal.Label(hpanel, _('Grid preview:')))
        preview_panel.pack((5, 5))
        self.grid_preview = GridPreview(preview_panel, self.color)
        preview_panel.pack(self.grid_preview, fill=True, expand=True)
        color_panel.pack(preview_panel, fill=True, expand=True)

        color_panel.pack((10, 10))

        self.pack(color_panel, fill=True)
Пример #30
0
    def __init__(self, parent, dlg, new_stroke):
        self.dlg = dlg
        self.app = dlg.app
        self.stroke = new_stroke
        wal.VPanel.__init__(self, parent)

        hp = wal.HPanel(self)

        width_p = wal.LabeledPanel(hp, _('Width:'))
        p = wal.HPanel(width_p)
        self.width_spin = UnitSpin(self.app, p, self.stroke[1], step=0.1)
        p.pack(self.width_spin)
        p.pack((5, 5))
        p.pack(StaticUnitLabel(self.app, p))
        width_p.pack(p, padding_all=5)
        hp.pack(width_p, fill=True)

        hp.pack((5, 5))
        arrow_p = wal.LabeledPanel(hp, _('Markers:'))

        p = wal.HPanel(arrow_p)

        end, start = [], []
        if self.stroke[9]:
            end, start = self.stroke[9]

        self.end_arrow = ArrowChoice(p, arrow=end, end=True)
        self.end_arrow.set_arrow(end)
        p.pack(self.end_arrow)
        p.pack((5, 5))
        self.start_arrow = ArrowChoice(p, arrow=start)
        self.start_arrow.set_arrow(start)
        p.pack(self.start_arrow)

        arrow_p.pack(p)

        hp.pack(arrow_p, expand=True, fill=True)
        self.pack(hp, fill=True, padding_all=10)

        p = wal.HPanel(self)
        p.pack(wal.Label(p, _('Dashes:')), padding=5)
        self.dashes = DashChoice(p, self.stroke[3])
        p.pack(self.dashes)
        txt = _('Edit dash pattern')
        p.pack(wal.ImageButton(p,
                               icons.PD_EDIT,
                               art_size=wal.SIZE_16,
                               tooltip=txt,
                               flat=False,
                               onclick=self.edit_dash),
               padding=5)
        self.pack(p)

        grid = wal.GridPanel(self, rows=1, cols=3, vgap=15, hgap=15)
        grid.add_growable_col(2)

        caps_p = wal.LabeledPanel(grid, _('Caps:'))
        self.caps = CapChoice(caps_p, self.stroke[4])
        caps_p.pack(self.caps, align_center=False, padding_all=10)
        grid.pack(caps_p)

        join_p = wal.LabeledPanel(grid, _('Join:'))
        self.join = JoinChoice(join_p, self.stroke[5])
        join_p.pack(self.join, align_center=False, padding_all=10)
        grid.pack(join_p)

        opt_p = wal.LabeledPanel(grid, _('Options:'))

        p = wal.HPanel(opt_p)
        p.pack(wal.Label(p, _('Miter limit:')), padding=5)
        self.miter_limit = wal.FloatSpin(p,
                                         self.stroke[6],
                                         range_val=(0.0, 1000.0),
                                         digits=5)
        p.pack(self.miter_limit)
        opt_p.pack(p, align_center=False, padding_all=10)

        p = wal.VPanel(opt_p)
        self.behind = wal.NumCheckbox(p, _('Behind fill'), self.stroke[7])
        p.pack(self.behind, align_center=False)

        self.scalable = wal.NumCheckbox(p, _('Scalable stroke'),
                                        self.stroke[8])
        p.pack(self.scalable, align_center=False, padding=10)
        opt_p.pack(p, align_center=False, padding_all=10)

        grid.pack(opt_p, fill=True)

        self.pack(grid, padding_all=10, fill=True)
        self.layout()