def __init__(self, parent, printer): self.printer = printer wal.LabeledPanel.__init__(self, parent, _('Print mode')) grid = wal.GridPanel(self, 2, 2, 5, 5) self.mono_opt = wal.Radiobutton(grid, _('Monochrome'), group=True, onclick=self.update) icon = get_icon(icons.PD_PRINTMODE_MONO, size=wal.DEF_SIZE) self.mono_bmp = wal.Bitmap(grid, icon) grid.pack(self.mono_bmp) grid.pack(self.mono_opt) self.color_opt = wal.Radiobutton(grid, _('Color'), onclick=self.update) icon = get_icon(icons.PD_PRINTMODE_COLOR, size=wal.DEF_SIZE) self.color_bmp = wal.Bitmap(grid, icon) grid.pack(self.color_bmp) grid.pack(self.color_opt) self.color_opt.set_value(True) self.pack(grid, padding_all=10, align_center=False) hpanel = wal.HPanel(self) self.cs_lbl = wal.Label(hpanel, _('Color space:')) hpanel.pack(self.cs_lbl, padding=5) self.cs_combo = wal.Combolist(hpanel, items=CS) hpanel.pack(self.cs_combo) self.pack(hpanel) self.pack((5, 5)) self.set_data()
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(self): grid = wal.GridPanel(self.cont, 8, 1, 5, 15) grid.add_growable_col(0) self.all_opt = wal.Radiobutton(grid, _('All'), group=True, onclick=self.update) self.sel_opt = wal.Radiobutton(grid, _('Selection'), onclick=self.update) self.cpage_opt = wal.Radiobutton(grid, _('Current page'), onclick=self.update) self.pages_opt = wal.Radiobutton(grid, _('Pages:'), onclick=self.update) self.pages_entry = wal.Entry(grid, '1', onchange=self.pages_changed) grid.pack(self.all_opt) grid.pack(self.sel_opt) grid.pack(self.cpage_opt) grid.pack(self.pages_opt) grid.pack(self.pages_entry, fill=True) title = _('Enter page numbers or page ranges.') title += '\n' + _('For example: 1,2,5-6') grid.pack(wal.Label(self, title, fontsize=-1)) self.cont.pack(grid, fill=True, padding_all=5) self.pages_entry.set_enable(False) self.all_opt.set_value(True) if not self.printout.is_selection(): self.sel_opt.set_enable(False) if not self.printout.get_num_pages() > 1: self.cpage_opt.set_enable(False) self.pages_opt.set_enable(False)
def __init__(self): wal.MainWindow.__init__(self) self.set_size(SIZE) self.radio1 = wal.Radiobutton(self, 'Radiobutton 1', onclick=self.on_click, group=True) self.pack(self.radio1) self.radio2 = wal.Radiobutton(self, 'Radiobutton 2') self.pack(self.radio2) self.radio3 = wal.Radiobutton(self, 'Radiobutton 3', onclick=self.on_click3) self.pack(self.radio3)
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.FloatSpin(panel, 1, (1, 100), 1, 0, width=5, spin_overlay=config.spin_overlay) 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.FloatSpin(panel, current_page, (1, page_num), 1, 0, width=5, spin_overlay=config.spin_overlay) panel.pack(self.page_index, padding=5)
def __init__(self, parent, printer, app): self.app = app self.printer = printer wal.LabeledPanel.__init__(self, parent, _('Document page')) grid = wal.GridPanel(self, 3, 2, 3, 3) grid.add_growable_col(1) grid.pack(wal.Label(grid, _('Page size:'))) self.size_combo = wal.Combolist(grid, onchange=self.on_change) grid.pack(self.size_combo, fill=True) grid.pack(wal.Label(grid, _('Width:'))) hpanel = wal.HPanel(grid) self.wspin = StaticUnitSpin(self.app, hpanel) hpanel.pack(self.wspin) hpanel.pack((5, 5)) hpanel.pack(wal.Label(grid, _('Height:')), padding=5) self.hspin = StaticUnitSpin(self.app, hpanel) hpanel.pack(self.hspin) hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5) grid.pack(hpanel) grid.pack(wal.Label(grid, _('Orientation:'))) hpanel = wal.HPanel(grid) self.port_opt = wal.Radiobutton(hpanel, uc2const.ORIENTS_NAMES[0], group=True) self.land_opt = wal.Radiobutton(hpanel, uc2const.ORIENTS_NAMES[1]) hpanel.pack(self.port_opt) hpanel.pack((15, 5)) hpanel.pack(self.land_opt) grid.pack(hpanel) self.pack(grid, fill=True, expand=True, padding_all=7) self.set_data()
def build(self): grid = wal.GridPanel(self.cont, 2, 3, 5, 5) self.mono_opt = wal.Radiobutton(grid, _('Monochrome'), group=True, onclick=self.update) icon = get_icon(icons.PD_PRINTMODE_MONO, size=wal.DEF_SIZE) self.mono_bmp = wal.Bitmap(grid, icon) grid.pack(SPACER) grid.pack(self.mono_bmp) grid.pack(self.mono_opt) self.color_opt = wal.Radiobutton(grid, _('Color'), onclick=self.update) icon = get_icon(icons.PD_PRINTMODE_COLOR, size=wal.DEF_SIZE) self.color_bmp = wal.Bitmap(grid, icon) grid.pack(SPACER) grid.pack(self.color_bmp) grid.pack(self.color_opt) self.cont.pack(grid, align_center=False)