summaryrefslogtreecommitdiff
path: root/lib/wx/doc/src/wxPrintPreview.xml
blob: 56080e60a0b0b817df64501e322e21726b1acc3b (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxPrintPreview</title>
</header>
<module>wxPrintPreview</module>
<modulesummary>Functions for wxPrintPreview class</modulesummary>
<description><p>Objects of this class manage the print preview process. The object is passed a <seeerl marker="wxPrintout"><c>wxPrintout</c></seeerl> object, and the <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl> object itself is passed to a <seeerl marker="wxPreviewFrame"><c>wxPreviewFrame</c></seeerl> object. Previewing is started by initializing and showing the preview frame. Unlike <seemfa marker="wxPrinter#print/4"><c>wxPrinter:print/4</c></seemfa>, flow of control returns to the application immediately after the frame is shown.
      </p><p>Note: The preview shown is only exact on Windows. On other platforms, the <seeerl marker="wxDC"><c>wxDC</c></seeerl> used for preview is different from what is used for printing and the results may be significantly different, depending on how is the output created. In particular, printing code relying on <seemfa marker="wxDC#getTextExtent/3"><c>wxDC:getTextExtent/3</c></seemfa> heavily (for example, <seeerl marker="wxHtmlEasyPrinting"><c>wxHtmlEasyPrinting</c></seeerl> and other wxHTML classes do) is affected. It is recommended to use native preview functionality on platforms that offer it (macOS, GTK+).
      </p><p>See: <url href="https://docs.wxwidgets.org/3.1/overview_printing.html#overview_printing">Overview printing</url>, <c>wxPrinterDC</c> (not implemented in wx), <seeerl marker="wxPrintDialog"><c>wxPrintDialog</c></seeerl>, <seeerl marker="wxPrintout"><c>wxPrintout</c></seeerl>, <seeerl marker="wxPrinter"><c>wxPrinter</c></seeerl>, <seeerl marker="wxPreviewCanvas"><c>wxPreviewCanvas</c></seeerl>, <seeerl marker="wxPreviewControlBar"><c>wxPreviewControlBar</c></seeerl>, <seeerl marker="wxPreviewFrame"><c>wxPreviewFrame</c></seeerl>
      </p>
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_print_preview.html">wxPrintPreview</url></p>
  </description>
<datatypes><datatype><name name="wxPrintPreview"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>new/2</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="2" clause_i="1" since=""/>
    <fsummary>Constructor. </fsummary>
    <desc><p>Constructor. 
      </p><p>Pass a printout object, an optional printout object to be used for actual printing, and the address of an optional block of printer data, which will be copied to the print preview object's print data.
      </p><p>If <c>printoutForPrinting</c> is non-NULL, a <c>"Print..."</c> button will be placed on the preview frame so that the user can print directly from the preview interface.
      </p><p>Remark: Do not explicitly delete the printout objects once this constructor has been called, since they will be deleted in the <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl> destructor. The same does not apply to the <c>data</c> argument.
      </p><p> Use <seemfa marker="#isOk/1"><c>isOk/1</c></seemfa> to check whether the <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl> object was created correctly. 
      </p></desc>
  </func>
  
  <func>
    <name name="new" arity="3" clause_i="1" since=""/>
    <fsummary/>
    <desc/>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor. </fsummary>
    <desc><p>Destructor. 
      </p><p>Deletes both print preview objects, so do not destroy these objects in your application. 
      </p></desc>
  </func>
  
  <func>
    <name name="getCanvas" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the preview window used for displaying the print preview image. </fsummary>
    <desc><p>Gets the preview window used for displaying the print preview image. 
      </p></desc>
  </func>
  
  <func>
    <name name="getCurrentPage" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the page currently being previewed. </fsummary>
    <desc><p>Gets the page currently being previewed. 
      </p></desc>
  </func>
  
  <func>
    <name name="getFrame" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the frame used for displaying the print preview canvas and control bar. </fsummary>
    <desc><p>Gets the frame used for displaying the print preview canvas and control bar. 
      </p></desc>
  </func>
  
  <func>
    <name name="getMaxPage" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the maximum page number. </fsummary>
    <desc><p>Returns the maximum page number. 
      </p></desc>
  </func>
  
  <func>
    <name name="getMinPage" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the minimum page number. </fsummary>
    <desc><p>Returns the minimum page number. 
      </p></desc>
  </func>
  
  <func>
    <name name="getPrintout" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the preview printout object associated with the <c>wxPrintPreview</c> object. </fsummary>
    <desc><p>Gets the preview printout object associated with the <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl> object. 
      </p></desc>
  </func>
  
  <func>
    <name name="getPrintoutForPrinting" arity="1" clause_i="1" since=""/>
    <fsummary>Gets the printout object to be used for printing from within the preview interface, or NULL if none exists. </fsummary>
    <desc><p>Gets the printout object to be used for printing from within the preview interface, or NULL if none exists. 
      </p></desc>
  </func>
  
  <func>
    <name name="isOk" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the <c>wxPrintPreview</c> is valid, false otherwise. </fsummary>
    <desc><p>Returns true if the <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl> is valid, false otherwise. 
      </p><p>It could return false if there was a problem initializing the printer device context (current printer not set, for example). 
      </p></desc>
  </func>
  
  <func>
    <name name="paintPage" arity="3" clause_i="1" since=""/>
    <fsummary>This refreshes the preview window with the preview image. </fsummary>
    <desc><p>This refreshes the preview window with the preview image. 
      </p><p>It must be called from the preview window's OnPaint member.
      </p><p>The implementation simply blits the preview bitmap onto the canvas, creating a new preview bitmap if none exists. 
      </p></desc>
  </func>
  
  <func>
    <name name="print" arity="2" clause_i="1" since=""/>
    <fsummary>Invokes the print process using the second <c>wxPrintout</c> object supplied in the <c>wxPrintPreview</c> constructor. </fsummary>
    <desc><p>Invokes the print process using the second <seeerl marker="wxPrintout"><c>wxPrintout</c></seeerl> object supplied in the <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl> constructor. 
      </p><p>Will normally be called by the <c>Print</c>... panel item on the preview frame's control bar.
      </p><p>Returns false in case of error - call <seemfa marker="wxPrinter#getLastError/0"><c>wxPrinter:getLastError/0</c></seemfa> to get detailed information about the kind of the error. 
      </p></desc>
  </func>
  
  <func>
    <name name="renderPage" arity="2" clause_i="1" since=""/>
    <fsummary>Renders a page into a <c>wxMemoryDC</c>. </fsummary>
    <desc><p>Renders a page into a <seeerl marker="wxMemoryDC"><c>wxMemoryDC</c></seeerl>. 
      </p><p>Used internally by <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl>. 
      </p></desc>
  </func>
  
  <func>
    <name name="setCanvas" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the window to be used for displaying the print preview image. </fsummary>
    <desc><p>Sets the window to be used for displaying the print preview image. 
      </p></desc>
  </func>
  
  <func>
    <name name="setCurrentPage" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the current page to be previewed. </fsummary>
    <desc><p>Sets the current page to be previewed. 
      </p></desc>
  </func>
  
  <func>
    <name name="setFrame" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the frame to be used for displaying the print preview canvas and control bar. </fsummary>
    <desc><p>Sets the frame to be used for displaying the print preview canvas and control bar. 
      </p></desc>
  </func>
  
  <func>
    <name name="setPrintout" arity="2" clause_i="1" since=""/>
    <fsummary>Associates a printout object with the <c>wxPrintPreview</c> object. </fsummary>
    <desc><p>Associates a printout object with the <seeerl marker="wxPrintPreview"><c>wxPrintPreview</c></seeerl> object. 
      </p></desc>
  </func>
  
  <func>
    <name name="setZoom" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the percentage preview zoom, and refreshes the preview canvas accordingly. </fsummary>
    <desc><p>Sets the percentage preview zoom, and refreshes the preview canvas accordingly. 
      </p></desc>
  </func>
  </funcs>
</erlref>