QScintilla/Printer.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
11 from PyQt4.QtGui import * 11 from PyQt4.QtGui import *
12 from PyQt4.Qsci import QsciPrinter 12 from PyQt4.Qsci import QsciPrinter
13 13
14 import Preferences 14 import Preferences
15 15
16
16 class Printer(QsciPrinter): 17 class Printer(QsciPrinter):
17 """ 18 """
18 Class implementing the QextScintillaPrinter with a header. 19 Class implementing the QextScintillaPrinter with a header.
19 """ 20 """
20 def __init__(self, mode = QPrinter.ScreenResolution): 21 def __init__(self, mode=QPrinter.ScreenResolution):
21 """ 22 """
22 Constructor 23 Constructor
23 24
24 @param mode mode of the printer (QPrinter.PrinterMode) 25 @param mode mode of the printer (QPrinter.PrinterMode)
25 """ 26 """
48 @param area the drawing area (QRect) 49 @param area the drawing area (QRect)
49 @param pagenr the page number (int) 50 @param pagenr the page number (int)
50 """ 51 """
51 fn = self.docName() 52 fn = self.docName()
52 53
53 header = QApplication.translate('Printer', 54 header = QApplication.translate('Printer',
54 '{0} - Printed on {1}, {2} - Page {3}')\ 55 '{0} - Printed on {1}, {2} - Page {3}')\
55 .format(fn, self.date, self.time, pagenr) 56 .format(fn, self.date, self.time, pagenr)
56 57
57 painter.save() 58 painter.save()
58 painter.setFont(self.headerFont) # set our header font 59 painter.setFont(self.headerFont) # set our header font

eric ide

mercurial