def __init__(self, parent, cms_ref, color=None, onchange=None): wal.VPanel.__init__(self, parent) self.cms = cms_ref if color: self.color = color else: self.color = [uc2const.COLOR_GRAY, [0.0, ], 1.0, ''] if onchange: self.callback = onchange grid = wal.GridPanel(self, 2, 3, 3, 5) grid.pack(wal.Label(grid, 'L:')) self.color_slider = ColoredSlider(grid, size=40, onchange=self.on_slider_change) grid.pack(self.color_slider) self.color_spin = wal.IntSpin(grid, range_val=(0, 255), onchange=self.on_change, onenter=self.on_change) grid.pack(self.color_spin) grid.pack(wal.Label(grid, 'A:')) self.alpha_slider = ColoredAlphaSlider(grid, size=40, onchange=self.on_slider_change) grid.pack(self.alpha_slider) self.alpha_spin = wal.IntSpin(grid, range_val=(0, 255), onchange=self.on_change, onenter=self.on_change) grid.pack(self.alpha_spin) self.pack(grid)
def build(self): grid = wal.GridPanel(self, rows=5, cols=2, hgap=5, vgap=5) grid.add_growable_col(1) grid.pack(wal.Label(grid, _('Text filler:'))) self.filler = wal.Entry(grid, config.font_preview_text) grid.pack(self.filler, fill=True) grid.pack(wal.Label(grid, _('Font size:'))) self.fontsize = wal.IntSpin(grid, config.font_preview_size, (5, 50)) grid.pack(self.fontsize) grid.pack(wal.Label(grid, _('Font color:'))) self.fontcolor = wal.ColorButton(grid, config.font_preview_color) grid.pack(self.fontcolor) grid.pack(wal.Label(grid, _('Selection color:'))) color = self.fontcolor.val255_to_dec(wal.UI_COLORS['selected_text_bg']) self.selcolor = wal.ColorButton(grid, color) grid.pack(self.selcolor) grid.pack(wal.Label(grid, _('Preview width:'))) self.pwidth = wal.IntSpin(grid, config.font_preview_width, (100, 1000)) grid.pack(self.pwidth) self.pack(grid, align_center=False, fill=True, padding=5) 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) txt = _('Make backup on document save') self.backup = wal.Checkbox(self, txt, config.make_backup) self.pack(self.backup, align_center=False) txt = _('Make backup on export') self.expbackup = wal.Checkbox(self, txt, config.make_export_backup) self.pack(self.expbackup, align_center=False) 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) 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 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): wal.MainWindow.__init__(self) self.set_size(SIZE) self.spin = wal.IntSpin(self, 5, (0, 20), width=3, onchange=self.onchange, onenter=self.onenter) self.pack(self.spin) self.spin1 = wal.IntSpin(self, 5, (0, 20), onchange=self.onchange1) self.pack(self.spin1)
def build(self): table = wal.GridPanel(self, rows=8, cols=2, hgap=25, vgap=7) txt = _('New document on start') table.pack(wal.Label(table, txt)) self.newdoc = wal.Switch(table, config.new_doc_on_start) table.pack(self.newdoc) txt = _('Backup on document save') table.pack(wal.Label(table, txt)) self.backup = wal.Switch(table, config.make_backup) table.pack(self.backup) txt = _('Backup on export') table.pack(wal.Label(table, txt)) self.expbackup = wal.Switch(table, config.make_export_backup) table.pack(self.expbackup) txt = _('Make font cache on start') table.pack(wal.Label(table, txt)) self.fcache = wal.Switch(table, config.make_font_cache_on_start) table.pack(self.fcache) txt = _('Run as server') table.pack(wal.Label(table, txt)) self.server = wal.Switch(table, config.app_server) table.pack(self.server) txt = _('History log size:') table.pack(wal.Label(table, txt)) self.hist_size = wal.IntSpin(table, config.history_size, (10, 1000)) table.pack(self.hist_size) txt = _('History menu size:') table.pack(wal.Label(table, txt)) self.hist_menu_size = wal.IntSpin( table, config.history_list_size, (5, 20)) table.pack(self.hist_menu_size) txt = _('Logging level (*):') table.pack(wal.Label(table, txt)) self.log_level = wal.Combolist(table, items=LEVELS) self.log_level.set_active(LEVELS.index(config.log_level)) table.pack(self.log_level) self.pack(table) 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 build(self): bmp = get_bmp(self, icons.CTX_POLYGON_NUM, _('Number of polygon angles')) self.add(bmp, 0, LEFT | CENTER, 2) self.num_spin = wal.IntSpin(self, 5, (3, 1000), onchange=self.changes) self.add(self.num_spin, 0, LEFT | CENTER, 2)
def build(self): bmp = get_bmp(self, icons.CTX_POLYGON_NUM, _('Number of polygon angles')) self.pack(bmp, padding=2) self.num_spin = wal.IntSpin(self, 5, (3, 1000), onchange=self.changes) self.pack(self.num_spin, padding=2)
def build(self): grid = wal.GridPanel(self.panel, rows=4, cols=2, vgap=5, hgap=5) self.panel.pack(grid, expand=True, fill=True, padding_all=5) grid.add_growable_col(1) grid.add_growable_row(3) grid.pack(wal.Label(grid, _('Palette name:'))) self.name_entry = wal.Entry(grid, value=self.palette.model.name) grid.pack(self.name_entry, fill=True) grid.pack(wal.Label(grid, _('Palette source:'))) self.source_entry = wal.Entry(grid, value=self.palette.model.source) grid.pack(self.source_entry, fill=True) grid.pack(wal.Label(grid, _('Columns:'))) cols = self.palette.model.columns size = len(self.palette.model.colors) self.cols = wal.IntSpin(grid, value=cols, range_val=(1, size), spin_overlay=config.spin_overlay) grid.pack(self.cols) grid.pack(wal.Label(grid, _('Description:'))) self.comm_entry = wal.Entry(grid, value=self.palette.model.comments, multiline=True) grid.pack(self.comm_entry, fill=True)
def __init__(self, parent, cms, color=None, onchange=None): wal.VPanel.__init__(self, parent) self.cms = cms if color: self.color = color else: self.color = [uc2const.COLOR_RGB, [0.0, 0.0, 0.0], 1.0, ''] if onchange: self.callback = onchange self.color_sliders = [] self.color_spins = [] grid = wal.GridPanel(self, 4, 3, 3, 5) labels = ['R:', 'G:', 'B:'] for item in labels: grid.pack(wal.Label(grid, item)) self.color_sliders.append( ColoredSlider(grid, onchange=self.on_slider_change)) grid.pack(self.color_sliders[-1]) self.color_spins.append( wal.IntSpin(grid, range_val=(0, 255), width=4, onchange=self.on_change, onenter=self.on_change)) grid.pack(self.color_spins[-1]) grid.pack(wal.Label(grid, 'A:')) self.alpha_slider = ColoredAlphaSlider(grid, onchange=self.on_slider_change) grid.pack(self.alpha_slider) self.alpha_spin = wal.IntSpin(grid, range_val=(0, 255), width=4, onchange=self.on_change, onenter=self.on_change) grid.pack(self.alpha_spin) self.pack(grid) self.pack(wal.HPanel(self), fill=True, expand=True) html_panel = wal.HPanel(self) html_panel.pack(wal.Label(html_panel, _('HTML notation:')), padding=5) self.html = HexField(html_panel, onchange=self.on_hex_change) html_panel.pack(self.html) self.pack(html_panel, padding=5)
def build(self): bmp = get_bmp(self, icons.CTX_POLYGON_CFG, _('Number of angles for newly created polygon')) self.add(bmp, 0, LEFT | CENTER, 2) self.num_spin = wal.IntSpin(self, config.default_polygon_num, (3, 1000), onchange=self.changes) self.add(self.num_spin, 0, LEFT | CENTER, 2)
def build(self): label = wal.Label(self, _("Delete page No.:")) self.pack(label, padding=5) pages = self.presenter.get_pages() page_num = len(pages) current_page = pages.index(self.presenter.active_page) + 1 self.spin = wal.IntSpin(self, current_page, (1, page_num)) self.pack(self.spin, padding=5)
def build(self): panel = wal.HPanel(self) self.pack(panel, padding=5, fill=True) label = wal.Label(panel, _("Insert:")) panel.pack(label, padding=5) self.page_num = wal.IntSpin(panel, 1, (1, 100)) panel.pack(self.page_num, padding=5) label = wal.Label(panel, _("page(s)")) panel.pack(label, padding=5) panel = wal.HPanel(self) self.pack(panel, padding=5) margin = 0 if not wal.IS_GTK: margin = 3 panel.pack((5, 5)) vpanel = wal.VPanel(panel) panel.pack(vpanel, padding=5) self.before_opt = wal.Radiobutton(vpanel, _('Before'), group=True) vpanel.pack(self.before_opt, padding=margin, fill=True) self.after_opt = wal.Radiobutton(vpanel, _('After')) vpanel.pack(self.after_opt, padding=margin, fill=True) self.after_opt.set_value(True) label = wal.Label(panel, _("page No.:")) panel.pack(label, padding=5) pages = self.presenter.get_pages() page_num = len(pages) current_page = pages.index(self.presenter.active_page) + 1 self.page_index = wal.IntSpin(panel, current_page, (1, page_num)) panel.pack(self.page_index, padding=5)
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)
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)
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
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): 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=4, 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) grid.pack(wal.Label(grid, _('Logging level (*):'))) self.log_level = wal.Combolist(grid, items=LEVELS) self.log_level.set_active(LEVELS.index(config.log_level)) grid.pack(self.log_level) grid.pack(wal.Label(grid, _('Language (*):'))) 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) 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