File: printing.txt

package info (click to toggle)
python-wpy 0.53-0.1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 832 kB
  • ctags: 1,991
  • sloc: python: 8,624; makefile: 57; sh: 24
file content (47 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Printing is performed from the CScrollView class.  These are the attributes:

CScrollView Data Attributes:

wpyPrintMaxPage
	The maximum number of pages in the document.  You must set this
	sometime, or printing will stop after one page.


CScrollView Methods:

These are called in this order:
  OnPreparePrinting(self)
  OnBeginPrinting(self, DC)
      OnPrepareDC(self, DC, pagenum)		For each page.
      OnPrint(self, DC, pagenum)		For each page.
  OnEndPrinting(self, DC)

OnPreparePrinting(self)
	This is called before the print dialog box is displayed.  Define
	this and set the view attribute self.wpyPrintMaxPage to set the
	maximum page number in the dialog box.  Otherwise a default value
	is shown.  If you know wpyPrintMaxPage, set it here.

OnBeginPrinting(self, DC)
	Called before printing starts.  Use this to select drawing tools
	into the DC before printing starts.  You can also set the number
	of pages as in OnPreparePrinting() if this depends on the DC.

OnEndPrinting(self, DC)
	Called after printing is complete.

OnPrepareDC(self, DC, pagenum)
	Called before OnPrint() is called for each page of the document.
	Pagenum is the page being printed 1, 2, 3....
	Sometimes you may not know the length of the document in advance,
	for example, when printing lines from a file or records from a
	database.  To stop printing, override this method and return
	zero to stop printing.

OnPrint(self, DC, pagenum)
	Called for each page to be printed.
	Pagenum is the page being printed 1, 2, 3....
	Return zero to stop printing.
	This method is just like OnDraw() except output is sent to the
	printer instead of the screen, and similar issues apply.  If you
	have no OnPrint() method, OnDraw() is called instead.