def __init__(self, app, parent): self.app = app self.mw = parent wal.VPanel.__init__(self, parent) self.ctxpanel = AppCtxPanel(self.app, self) self.doc_tabs = DocTabPanel(app, self, config.ui_style != appconst.GUI_CLASSIC) if config.ui_style == appconst.GUI_CLASSIC: if not wal.IS_MAC: self.pack(wal.HLine(self), fill=True) self.pack(self.ctxpanel, fill=True) self.pack(self.doc_tabs, fill=True) if config.ui_style == appconst.GUI_TABBED: self.pack(self.doc_tabs, fill=True) self.pack(self.ctxpanel, fill=True) self.pack(wal.PLine(self), fill=True) # ===== Main part hpanel = wal.HPanel(self) self.pack(hpanel, expand=True, fill=True) # ----- Tools self.tools = AppTools(self.app, hpanel) hpanel.pack(self.tools, fill=True, padding_all=2) hpanel.pack(wal.PLine(hpanel), fill=True) self.splitter = wal.Splitter(hpanel) # ----- Doc Area self.grid_panel = wal.GridPanel(self.splitter) self.grid_panel.add_growable_col(1) self.grid_panel.add_growable_row(1) self.corner = RulerSurface(self.app, self.grid_panel) self.grid_panel.add(self.corner) self.hruler = HRulerSurface(self.app, self.grid_panel) self.grid_panel.pack(self.hruler, fill=True) self.vruler = VRulerSurface(self.app, self.grid_panel) self.grid_panel.pack(self.vruler, fill=True) int_grid = wal.GridPanel(self.grid_panel) int_grid.add_growable_col(0) int_grid.add_growable_row(0) self.canvas = CanvasSurface(self.app, int_grid) int_grid.pack(self.canvas, fill=True) self.vscroll = wal.ScrollBar(int_grid) int_grid.pack(self.vscroll, fill=True) self.hscroll = wal.ScrollBar(int_grid, vertical=False) int_grid.pack(self.hscroll, fill=True) self.viewer = wal.VPanel(int_grid) int_grid.pack(self.viewer, fill=True) self.canvas.set_scrolls(self.hscroll, self.vscroll) self.grid_panel.pack(int_grid, fill=True) # ----- Doc Area End self.plg_area = PlgArea(self.app, self.splitter) self.app.mdiarea = self self.app.plg_area = self.plg_area self.splitter.split_vertically(self.grid_panel, self.plg_area) self.splitter.set_min_size(200) self.splitter.set_sash_gravity(1.0) self.splitter.unsplit() hpanel.pack(self.splitter, expand=True, fill=True) # ----- Vertical Palette panel self.vp_panel = wal.HPanel(hpanel) self.vp_panel.pack(wal.PLine(self.vp_panel), fill=True) vpalette_panel = AppVPalette(self.vp_panel, self.app) self.vp_panel.pack(vpalette_panel, fill=True, padding=2) hpanel.pack(self.vp_panel, fill=True) if config.palette_orientation == uc2const.HORIZONTAL: self.vp_panel.hide() # ----- Horizontal Palette panel self.hp_panel = wal.VPanel(self) self.hp_panel.pack(wal.PLine(self.hp_panel), fill=True) hpalette_panel = AppHPalette(self.hp_panel, self.app) self.hp_panel.pack(hpalette_panel, fill=True, padding=2) self.pack(self.hp_panel, fill=True) self.change_palette() # ----- Status bar self.pack(wal.PLine(self), fill=True) self.statusbar = AppStatusbar(self) self.pack(self.statusbar, fill=True) self.layout() events.connect(events.CONFIG_MODIFIED, self.config_update)
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, _('Ruler preview:'), 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
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()
def build(self): self.nb = wal.Notebook(self) # ---------------------- vpanel = wal.VPanel(self.nb) grid = wal.GridPanel(vpanel, rows=3, cols=2, hgap=10, vgap=5) grid.pack(wal.Label(grid, _('UI style (*):'))) items = [_('Classic'), _('Tabbed')] self.ui_style = wal.Combolist(grid, items=items) self.ui_style.set_active(config.ui_style) grid.pack(self.ui_style, fill=True) grid.pack(wal.Label(grid, _('Tab style:'))) items = [_('Rectangle tabs'), _('Rounded tabs'), _('Flat tabs'), _('Trapezoidal tabs')] self.tab_style = wal.Combolist(grid, items=items) index = config.tab_style if config.tab_style < len(items) else 0 self.tab_style.set_active(index) grid.pack(self.tab_style, fill=True) grid.pack((1,1)) grid.pack((300,1)) vpanel.pack(grid, align_center=False, padding_all=10) txt = _('Show quick access buttons') self.stub_buttons = wal.Checkbox(grid, txt, config.show_stub_buttons) vpanel.pack(self.stub_buttons, align_center=False, padding_all=5) int_vp = wal.VPanel(vpanel) vpanel.pack(int_vp, fill=True, padding_all=5) if not wal.IS_MAC and wal.IS_WX2: txt = _('Use overlay for spinbox widgets (*)') self.spin_overlay = wal.Checkbox(int_vp, txt, config.spin_overlay) int_vp.pack(self.spin_overlay, align_center=False) if wal.IS_GTK and wal.IS_WX2: txt = _('Separate spin in spinbox widgets (*)') self.spin_sep = wal.Checkbox(int_vp, txt, config.spin_sep) int_vp.pack(self.spin_sep, align_center=False) if wal.IS_UNITY: txt = _('Unity related features') int_vp.pack(wal.Label(int_vp, txt, fontsize=2, fontbold=True), start_padding=10) int_vp.pack(wal.HLine(int_vp), fill=True, padding=2) txt = _('Use Unity Global Menu (*)') self.ubuntu_gm = wal.Checkbox(int_vp, txt, config.ubuntu_global_menu) int_vp.pack(self.ubuntu_gm, align_center=False) txt = _('Allow overlay for scrollbars (*)') self.ubuntu_overlay = wal.Checkbox(int_vp, txt, config.ubuntu_scrollbar_overlay) int_vp.pack(self.ubuntu_overlay, align_center=False) self.nb.add_page(vpanel, _('UI style')) # ---------------------- vpanel = wal.VPanel(self.nb) table = wal.GridPanel(vpanel, rows=1, cols=3, hgap=5, vgap=5) vpanel.pack(table, fill=True, padding_all=5) int_vp = wal.VPanel(table) txt = _('New document on start') self.newdoc = wal.Checkbox(int_vp, txt, config.new_doc_on_start) int_vp.pack(self.newdoc, align_center=False, padding=3) txt = _('Backup on document save') self.backup = wal.Checkbox(int_vp, txt, config.make_backup) int_vp.pack(self.backup, align_center=False, padding=3) txt = _('Make font cache on start') self.fcache = wal.Checkbox(int_vp, txt, config.make_font_cache_on_start) int_vp.pack(self.fcache, align_center=False, padding=3) txt = _('Backup on export') self.expbackup = wal.Checkbox(int_vp, txt, config.make_export_backup) int_vp.pack(self.expbackup, align_center=False, padding=3) table.pack(int_vp) table.pack((15, 5)) grid = wal.GridPanel(self, rows=2, cols=2, hgap=5, vgap=3) grid.pack(wal.Label(grid, _('History log size:'))) self.hist_size = wal.IntSpin(grid, config.history_size, (10, 1000)) grid.pack(self.hist_size) grid.pack(wal.Label(grid, _('History menu size:'))) self.hist_menu_size = wal.IntSpin(grid, config.history_list_size, (5, 20)) grid.pack(self.hist_menu_size) table.pack(grid) self.nb.add_page(vpanel, _('Generic features')) self.pack(self.nb, fill=True, expand=True, padding=5) txt = _('(*) - These options require application restart') self.pack(wal.Label(grid, txt, fontsize=-1), align_center=False) self.built = True
def build(self): prnpanel = wal.VPanel(self) # --- Control panels prnpanel.pack(wal.PLine(prnpanel), fill=True) 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.PLine(self), fill=True) cont = wal.VPanel(self) cont.pack(wal.PLine(cont), fill=True) 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.PLine(cont), 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 __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()
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) 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) hpanel.pack(self.orient_keeper) hpanel.pack((5, 5)) self.as_current = wal.Button(hpanel, ' %s ' % _('As current page'), onclick=self.set_as_current) hpanel.pack(self.as_current) self.pack(hpanel, fill=True) self.pack((5, 5)) # --- hpanel = wal.HPanel(self) dx = label.get_size()[0] + 10 hpanel.pack((dx, 5)) self.page_width = UnitSpin(self.app, hpanel, 0, 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, 0, onchange=self.page_spin_changed) hpanel.pack(self.page_height) hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5) self.pack(hpanel, fill=True) self.pack(wal.HLine(self), padding_all=5, fill=True) self.set_page_format(self.page_format) # --- COLORS hpanel = wal.HPanel(self) hpanel.pack((5, 5)) grid = wal.GridPanel(hpanel, 3, 3, 5, 5) grid.add_growable_col(2) grid.pack(wal.Label(grid, _('Desktop:'))) self.desktop_bg = self.doc.methods.get_desktop_bg() self.desktop_color_btn = wal.ColorButton(grid, 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(grid, _('Page:'))) self.page_color1_btn = wal.ColorButton(grid, 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(grid, 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)
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) preview_panel.pack((5, 5)) color_panel.pack(preview_panel, fill=True, expand=True) color_panel.pack((10, 10)) self.pack(color_panel, fill=True, expand=True) self.layout()
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
def build(self): txt = _('Create new document on start') self.newdoc = wal.Checkbox(self, txt, config.new_doc_on_start) self.pack(self.newdoc, align_center=False, start_padding=5) if wal.is_msw():self.pack((5, 5)) txt = _('Make backup on document save') self.backup = wal.Checkbox(self, txt, config.make_backup) self.pack(self.backup, align_center=False) if wal.is_msw():self.pack((5, 5)) txt = _('Make backup on export') self.expbackup = wal.Checkbox(self, txt, config.make_export_backup) self.pack(self.expbackup, align_center=False) if wal.is_msw():self.pack((5, 5)) grid = wal.GridPanel(self, rows=2, cols=3, hgap=5, vgap=3) grid.pack(wal.Label(grid, _('History log size:'))) self.hist_size = wal.IntSpin(grid, config.history_size, (10, 1000), spin_overlay=config.spin_overlay) grid.pack(self.hist_size) grid.pack(wal.Label(grid, _('records'))) grid.pack(wal.Label(grid, _('History menu size:'))) self.hist_menu_size = wal.IntSpin(grid, config.history_list_size, (5, 20), spin_overlay=config.spin_overlay) grid.pack(self.hist_menu_size) grid.pack(wal.Label(grid, _('records'))) self.pack(grid, align_center=False, padding=5) if wal.is_msw():self.pack((5, 5)) txt = _('Make font cache on start') self.fcache = wal.Checkbox(self, txt, config.make_font_cache_on_start) self.pack(self.fcache, align_center=False) if wal.is_msw():self.pack((5, 5)) txt = _('Show quick access buttons') self.stub_buttons = wal.Checkbox(self, txt, config.show_stub_buttons) self.pack(self.stub_buttons, align_center=False) if wal.is_msw():self.pack((5, 5)) if not config.is_mac(): txt = _('Use overlay for spinbox widgets (*)') self.spin_overlay = wal.Checkbox(self, txt, config.spin_overlay) self.pack(self.spin_overlay, align_center=False) if config.is_ubuntu(): txt = _('Ubuntu related features') self.pack(wal.Label(grid, txt, fontsize=2, fontbold=True), start_padding=10) self.pack(wal.HLine(self), fill=True, padding=2) txt = _('Use Unity Global Menu (*)') self.ubuntu_gm = wal.Checkbox(self, txt, config.ubuntu_global_menu) self.pack(self.ubuntu_gm, align_center=False) txt = _('Allow overlay for scrollbars (*)') self.ubuntu_overlay = wal.Checkbox(self, txt, config.ubuntu_scrollbar_overlay) self.pack(self.ubuntu_overlay, align_center=False) if not config.is_mac(): self.pack(wal.HPanel(self), expand=True, fill=True) txt = _('(*) - These options require application restart') self.pack(wal.Label(grid, txt, fontsize=-1), align_center=False) self.built = True
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, art_size=wal.SIZE_16, 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) self.layout()
def build(self): vpanel = wal.VPanel(self) grid = wal.GridPanel(vpanel, rows=4, cols=2, hgap=25, vgap=7) txt = _('Language (*):') grid.pack(wal.Label(grid, txt)) self.lang = wal.Combolist(grid, items=LANGS) index = 0 if config.language == 'system' \ else LANGS.index(config.language) self.lang.set_active(index) grid.pack(self.lang, fill=True) txt = _('UI style (*):') grid.pack(wal.Label(grid, txt)) items = [_('Classic'), _('Tabbed')] self.ui_style = wal.Combolist(grid, items=items) self.ui_style.set_active(config.ui_style) grid.pack(self.ui_style, fill=True) txt = _('Tab style:') grid.pack(wal.Label(grid, txt)) items = [ _('Rectangular tabs'), _('Rounded tabs'), _('Flat tabs'), _('Trapezoidal tabs') ] self.tab_style = wal.Combolist(grid, items=items) index = config.tab_style if config.tab_style < len(items) else 0 self.tab_style.set_active(index) grid.pack(self.tab_style, fill=True) txt = _('Show quick access buttons') grid.pack(wal.Label(grid, txt)) self.stub_buttons = wal.Switch(grid, config.show_stub_buttons) grid.pack(self.stub_buttons) vpanel.pack(grid, align_center=False, padding_all=10) # --------------------------------- int_vp = wal.VPanel(vpanel) vpanel.pack(int_vp, fill=True, padding_all=5) if not wal.IS_MAC and wal.IS_WX2: txt = _('Use overlay for spinbox widgets (*)') self.spin_overlay = wal.Checkbox(int_vp, txt, config.spin_overlay) int_vp.pack(self.spin_overlay, align_center=False) if wal.IS_GTK and wal.IS_WX2: txt = _('Separate spin in spinbox widgets (*)') self.spin_sep = wal.Checkbox(int_vp, txt, config.spin_sep) int_vp.pack(self.spin_sep, align_center=False) if wal.IS_UNITY: txt = _('Unity related features') int_vp.pack(wal.Label(int_vp, txt, fontsize=2, fontbold=True), start_padding=10) int_vp.pack(wal.HLine(int_vp), fill=True, padding=2) txt = _('Use Unity Global Menu (*)') self.ubuntu_gm = wal.Checkbox(int_vp, txt, config.ubuntu_global_menu) int_vp.pack(self.ubuntu_gm, align_center=False) txt = _('Allow overlay for scrollbars (*)') self.ubuntu_overlay = wal.Checkbox(int_vp, txt, config.ubuntu_scrollbar_overlay) int_vp.pack(self.ubuntu_overlay, align_center=False) self.pack(vpanel) self.pack((1, 1), expand=True) txt = _('(*) - Application restart is required to apply these options') self.pack(wal.Label(self, txt, fontsize=-1)) self.built = True
def __init__(self, parent, app, trafo=[] + sk2_const.NORMAL_TRAFO, onchange=None): self.app = app self.callback = onchange wal.VPanel.__init__(self, parent) self.pack(wal.Label(self, _('Transformation matrix:')), padding=5) grid = wal.GridPanel(self, 3, 5, 3, 1) # ---M11 grid.pack(wal.Label(grid, 'm11:')) self.m11 = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=0.01, onchange=self.changes, onenter=self.changes) grid.pack(self.m11) grid.pack((5, 5)) # ---M12 grid.pack(wal.Label(grid, 'm12:')) self.m12 = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=0.01, onchange=self.changes, onenter=self.changes) grid.pack(self.m12) # ---M21 grid.pack(wal.Label(grid, 'm21:')) self.m21 = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=0.01, onchange=self.changes, onenter=self.changes) grid.pack(self.m21) grid.pack((5, 5)) # ---M22 grid.pack(wal.Label(grid, 'm22:')) self.m22 = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=0.01, onchange=self.changes, onenter=self.changes) grid.pack(self.m22) # ---dx grid.pack(wal.Label(grid, 'dx:')) self.dx = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=0.01, onchange=self.changes, onenter=self.changes) grid.pack(self.dx) grid.pack((5, 5)) # ---dy grid.pack(wal.Label(grid, 'dy:')) self.dy = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=0.01, onchange=self.changes, onenter=self.changes) grid.pack(self.dy) self.pack(grid)
def __init__(self, parent, app, trafo=[] + sk2_const.NORMAL_TRAFO, transforms=[] + sk2_const.PATTERN_TRANSFORMS, onchange=None): self.app = app self.callback = onchange wal.VPanel.__init__(self, parent) grid = wal.GridPanel(self, 3, 7, 3, 2) # ---Origin X txt = _('Horizontal origin shift') grid.pack(get_bmp(grid, icons.PD_PATTERN_ORIGIN_X, txt)) self.origin_x = UnitSpin(app, grid, can_be_negative=True, onchange=self.changes, onenter=self.changes) grid.pack(self.origin_x) grid.pack(StaticUnitLabel(app, grid)) grid.pack((10, 5)) # ---Origin Y txt = _('Vertical origin shift') grid.pack(get_bmp(grid, icons.PD_PATTERN_ORIGIN_Y, txt)) self.origin_y = UnitSpin(app, grid, can_be_negative=True, onchange=self.changes, onenter=self.changes) grid.pack(self.origin_y) grid.pack(StaticUnitLabel(app, grid)) # ---Scale X txt = _('Scale horizontally') grid.pack(get_bmp(grid, icons.PD_PATTERN_SCALE_X, txt)) self.scale_x = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=1.0, onchange=self.changes, onenter=self.changes) grid.pack(self.scale_x) grid.pack(wal.Label(grid, '%')) grid.pack((10, 5)) # ---Scale Y txt = _('Scale vertically') grid.pack(get_bmp(grid, icons.PD_PATTERN_SCALE_Y, txt)) self.scale_y = wal.FloatSpin(grid, range_val=(-1000000.0, 1000000.0), step=1.0, onchange=self.changes, onenter=self.changes) grid.pack(self.scale_y) grid.pack(wal.Label(grid, '%')) # ---Shear X txt = _('Shear horizontally') grid.pack(get_bmp(grid, icons.PD_PATTERN_SHEAR_X, txt)) self.shear_x = wal.FloatSpin(grid, range_val=(0.0, 85.0), step=1.0, onchange=self.changes, onenter=self.changes) grid.pack(self.shear_x) grid.pack(wal.Label(grid, u'°')) grid.pack((10, 5)) # ---Shear X txt = _('Shear vertically') grid.pack(get_bmp(grid, icons.PD_PATTERN_SHEAR_Y, txt)) self.shear_y = wal.FloatSpin(grid, range_val=(0.0, 85.0), step=1.0, onchange=self.changes, onenter=self.changes) grid.pack(self.shear_y) grid.pack(wal.Label(grid, u'°')) self.pack(grid) # ---Rotate rot_panel = wal.HPanel(self) txt = _('Rotate pattern') rot_panel.pack(get_bmp(rot_panel, icons.PD_PATTERN_ROTATE, txt)) self.rotate = wal.FloatSpin(rot_panel, range_val=(-360.0, 360.0), step=1.0, onchange=self.changes, onenter=self.changes) rot_panel.pack(self.rotate, padding=3) rot_panel.pack(wal.Label(rot_panel, u'°')) self.pack(rot_panel, padding=5) self.set_trafo(trafo, transforms)
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 real print area and vertical/horirizontal " "printing shift just print calibration page on the A4/Letter sheet." ) 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, _('Cannot found installed printers!'))) self.pack((10, 10)) self.pack((5, 5), expand=True) self.built = True