Exemplo n.º 1
0
    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()
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
def get_bmp(parent, icon_id, tooltip=''):
    bmp = wal.provider_get_bitmap(icon_id, wal.ART_OTHER, wal.DEF_SIZE)
    if bmp == wal.NullBitmap:
        return None
    sb = wal.Bitmap(parent, bmp)
    if tooltip:
        sb.SetToolTipString(tooltip)
    return sb
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    def __init__(self, parent):
        wal.HPanel.__init__(self, parent)
        icon = get_icon(icons.PD_ZOOM, size=wal.SIZE_16)
        self.pack(wal.Bitmap(self, icon, on_left_click=self.show_menu))

        self.label = wal.Label(self, '10000%', fontsize=FONTSIZE[0])
        self.label.set_min_width(70 if wal.IS_MAC else 55)
        self.label.set_tooltip(_('Zoom level'))
        self.pack(self.label, padding=2)

        self.pack(wal.PLine(self.panel), fill=True, padding=3)
        self.zoom_menu = ZoomMenu(parent.mw)
Exemplo n.º 6
0
    def __init__(self, parent, printer, app):
        self.app = app
        self.printer = printer
        wal.VPanel.__init__(self, parent)

        hpanel = wal.HPanel(self)
        icon_name = icons.PD_PRINTER_LASER
        if self.printer.is_color():
            icon_name = icons.PD_PRINTER_INKJET
        icon = get_icon(icon_name, size=wal.DEF_SIZE)
        hpanel.pack(wal.Bitmap(hpanel, icon), padding=10)

        self.prnmode_panel = PrintModePanel(hpanel, self.printer)
        hpanel.pack(self.prnmode_panel, fill=True, expand=True)

        self.pack(hpanel, fill=True)

        self.pack((5, 5))

        self.paper_panel = PaperPanel(self, self.printer, self.app)
        self.pack(self.paper_panel, fill=True)

        self.pack((5, 5))

        hpanel = wal.HPanel(self)
        self.orient_panel = OrientPanel(hpanel, self.printer, self.app)
        hpanel.pack(self.orient_panel, fill=True, expand=True)

        hpanel.pack((5, 5))

        self.margins_panel = MarginsPanel(hpanel, self.printer, self.app)
        hpanel.pack(self.margins_panel, fill=True, expand=True)

        self.pack(hpanel, fill=True, expand=True)

        text = _("Note: To adjust specific printer options "
                 "you could "
                 "use system configuration tools like 'system-config-printer'")

        label = wal.Label(self, text, fontsize=-2)
        if wal.IS_MSW:
            label.wrap(380)
        label.set_enable(False)
        self.pack(label, fill=True, padding_all=5, align_center=False)

        self.panels = [
            self.prnmode_panel, self.paper_panel, self.orient_panel,
            self.margins_panel
        ]
Exemplo n.º 7
0
    def __init__(self, parent, printer, app):
        self.app = app
        self.printer = printer
        wal.VPanel.__init__(self, parent)

        hpanel = wal.HPanel(self)
        icon = get_icon(icons.PD_PRINTER_PDF, size=wal.DEF_SIZE)
        hpanel.pack(wal.Bitmap(hpanel, icon), padding=5)

        self.prnmode_panel = GenModePanel(hpanel, self.printer)
        hpanel.pack(self.prnmode_panel, fill=True, expand=True)

        self.pack(hpanel, fill=True)

        self.page_panel = PagePanel(self, self.printer, self.app)
        self.pack(self.page_panel, fill=True)

        self.doc_info = DocInfoPanel(self, self.printer, self.app)
        self.pack(self.doc_info, fill=True, expand=True)

        self.panels = [self.prnmode_panel, self.page_panel, self.doc_info]
Exemplo n.º 8
0
    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)
Exemplo n.º 9
0
def get_bmp(parent, icon_id, tooltip=''):
	bmp = wx.ArtProvider.GetBitmap(icon_id, wx.ART_OTHER, const.DEF_SIZE)
	if bmp == wx.NullBitmap: return None
	sb = wal.Bitmap(parent, bmp)
	if tooltip: sb.SetToolTipString(tooltip)
	return sb