def build(self): grid = wal.GridPanel(self, 1, 3, 2, 2) grid.pack(wal.Label(grid, _('Angle:'))) self.angle = AngleSpin(grid, val_range=(-360.0, 360.0), check_focus=True) grid.pack(self.angle) grid.pack(wal.Label(grid, _('degrees'))) self.pack(grid, align_center=False, padding=5) self.pack(wal.Label(grid, _('Center:')), align_center=False, padding=5) grid = wal.GridPanel(self, 2, 3, 2, 2) grid.pack(get_bmp(grid, make_artid('h-sign'))) self.h_spin = UnitSpin(self.app, grid, can_be_negative=True) grid.pack(self.h_spin) grid.pack(UnitLabel(self.app, grid)) grid.pack(get_bmp(grid, make_artid('v-sign'))) self.v_spin = UnitSpin(self.app, grid, can_be_negative=True) grid.pack(self.v_spin) grid.pack(UnitLabel(self.app, grid)) self.pack(grid, align_center=False, padding_all=5) self.center = wal.Checkbox(self, _('Relative center'), onclick=self.on_click) self.pack(self.center, align_center=False, padding=5) self.active_widgets = [self.angle, self.center] self.on_click()
def build(self): grid = wal.GridPanel(self, 2, 5, 2, 2) grid.pack(get_bmp(grid, make_artid('h-sign'))) self.h_spin = wal.FloatSpin(grid, 100.0, (0.01, 10000.0), 1.0, onchange=self.on_reset) grid.pack(self.h_spin) grid.pack(wal.Label(grid, '%')) grid.pack((5, 5)) self.h_mirror = wal.ImageToggleButton(grid, False, make_artid('h-mirror'), tooltip=_('Horizontal mirror'), flat=False) grid.pack(self.h_mirror) grid.pack(get_bmp(grid, make_artid('v-sign'))) self.v_spin = wal.FloatSpin(grid, 100.0, (0.01, 10000.0), 1.0, onchange=self.height_changed) grid.pack(self.v_spin) grid.pack(wal.Label(grid, '%')) grid.pack((5, 5)) self.v_mirror = wal.ImageToggleButton(grid, False, make_artid('v-mirror'), tooltip=_('Vertical mirror'), flat=False) grid.pack(self.v_mirror) self.pack(grid, align_center=False, padding=5) self.proportion = wal.Checkbox(self, _('Keep ratio'), True) self.pack(self.proportion, align_center=False, padding=5) self.active_widgets = [self.h_spin, self.h_mirror, self.v_spin, self.v_mirror, self.proportion]
def build(self): grid = wal.GridPanel(self, 2, 3, 2, 2) grid.pack(get_bmp(grid, make_artid('h-sign'))) self.h_spin = UnitSpin(self.app, grid, can_be_negative=True, onchange=self.on_reset) grid.pack(self.h_spin) grid.pack(UnitLabel(self.app, grid)) grid.pack(get_bmp(grid, make_artid('v-sign'))) self.v_spin = UnitSpin(self.app, grid, can_be_negative=True, onchange=self.on_reset) grid.pack(self.v_spin) grid.pack(UnitLabel(self.app, grid)) self.pack(grid, align_center=False, padding=5) self.abs_pos = wal.Checkbox(self, _('Absolute position'), onclick=self.update) self.pack(self.abs_pos, align_center=False, padding=5) self.active_widgets = [self.h_spin, self.v_spin, self.abs_pos]
def build(self): grid = wal.GridPanel(self, 1, 3, 2, 2) grid.pack(wal.Label(grid, _('Angle:'))) self.angle = AngleSpin(grid, val_range=(-360.0, 360.0), check_focus=True) grid.pack(self.angle) grid.pack(wal.Label(grid, u'°')) self.pack(grid, align_center=False, padding=5) self.pack(wal.Label(grid, _('Center:')), align_center=False, padding=5) grid = wal.GridPanel(self, 2, 3, 2, 2) grid.pack(get_bmp(grid, make_artid('h-sign'))) self.h_spin = UnitSpin(self.app, grid, can_be_negative=True) grid.pack(self.h_spin) grid.pack(UnitLabel(self.app, grid)) grid.pack(get_bmp(grid, make_artid('v-sign'))) self.v_spin = UnitSpin(self.app, grid, can_be_negative=True) grid.pack(self.v_spin) grid.pack(UnitLabel(self.app, grid)) self.pack(grid, align_center=False, padding_all=5) self.center = wal.Checkbox(self, _('Relative center'), onclick=self.on_click) self.pack(self.center, align_center=False, padding=5) self.active_widgets = [self.angle, self.center] self.on_click()
def build(self): bmp = get_bmp(self, icons.CTX_OBJECT_JUMP, _('Default object jump')) self.add(bmp, 0, LEFT | CENTER, 2) self.jump_spin = UnitSpin(self.app, self, onenter=self.user_changes) self.jump_spin.set_point_value(config.obj_jump) self.add(self.jump_spin, 0, LEFT | CENTER, 2)
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): bmp = get_bmp(self, icons.CTX_ROUNDED_RECT, _('Rounded rectangle')) self.add(bmp, 0, LEFT | CENTER, 2) self.slider = Slider(self, 0, (0, 100), onchange=self.slider_changes, on_final_change=self.slider_final_changes) self.add(self.slider, 0, LEFT | CENTER, 2) self.num_spin = FloatSpin(self, 0, (0.0, 100.0), 1.0, 0, width=3, onchange=self.changes, spin_overlay=config.spin_overlay) self.add(self.num_spin, 0, LEFT | CENTER, 2) self.switch = RectAngleSwitch(self, onchange=self.switch_changed) self.add(self.switch, 0, LEFT | CENTER, 3) self.switch.hide() self.keep_ratio = RatioToggle(self, onchange=self.lock_changed) self.add(self.keep_ratio, 0, LEFT | CENTER, 3)
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, mw): if not config.statusbar_fontsize: FONTSIZE[0] = wal.get_system_fontsize() 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) self.mouse_info.hide() self.snap_monitor = SnapMonitor(self.mw.app, self) self.pack(self.snap_monitor) self.page_info = PageMonitor(self.mw.app, self) self.pack(self.page_info) 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)
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 __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): 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): 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): bmp = get_bmp(self, icons.CTX_POLYGON_NUM, _("Number of polygon angles")) self.add(bmp, 0, LEFT | CENTER, 2) self.num_spin = FloatSpin( self, 5, (3.0, 1000.0), 1.0, 0, width=3, onchange=self.changes, spin_overlay=config.spin_overlay ) self.add(self.num_spin, 0, LEFT | CENTER, 2)
def build(self): bmp = get_bmp(self, icons.CTX_OBJECT_RESIZE, _('Selection size')) self.pack(bmp, padding=2) self.pack((2, 2)) self.width_spin = UnitSpin(self.app, self, onchange=self.w_changes) self.pack(self.width_spin, padding=2) self.pack(get_bmp(self, icons.CTX_W_ON_H), padding=1) self.height_spin = UnitSpin(self.app, self, onchange=self.h_changes) self.pack(self.height_spin, padding=2) self.pack((2, 2)) self.keep_ratio = RatioToggle(self) self.pack(self.keep_ratio, padding=2)
def build(self): grid = wal.GridPanel(self, 2, 3, 2, 2) grid.pack(get_bmp(grid, make_artid('h-sign'))) self.h_spin = UnitSpin(self.app, grid, onchange=self.on_reset) grid.pack(self.h_spin) grid.pack(UnitLabel(self.app, grid)) grid.pack(get_bmp(grid, make_artid('v-sign'))) self.v_spin = UnitSpin(self.app, grid, onchange=self.height_changed) grid.pack(self.v_spin) grid.pack(UnitLabel(self.app, grid)) self.pack(grid, align_center=False, padding=5) self.proportion = wal.Checkbox(self, _('Keep ratio'), True) self.pack(self.proportion, align_center=False, padding=5) self.active_widgets = [self.h_spin, self.v_spin, self.proportion]
def build(self): bmp = get_bmp(self, icons.CTX_UNITS, _('Document units')) self.pack(bmp, padding=2) self.pack((2, 2)) names = [unit_full_names[item] for item in unit_names] self.combo = Combolist(self, items=names, onchange=self.changed) self.pack(self.combo, padding=2)
def build(self): bmp = get_bmp(self, icons.CTX_OBJECT_RESIZE, _('Selection size')) self.add(bmp, 0, LEFT | CENTER, 2) self.add((2, 2)) self.width_spin = UnitSpin(self.app, self, onchange=self.w_changes) self.add(self.width_spin, 0, LEFT | CENTER, 2) self.add(get_bmp(self, icons.CTX_W_ON_H), 0, LEFT | CENTER, 1) self.height_spin = UnitSpin(self.app, self, onchange=self.h_changes) self.add(self.height_spin, 0, LEFT | CENTER, 2) self.add((2, 2)) self.keep_ratio = RatioToggle(self) self.add(self.keep_ratio, 0, LEFT | CENTER, 2)
def build(self): bmp = get_bmp(self, icons.CTX_UNITS, _('Document units')) self.add(bmp, 0, LEFT | CENTER, 2) self.add((2, 2)) names = [unit_full_names[item] for item in unit_names] self.combo = Combolist(self, items=names, onchange=self.changed) self.add(self.combo, 0, LEFT | CENTER, 2)
def build(self): grid = wal.GridPanel(self, 3, 3, 2, 2) grid.pack(get_bmp(grid, make_artid('h-sign'))) self.h_shear = AngleSpin(grid, val_range=(-89.0, 89.0), check_focus=True) grid.pack(self.h_shear) grid.pack(wal.Label(grid, _('degrees'))) grid.pack(get_bmp(grid, make_artid('v-sign'))) self.v_shear = AngleSpin(grid, val_range=(-89.0, 89.0), check_focus=True) grid.pack(self.v_shear) grid.pack(wal.Label(grid, _('degrees'))) self.pack(grid, align_center=False, padding=5) self.active_widgets = [self.h_shear, self.v_shear]
def build(self): bmp = get_bmp(self, icons.CTX_UNITS, _('Document units')) self.add(bmp, 0, LEFT | CENTER, 2) self.add((2, 2)) names = [] for item in unit_names: names.append(unit_full_names[item]) self.combo = Combolist(self, items=names, onchange=self.changed) self.add(self.combo, 0, LEFT | CENTER, 2)
def build(self): bmp = get_bmp(self, icons.CTX_OBJECT_JUMP, _('Default object jump')) self.pack(bmp, padding=2) self.jump_spin = UnitSpin(self.app, self, onenter=self.user_changes, onchange=self.user_changes) self.jump_spin.set_point_value(config.obj_jump) self.pack(self.jump_spin, padding=2)
def __init__(self, app, parent): self.app = app wal.HPanel.__init__(self, parent) self.pack(get_bmp(self.panel, icons.PD_MOUSE_MONITOR), padding_all=3) self.pointer_txt = wal.Label(self.panel, text=' ', fontsize=FONTSIZE[0]) self.pointer_txt.set_min_width(130 if wal.IS_MAC else 100) self.pack(self.pointer_txt) self.pack(wal.PLine(self.panel), fill=True, padding=3) events.connect(events.MOUSE_STATUS, self.set_value) events.connect(events.NO_DOCS, self.hide_monitor) events.connect(events.DOC_CHANGED, self.doc_changed)
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 = FloatSpin(self, 5, (3.0, 1000.0), 1.0, 0, width=3, onchange=self.changes) self.add(self.num_spin, 0, LEFT | CENTER, 2)
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 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 = FloatSpin(self, config.default_polygon_num, (3.0, 1000.0), 1.0, 0, width=3, onchange=self.changes, spin_overlay=config.spin_overlay) self.add(self.num_spin, 0, LEFT | CENTER, 2)
def build(self): bmp = get_bmp(self, icons.CTX_ROTATE, _('Rotate selection')) self.add(bmp, 0, LEFT | CENTER, 2) self.angle_spin = AngleSpin(self, onenter=self.apply_changes) self.add(self.angle_spin, 0, LEFT | CENTER, 2) self.add((2, 2)) rot_left = ActionButton(self, self.actions[pdids.ID_ROTATE_LEFT]) self.add(rot_left, 0, LEFT | CENTER) rot_right = ActionButton(self, self.actions[pdids.ID_ROTATE_RIGHT]) self.add(rot_right, 0, LEFT | CENTER)
def build(self): bmp = get_bmp(self, icons.CTX_ROTATE, _('Rotate selection')) self.pack(bmp, padding=2) self.angle_spin = AngleSpin(self, onenter=self.apply_changes) self.pack(self.angle_spin, padding=2) self.pack((2, 2)) rot_left = ActionButton(self, self.actions[pdids.ID_ROTATE_LEFT]) self.pack(rot_left) rot_right = ActionButton(self, self.actions[pdids.ID_ROTATE_RIGHT]) self.pack(rot_right)
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)
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 = FloatSpin( self, config.default_polygon_num, (3.0, 1000.0), 1.0, 0, width=3, onchange=self.changes, spin_overlay=config.spin_overlay, ) self.add(self.num_spin, 0, LEFT | CENTER, 2)
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, app, parent): wal.VPanel.__init__(self, parent, border=True) color = const.lighter_color(const.UI_COLORS['bg'], 0.9) self.set_bg(color) panel = wal.HPanel(self) panel.set_bg(color) panel.pack(get_bmp(panel, icons.SK1_ICON32), padding=5) data = app.appdata p = wal.VPanel(panel) p.set_bg(color) p.pack(wal.Label(p, data.app_name, True, 3), fill=True) txt = ('%s: %s %s') % (_('Version'), data.version, data.revision) p.pack(wal.Label(p, txt), fill=True) panel.pack(p) self.pack(panel, expand=True, fill=True, padding_all=3)
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)
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)
def build(self): self.formats = [ _('Custom'), ] + PAGE_FORMAT_NAMES self.combo = Combolist(self, items=self.formats, onchange=self.combo_changed) self.add(self.combo, 0, LEFT | CENTER, 2) self.add((3, 3)) self.width_spin = UnitSpin(self.app, self, onchange=self.width_spin_changed) self.add(self.width_spin, 0, LEFT | CENTER, 2) self.add(get_bmp(self, icons.CTX_W_ON_H), 0, LEFT | CENTER, 1) self.height_spin = UnitSpin(self.app, self, onchange=self.height_spin_changed) self.add(self.height_spin, 0, LEFT | CENTER, 2) self.add((2, 2)) self.portrait = ImageToggleButton(self, True, icons.CTX_PAGE_PORTRAIT, onchange=self.portrait_toggled, tooltip=ORIENTS_NAMES[0]) self.add(self.portrait, 0, LEFT | CENTER, 2) self.landscape = ImageToggleButton(self, False, icons.CTX_PAGE_LANDSCAPE, onchange=self.landscape_toggled, tooltip=ORIENTS_NAMES[1]) self.add(self.landscape, 0, LEFT | CENTER, 2) self.width_spin.set_enable(False) self.height_spin.set_enable(False)
def __init__(self, parent, prefpanel): CmsTab.__init__(self, parent, prefpanel) txt = _('Enable Color Management') panel = wal.VPanel(self) hp = wal.HPanel(panel) hp.pack(wal.Label(hp, txt)) hp.pack((1, 1), expand=True) self.cms_check = wal.Switch(hp, config.cms_use, onclick=self.activate_cms) hp.pack(self.cms_check, end_padding=1) panel.pack(hp, fill=True, padding_all=5) 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, fill=True, expand=True) txt = _('Note: If Color Management is disabled, ' 'color values will be inaccurate.') label = wal.Label(panel, txt, fontsize=-1) panel.pack(label, fill=True, padding_all=5) self.pack(panel, fill=True, expand=True)
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)
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
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, width=5, 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, width=5, 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, width=5, 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, width=5, 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, width=5, 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.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)