def __init__(self, parent, prefpanel): CMS_Tab.__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 Color Management is not activated all colors ' 'will be processed using simple calculation procedures. Therefore ' 'resulted color values will be not accurate.') fontsize = -3 if wal.is_msw(): fontsize = -1 label = wal.Label(self, txt, fontsize=fontsize) label.set_enable(False) if wal.is_msw(): label.wrap(430) panel.pack(label, fill=True, padding_all=5) self.pack(panel, fill=True, expand=True)
def build(self): name, copyrigth, info = get_profile_descr(self.filepath) filename = os.path.basename(self.filepath) copyrigth = copyrigth or '--' info = info or '--' grid = wal.GridPanel(self.panel, rows=4, cols=2, 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)) panel = wal.VPanel(grid) panel.pack(wal.Label(grid, _('Copyright:')), align_center=False) grid.pack(panel, fill=True) grid.pack(wal.Entry(grid, copyrigth, multiline=True, editable=False), fill=True) panel = wal.VPanel(grid) panel.pack(wal.Label(grid, _('Description:')), align_center=False) grid.pack(panel, fill=True) grid.pack(wal.Entry(grid, info, multiline=True, editable=False), fill=True) self.panel.pack(grid, fill=True, expand=True)
def __init__(self, parent, cms, palette=None, onclick=None): self.cms = cms self.callback = onclick wal.VPanel.__init__(self, parent) if wal.is_wx3(): self.pack((172, 1)) options = wal.ExpandedPanel(self, _('Palette preview:')) changer = wal.HToggleKeeper(options, PREVIEW_MODES, MODE_ICON, MODE_NAME, on_change=self.set_mode) options.pack(changer) self.pack(options, fill=True) border = wal.VPanel(self, border=True) if wal.is_wx3(): color = wal.GRAY if wal.is_gtk(): color = wal.UI_COLORS['pressed_border'] border.set_bg(color) self.pack(border, expand=True, fill=True) self.win = ScrolledPalette(border, self.cms, onclick=self.select_color) if wal.is_wx3(): if wal.is_gtk(): inner_border = wal.VPanel(self) inner_border.pack(self.win, expand=True, fill=True) border.pack(inner_border, expand=True, fill=True, padding_all=1) else: border.pack(self.win, expand=True, fill=True, padding_all=1) else: border.pack(self.win, expand=True, fill=True) changer.set_mode(AUTO_MODE) if palette: self.draw_palette(palette)
def build(self): self.set_profiles() vp = wal.VPanel(self.panel) vp.set_bg(wal.UI_COLORS['border']) self.viewer = wal.SimpleList(vp, self.pf_list, on_select=self.selection_changed) vp.pack(self.viewer, expand=True, fill=True, padding_all=1) self.panel.pack(vp, expand=True, fill=True, padding_all=5) btn_box = wal.VPanel(self.panel) self.panel.pack(btn_box, fill=True, padding_all=5) self.import_btn = wal.Button(btn_box, _('Import'), onclick=self.import_profile) btn_box.pack(self.import_btn, fill=True, end_padding=5) self.remove_btn = wal.Button(btn_box, _('Remove'), onclick=self.remove_profile) btn_box.pack(self.remove_btn, fill=True, end_padding=5) self.info_btn = wal.Button(btn_box, _('Info'), onclick=self.profile_info) btn_box.pack(self.info_btn, fill=True, end_padding=5) self.viewer.set_active(0)
def __init__(self, parent, cms, color=None): self.cms = cms if not color: color = get_registration_black() wal.VPanel.__init__(self, parent, True) nf = wal.VPanel(self) nf.set_bg(wal.BLACK) self.name_field = wal.Label(nf, '???', fontbold=True, fg=wal.WHITE) nf.pack(self.name_field, padding_all=3) vf = wal.VPanel(self) vf.set_bg(wal.WHITE) self.color_type = wal.Label(vf, '???', fontbold=True, fontsize=-1) self.line1 = wal.Label(vf, '???', fontsize=-1) self.line2 = wal.Label(vf, '???', fontsize=-1) vf.pack(self.color_type, padding_all=3) vf.pack(self.line1, padding_all=1) vf.pack(self.line2, padding_all=1) self.color_swatch = AlphaColorSwatch(self, self.cms, color, (180, 100), border='') self.pack(nf, fill=True) self.pack(vf, fill=True) self.pack(self.color_swatch, fill=True, expand=True)
def build(self): self.splitter = wal.Splitter(self.panel) self.panel.pack(self.splitter, expand=True, fill=True) self.tree_container = wal.VPanel(self.splitter) if not PREFS_DATA: PREFS_DATA.append(PrefsAppItem(PREFS_APP)) # PREFS_DATA.append(PrefsDocItem(PREFS_DOC)) for item in PREFS_DATA: item.init_prefs(self.app, self) self.tree = wal.TreeWidget(self.tree_container, data=PREFS_DATA, on_select=self.on_select, border=False) self.tree_container.pack(self.tree, fill=True, expand=True) cont = wal.VPanel(self.splitter) cont.pack(wal.PLine(cont), fill=True) self.container = wal.VPanel(cont) cont.pack(self.container, fill=True, expand=True) cont.pack(wal.PLine(cont), fill=True) sash_pos = config.prefs_sash_pos self.splitter.split_vertically(self.tree_container, cont, sash_pos) self.splitter.set_min_size(sash_pos) if not wal.IS_MSW: self.tree.set_indent(5) self.tree.expand_all()
def __init__(self, app, parent): wal.HPanel.__init__(self, parent) hp = wal.HPanel(self) self.pack(hp) hp.pack((55, 15)) logo_p = wal.VPanel(hp) hp.pack(logo_p, fill=True) logo_p.pack(get_bmp(logo_p, icons.SK1_ICON48), padding=5) hp.pack((10, 5)) box = wal.VPanel(hp) hp.pack(box, padding=5) data = app.appdata txt = data.app_name + ' - ' + _('vector graphics editor') box.pack(wal.Label(box, txt, True, 2), fill=True) data = app.appdata mark = '' if not data.build else ' %s %s' % (_('build'), data.build) txt = '%s: %s %s%s' % (_('Version'), data.version, data.revision, mark) box.pack(wal.Label(box, txt), fill=True) box.pack((35, 35)) import datetime year = str(datetime.date.today().year) txt = '(C) 2011-%s sK1 Project team' % year + '\n' box.pack(wal.Label(box, txt), fill=True) p = wal.HPanel(box) p.pack(wal.HyperlinkLabel(p, 'https://sk1project.net')) box.pack(p, fill=True)
def __init__(self, parent, dlg, cms, pattern_def, onchange=None): self.dlg = dlg self.app = dlg.app self.cms = cms self.pattern_def = deepcopy(pattern_def) self.callback = onchange wal.HPanel.__init__(self, parent) left_panel = wal.VPanel(self) self.pattern_swatch = PatternSwatch(left_panel, self.cms, pattern_def) left_panel.pack(self.pattern_swatch) button_panel = wal.HPanel(left_panel) txt = _('Load pattern from file') button_panel.pack(wal.ImageButton(self, icons.PD_OPEN, wal.SIZE_16, tooltip=txt, flat=False, onclick=self.load_pattern), padding=1) txt = _('Save pattern into file') button_panel.pack(wal.ImageButton(self, icons.PD_FILE_SAVE, wal.SIZE_16, tooltip=txt, flat=False, onclick=self.save_pattern), padding=1) left_panel.pack(button_panel, padding=2) self.pack(left_panel, fill=True) right_panel = wal.VPanel(self) self.pattern_color_editor = PatternColorEditor(right_panel, dlg, cms, pattern_def[2], onchange=self.color_changed) right_panel.pack(self.pattern_color_editor, padding=5) self.trafo_editor = PatternTrafoEditor(right_panel, dlg.app, onchange=self.trafo_changed) right_panel.pack(self.trafo_editor, padding=5) self.pack(right_panel, fill=True, expand=True)
def build(self): self.panel.pack(wal.PLine(self.panel), fill=True) self.splitter = wal.Splitter(self.panel, hidden=True) self.panel.pack(self.splitter, expand=True, fill=True) self.tree_container = wal.VPanel(self.splitter) if not PREFS_DATA: items = [] for class_ in PREFS_APP: item = class_(self.app, self, None) item.hide() items.append(item) PREFS_DATA.append(items) self.tree = wal.PrefsList(self.tree_container, data=PREFS_DATA[0], on_select=self.on_select) self.tree_container.pack(self.tree, fill=True, expand=True) cont = wal.VPanel(self.splitter) self.container = wal.HPanel(cont) self.container.pack(wal.PLine(self.container), fill=True) self.container.pack(wal.SplitterSash(self.container, self.splitter), fill=True) cont.pack(self.container, fill=True, expand=True) sash_pos = config.prefs_sash_pos self.splitter.split_vertically(self.tree_container, cont, sash_pos) self.splitter.set_min_size(sash_pos) self.panel.pack(wal.PLine(self.panel), fill=True)
def build(self): prnpanel = wal.VPanel(self) # --- Control panels prnpanel.pack(PrinterPanel(prnpanel, self, self.printsys), fill=True) prnpanel.pack(PrintModePanel(prnpanel, self.printer), fill=True) prnpanel.pack(PageRangePanel(prnpanel, self.printout), fill=True) prnpanel.pack(CopiesPanel(prnpanel, self.printer, self.printout), fill=True) # --- Control panels end self.pack(prnpanel, fill=True) self.pack(wal.VLine(self), fill=True) cont = wal.VPanel(self) r_grid = wal.GridPanel(cont) cv_grid = wal.GridPanel(r_grid) self.canvas = PreviewCanvas(cv_grid, self, self.printer, self.printout) units = self.printout.get_units() corner = PreviewCorner(r_grid) hruler = PreviewRuler(r_grid, self.canvas, units) hruler.set_bg(wal.WHITE) vruler = PreviewRuler(r_grid, self.canvas, units, False) vruler.set_bg(wal.WHITE) tb = PreviewToolbar(cont, self, self.canvas, self.printer) vscroll = wal.ScrollBar(cv_grid, onscroll=self.canvas._scrolling) hscroll = wal.ScrollBar(cv_grid, False, onscroll=self.canvas._scrolling) self.canvas.set_ctrls(hscroll, vscroll, hruler, vruler, tb.pager) cont.pack(tb, fill=True) cont.pack(wal.HLine(self), fill=True) cv_grid.add_growable_col(0) cv_grid.add_growable_row(0) cv_grid.pack(self.canvas, fill=True) cv_grid.pack(vscroll, fill=True) cv_grid.pack(hscroll, fill=True) cv_grid.pack((1, 1)) r_grid.add_growable_col(1) r_grid.add_growable_row(1) r_grid.pack(corner) r_grid.pack(hruler, fill=True) r_grid.pack(vruler, fill=True) r_grid.pack(cv_grid, fill=True) cont.pack(r_grid, fill=True, expand=True) self.pack(cont, fill=True, expand=True) prn_events.connect(prn_events.PRINTER_CHANGED, self.printer_changed) prn_events.connect(prn_events.PRINTOUT_MODIFIED, self.printout_modified) prn_events.connect(prn_events.PRINTER_MODIFIED, self.printer_modified)
def build(self): vpanel = wal.VPanel(self.panel) vpanel.set_bg(wal.WHITE) txt = self.printer.get_name() vpanel.pack(wal.Label(vpanel, txt, fontsize=2, fontbold=True), padding=5) line = wal.VPanel(vpanel) line.pack((3, 3)) line.set_bg(wal.UI_COLORS['selected_text_bg']) vpanel.pack(line, fill=True) self.panel.pack(vpanel, fill=True)
def __init__(self, app, prefpanel, parent): self.app = app self.prefpanel = prefpanel wal.HPanel.__init__(self, parent) data = self.get_palette_list() self.pal_list = wal.SimpleList(self, data, on_select=self.change_palette) self.pack(self.pal_list, expand=True, fill=True, padding_all=5) self.pal_viewer = PaletteViewer(self, self.app.default_cms) self.pack(self.pal_viewer, fill=True, padding_all=5) btn_box = wal.VPanel(self) self.pack(btn_box, fill=True, padding_all=5) btn_box.pack(wal.Button(btn_box, _('Import'), onclick=self.import_palette), fill=True, end_padding=5) btn_box.pack(wal.Button(btn_box, _('Export'), onclick=self.export_palette), fill=True, end_padding=5) self.remove_btn = wal.Button(btn_box, _('Remove'), onclick=self.remove_palette) btn_box.pack(self.remove_btn, fill=True, end_padding=5) self.edit_btn = wal.Button(btn_box, _('Edit info'), onclick=self.edit_info) btn_box.pack(self.edit_btn, fill=True, end_padding=5) btn_box.pack(wal.VPanel(btn_box), fill=True, expand=True) btn_box.pack(wal.ImageButton(btn_box, icons.PD_DOWNLOAD48, tooltip=_('Download more palettes'), flat=False, onclick=self.download_more), fill=True, end_padding=5) # btn_box.pack(CollectionButton(btn_box, self.app, self, # self.prefpanel.dlg), fill=True, end_padding=5) self.update_palette_list()
def build_ui(self): self.icon = get_icon(PLUGIN_ICON) panel = wal.VPanel(self.panel) panel.pack(wal.Label(panel, _('Text position on path')), padding_all=5) hp = wal.HPanel(panel) hp.pack(wal.Label(hp, _('Base point:'))) self.base_point = wal.FloatSpin(hp, value=50.0, range_val=(0.0, 100.0), step=1.0) hp.pack(self.base_point, padding=5) hp.pack(wal.Label(hp, _('%'))) panel.pack(hp, padding=5) self.align_keeper = wal.HToggleKeeper(panel, TEXT_ALIGNS, TEXT_ALIGN_ICONS, TEXT_ALIGN_TEXTS, on_change=self.update_bmp) panel.pack(self.align_keeper) self.align_keeper.set_mode(TEXT_ALIGNS[1]) border = wal.VPanel(panel) 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, TEXT_ALIGN_PICS[TEXT_ALIGNS[1]]) self.pic_panel.pack(self.bmp, padding_all=5) border.pack(self.pic_panel, padding_all=1) panel.pack(border, padding=10) self.other_side = wal.Checkbox(panel, _('Place on other side'), onclick=self.update_bmp) panel.pack(self.other_side, padding=5) self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action) panel.pack(self.apply_btn, padding=5, fill=True) self.panel.pack(panel, fill=True, padding_all=5) self.panel.pack(wal.HLine(self.panel), fill=True) events.connect(events.DOC_CHANGED, self.update) events.connect(events.SELECTION_CHANGED, self.update) events.connect(events.DOC_MODIFIED, self.update) self.update()
def __init__(self, parent): wal.ScrolledPanel.__init__(self, parent) grid = wal.GridPanel(self, len(COLORS), 2, 10, 10) for item in COLORS: grid.pack(wal.Label(grid, item)) panel = wal.VPanel(grid) panel.set_bg(wal.BLACK) color_panel = wal.VPanel(panel) color_panel.pack((80, 30)) color_panel.set_bg(wal.UI_COLORS[item]) panel.pack(color_panel, padding_all=1) grid.pack(panel) self.pack(grid, padding=10)
def __init__(self, parent): wal.VPanel.__init__(self, parent) from uc2 import libimg, libpango, libcairo, cms import reportlab data = [[_('Component'), _('Version')]] mark = '' if not uc2const.BUILD else ' build %s' % uc2const.BUILD uc_ver = '%s %s%s' % (uc2const.VERSION, uc2const.REVISION, mark) data.append(['Python', sys.version]) data.append(['wxWidgets', wal.VERSION]) data.append(['UniConvertor', uc_ver]) data.append(['LCMS', cms.libcms.get_version()]) data.append(['Cairo', libcairo.get_version()[0]]) data.append(['pycairo', libcairo.get_version()[1]]) data.append(['Pillow', libimg.get_version()]) data.append(['ImageMagick', libimg.get_magickwand_version()[0]]) data.append(['Pango', libpango.get_version()]) data.append(['Reportlab', reportlab.Version]) if not wal.IS_MSW: import cups try: cups.require('10.0') except RuntimeError as e: data.append(['pycups', str(e).split()[-1]]) vp = wal.VPanel(self) vp.set_bg(wal.UI_COLORS['border']) slist = wal.ReportList(vp, data, border=False) vp.pack(slist, expand=True, fill=True, padding_all=1) self.pack(vp, expand=True, fill=True, padding_all=5) slist.set_column_width(0, wal.LIST_AUTOSIZE)
def build_ui(self): self.icon = get_icon(PLUGIN_ICON) panel = wal.VPanel(self.panel) panel.pack(wal.Label(panel, _('Text position on circle')), padding_all=5) self.bmp = PositionSwitch(panel) panel.pack(self.bmp, padding_all=5) self.other_side = wal.Checkbox(panel, _('Place on other side'), onclick=self.update_bmp) panel.pack(self.other_side, padding=5) self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action) panel.pack(self.apply_btn, padding=5, fill=True) self.panel.pack(panel, fill=True, padding_all=5) self.panel.pack(wal.HLine(self.panel), fill=True) events.connect(events.DOC_CHANGED, self.update) events.connect(events.SELECTION_CHANGED, self.update) events.connect(events.DOC_MODIFIED, self.update) self.update()
def __init__(self, parent, app, cms_ref, onchange=None): self.cms = cms_ref self.app = app self.callback = onchange wal.HPanel.__init__(self, parent) current_palette = self.get_current_palette() self.palviewer = PaletteViewer(self, self.cms, current_palette, self.on_change) self.pack(self.palviewer, fill=True) self.pack((5, 5)) view_panel = wal.VPanel(self) view_panel.pack(wal.Label(view_panel, _('Palette:')), align_center=False) pal_list = self.get_palette_list() self.pal = wal.Combolist(view_panel, items=pal_list, onchange=self.change_palette) current_palette_name = current_palette.model.name self.pal.set_active(pal_list.index(current_palette_name)) view_panel.pack(self.pal, fill=True) self.sticker = ColorSticker(view_panel, self.cms) view_panel.pack(self.sticker, padding=5) self.pack(view_panel, fill=True, expand=True) self.palviewer.set_active_color()
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=_('Move layer to bottom'), onclick=self.lower_layer_to_bottom) self.layer_lower = wal.ImageButton(pnl, icons.PD_LOWER, tooltip=_('Move layer down'), onclick=self.lower_layer) self.layer_raise = wal.ImageButton(pnl, icons.PD_RAISE, tooltip=_('Move layer up'), onclick=self.raise_layer) self.layer_to_top = wal.ImageButton(pnl, icons.PD_RAISE_TO_TOP, tooltip=_('Move 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 = [make_artid(item) for item in BITMAPS] 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) events.connect(events.PAGE_CHANGED, self.update) self.update()
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) val = self.doc.methods.is_guide_visible() self.show_guide_check = wal.Checkbox(vpanel, _('Show guides on canvas'), val) vpanel.pack(self.show_guide_check, align_center=False, 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)
def build_ui(self): self.icon = get_icon(PLUGIN_ICON) self.panel.pack((5, 5)) self.shaping_keeper = wal.HToggleKeeper(self.panel, SHAPING_MODES, SHAPING_MODE_ICONS, SHAPING_MODE_NAMES, self.on_mode_change) self.panel.pack(self.shaping_keeper) self.panel.pack(wal.HLine(self.panel), fill=True, padding=3) self.shaping_panel = wal.VPanel(self.panel) self.panels = {} for item in SHAPING_MODES: panel = SHAPING_CLASSES[item](self.shaping_panel, self.app) panel.hide() self.panels[item] = panel self.panel.pack(self.shaping_panel, fill=True, padding_all=5) self.panel.pack(wal.HLine(self.panel), fill=True) events.connect(events.DOC_CHANGED, self.update) events.connect(events.SELECTION_CHANGED, self.update) events.connect(events.DOC_MODIFIED, self.update) self.update()
def __init__(self, parent): wal.ScrolledPanel.__init__(self, parent) keys = WX_COLORS.keys() keys.sort() grid = wal.GridPanel(self, len(keys), 2, 10, 10) for item in keys: grid.pack(wal.Label(grid, item)) panel = wal.VPanel(grid) panel.set_bg(wal.BLACK) color_panel = wal.VPanel(panel) color_panel.pack((80, 30)) color_panel.set_bg(wx.SystemSettings.GetColour(WX_COLORS[item]).Get() if wal.IS_WX4 else wx.SystemSettings_GetColour(WX_COLORS[item]).Get()) panel.pack(color_panel, padding_all=1) grid.pack(panel) self.pack(grid, padding=10)
def __init__(self, parent, printer, app): self.app = app self.printer = printer wal.LabeledPanel.__init__(self, parent, _('Orientation')) hpanel = wal.HPanel(self) vpanel = wal.VPanel(hpanel) self.port_opt = wal.Radiobutton(vpanel, _('Portrait'), group=True, onclick=self.update) vpanel.pack(self.port_opt, align_center=False) vpanel.pack((5, 5)) self.land_opt = wal.Radiobutton(vpanel, _('Landscape'), onclick=self.update) vpanel.pack(self.land_opt, align_center=False) hpanel.pack(vpanel) icon_name = icons.PD_PRINTORIENT_PORTRAIT if self.printer.page_orientation == uc2const.LANDSCAPE: icon_name = icons.PD_PRINTORIENT_LANDSCAPE self.land_opt.set_value(True) icon = get_icon(icon_name, size=wal.DEF_SIZE) self.orient_icon = wal.Bitmap(hpanel, icon) hpanel.pack(self.orient_icon, padding=10) self.pack(hpanel, fill=True, expand=True, padding_all=10)
def build_ui(self): self.icon = get_icon(PLUGIN_ICON) self.config = IconizerConfig() config_dir = self.app.appdata.app_config_dir config_file = os.path.join(config_dir, 'iconizer_config.xml') self.config.load(config_file) self.panel.pack((5, 5)) hpanel = wal.HPanel(self.panel) hpanel.pack(wal.Label(hpanel, _('Background:'))) self.bg_color_btn = wal.ColorButton(hpanel, self.config.bg_color, onchange=self.update, silent=False) hpanel.pack((5, 5)) hpanel.pack(self.bg_color_btn) self.panel.pack(hpanel, padding=5) self.pallete = CBMiniPalette(self.panel, COLORS, onclick=self.bg_color_btn.set_value) self.panel.pack(self.pallete) self.panel.pack((10, 10)) self.viewer = ImageViewer(self.panel, self.config.bg_color) self.panel.pack(self.viewer) self.panel.pack((10, 10)) check_panel = wal.VPanel(self.panel) self.border_check = wal.Checkbox(check_panel, _('Show image border'), value=self.config.draw_border, onclick=self.update) check_panel.pack(self.border_check, align_center=False) self.sel_check = wal.Checkbox(check_panel, _('Draw selected only'), value=self.config.draw_selected, onclick=self.update) check_panel.pack(self.sel_check, align_center=False) self.panel.pack(check_panel) self.apply_btn = wal.Button(self.panel, _('Save image'), onclick=self.apply_action) self.panel.pack(self.apply_btn, fill=True, padding_all=5) self.panel.pack((5, 5)) self.panel.pack(wal.HLine(self.panel), fill=True) events.connect(events.DOC_CHANGED, self.update) events.connect(events.SELECTION_CHANGED, self.update) events.connect(events.DOC_MODIFIED, self.update)
def __init__(self, parent): wal.VPanel.__init__(self, parent) vp = wal.VPanel(self) vp.set_bg(wal.UI_COLORS['border']) tr_list = wal.ReportList(vp, TR_LIST, border=False) vp.pack(tr_list, expand=True, fill=True, padding_all=1) self.pack(vp, expand=True, fill=True, padding_all=5) tr_list.set_column_width(0, wal.LIST_AUTOSIZE)
def build_ui(self): self.icon = get_icon(PLUGIN_ICON) panel = wal.VPanel(self.panel) self.transform_keeper = wal.HToggleKeeper(panel, TRANSFORM_MODES, TRANSFORM_MODE_ICONS, TRANSFORM_MODE_NAMES, self.on_mode_change) panel.pack(self.transform_keeper) panel.pack(wal.HLine(panel), fill=True, padding=3) self.transform_panel = wal.VPanel(panel) self.transforms = {} for item in TRANSFORM_MODES: transf = TRANSFORM_CLASSES[item](self.transform_panel, self.app, self.on_reset) transf.hide() self.transforms[item] = transf panel.pack(self.transform_panel, fill=True) hpanel = wal.HPanel(panel) self.oi = OrientationIndicator(hpanel, onchange=self.on_orient_change) hpanel.pack(self.oi) hpanel.pack((10, 10)) hpanel.pack(OriginIndicator(hpanel, self.app)) panel.pack(hpanel, padding_all=10) self.apply_copy_btn = wal.Button(panel, _('Apply to copy'), onclick=self.action_copy) panel.pack(self.apply_copy_btn, fill=True) self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action) panel.pack(self.apply_btn, padding=3, fill=True) panel.pack(wal.HLine(panel), fill=True) self.panel.pack(panel, fill=True, expand=True, padding_all=5) events.connect(events.DOC_CHANGED, self.update) events.connect(events.SELECTION_CHANGED, self.update) events.connect(events.DOC_MODIFIED, self.update) self.update()
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))
def __init__(self, app, parent): self.app = app wal.HPanel.__init__(self, parent) self.pack(wal.PLine(self), fill=True) self.container = wal.VPanel(self) self.pack(self.container, expand=True, fill=True) self.tabs = PlgTabsPanel(app, self) self.pack(self.tabs, fill=True) self.layout()
def __init__(self, parent): wal.HPanel.__init__(self, parent) pnl = wal.VPanel(self, border=True) self.lst = wal.LayerList(pnl, TEST_LIST, BITMAPS, on_change=self.changes) pnl.pack(self.lst, fill=True, expand=True) self.pack(pnl, padding_all=10, fill=True, expand=True)
def __init__(self, parent): self.parent = parent wal.HPanel.__init__(self, parent) int_panel = wal.VPanel(self) self.pack(int_panel, expand=True) int_panel.pack(wal.Label(int_panel, _('Loading data...'))) path = os.path.join(config.resource_dir, 'icons', 'generic') filepath = os.path.join(path, 'progress.gif') self.gif = wal.AnimatedGif(int_panel, filepath) int_panel.pack(self.gif, padding_all=10) self.gif.play()
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)