1wxPrintPreview(3)          Erlang Module Definition          wxPrintPreview(3)
2
3
4

NAME

6       wxPrintPreview - Functions for wxPrintPreview class
7

DESCRIPTION

9       Objects  of  this class manage the print preview process. The object is
10       passed a wxPrintout object, and the  wxPrintPreview  object  itself  is
11       passed  to a wxPreviewFrame object. Previewing is started by initializ‐
12       ing and showing the preview frame. Unlike  wxPrinter:print/4,  flow  of
13       control  returns  to  the  application  immediately  after the frame is
14       shown.
15
16       Note: The preview shown is only exact on Windows. On  other  platforms,
17       the  wxDC  used for preview is different from what is used for printing
18       and the results may be significantly different, depending on how is the
19       output created. In particular, printing code relying on wxDC:getTextEx‐
20       tent/3  heavily  (for  example,  wxHtmlEasyPrinting  and  other  wxHTML
21       classes  do) is affected. It is recommended to use native preview func‐
22       tionality on platforms that offer it (macOS, GTK+).
23
24       See: Overview printing, wxPrinterDC (not implemented in wx), wxPrintDi‐
25       alog,  wxPrintout, wxPrinter, wxPreviewCanvas, wxPreviewControlBar, wx‐
26       PreviewFrame
27
28       wxWidgets docs: wxPrintPreview
29

DATA TYPES

31       wxPrintPreview() = wx:wx_object()
32

EXPORTS

34       new(Printout) -> wxPrintPreview()
35
36              Types:
37
38                 Printout = wxPrintout:wxPrintout()
39
40       new(Printout, Options :: [Option]) -> wxPrintPreview()
41
42              Types:
43
44                 Printout = wxPrintout:wxPrintout()
45                 Option =
46                     {printoutForPrinting, wxPrintout:wxPrintout()} |
47                     {data, wxPrintDialogData:wxPrintDialogData()}
48
49              Constructor.
50
51              Pass a printout object, an optional printout object to  be  used
52              for  actual  printing,  and  the address of an optional block of
53              printer data, which will be copied to the print preview object's
54              print data.
55
56              If  printoutForPrinting is non-NULL, a "Print..." button will be
57              placed on the preview frame so that the user can print  directly
58              from the preview interface.
59
60              Remark:  Do not explicitly delete the printout objects once this
61              constructor has been called, since they will be deleted  in  the
62              wxPrintPreview  destructor.  The same does not apply to the data
63              argument.
64
65              Use isOk/1 to check whether the wxPrintPreview object  was  cre‐
66              ated correctly.
67
68       new(Printout, PrintoutForPrinting, Data) -> wxPrintPreview()
69
70              Types:
71
72                 Printout = PrintoutForPrinting = wxPrintout:wxPrintout()
73                 Data = wxPrintData:wxPrintData()
74
75       destroy(This :: wxPrintPreview()) -> ok
76
77              Destructor.
78
79              Deletes  both print preview objects, so do not destroy these ob‐
80              jects in your application.
81
82       getCanvas(This) -> wxPreviewCanvas:wxPreviewCanvas()
83
84              Types:
85
86                 This = wxPrintPreview()
87
88              Gets the preview window used for displaying  the  print  preview
89              image.
90
91       getCurrentPage(This) -> integer()
92
93              Types:
94
95                 This = wxPrintPreview()
96
97              Gets the page currently being previewed.
98
99       getFrame(This) -> wxFrame:wxFrame()
100
101              Types:
102
103                 This = wxPrintPreview()
104
105              Gets  the frame used for displaying the print preview canvas and
106              control bar.
107
108       getMaxPage(This) -> integer()
109
110              Types:
111
112                 This = wxPrintPreview()
113
114              Returns the maximum page number.
115
116       getMinPage(This) -> integer()
117
118              Types:
119
120                 This = wxPrintPreview()
121
122              Returns the minimum page number.
123
124       getPrintout(This) -> wxPrintout:wxPrintout()
125
126              Types:
127
128                 This = wxPrintPreview()
129
130              Gets the preview printout object associated with the wxPrintPre‐
131              view object.
132
133       getPrintoutForPrinting(This) -> wxPrintout:wxPrintout()
134
135              Types:
136
137                 This = wxPrintPreview()
138
139              Gets the printout object to be used for printing from within the
140              preview interface, or NULL if none exists.
141
142       isOk(This) -> boolean()
143
144              Types:
145
146                 This = wxPrintPreview()
147
148              Returns true if the wxPrintPreview is valid, false otherwise.
149
150              It could return false if there was a  problem  initializing  the
151              printer device context (current printer not set, for example).
152
153       paintPage(This, Canvas, Dc) -> boolean()
154
155              Types:
156
157                 This = wxPrintPreview()
158                 Canvas = wxPreviewCanvas:wxPreviewCanvas()
159                 Dc = wxDC:wxDC()
160
161              This refreshes the preview window with the preview image.
162
163              It must be called from the preview window's OnPaint member.
164
165              The implementation simply blits the preview bitmap onto the can‐
166              vas, creating a new preview bitmap if none exists.
167
168       print(This, Prompt) -> boolean()
169
170              Types:
171
172                 This = wxPrintPreview()
173                 Prompt = boolean()
174
175              Invokes the print process using  the  second  wxPrintout  object
176              supplied in the wxPrintPreview constructor.
177
178              Will  normally  be called by the Print... panel item on the pre‐
179              view frame's control bar.
180
181              Returns false in case of error -  call  wxPrinter:getLastError/0
182              to get detailed information about the kind of the error.
183
184       renderPage(This, PageNum) -> boolean()
185
186              Types:
187
188                 This = wxPrintPreview()
189                 PageNum = integer()
190
191              Renders a page into a wxMemoryDC.
192
193              Used internally by wxPrintPreview.
194
195       setCanvas(This, Window) -> ok
196
197              Types:
198
199                 This = wxPrintPreview()
200                 Window = wxPreviewCanvas:wxPreviewCanvas()
201
202              Sets  the window to be used for displaying the print preview im‐
203              age.
204
205       setCurrentPage(This, PageNum) -> boolean()
206
207              Types:
208
209                 This = wxPrintPreview()
210                 PageNum = integer()
211
212              Sets the current page to be previewed.
213
214       setFrame(This, Frame) -> ok
215
216              Types:
217
218                 This = wxPrintPreview()
219                 Frame = wxFrame:wxFrame()
220
221              Sets the frame to be used for displaying the print preview  can‐
222              vas and control bar.
223
224       setPrintout(This, Printout) -> ok
225
226              Types:
227
228                 This = wxPrintPreview()
229                 Printout = wxPrintout:wxPrintout()
230
231              Associates a printout object with the wxPrintPreview object.
232
233       setZoom(This, Percent) -> ok
234
235              Types:
236
237                 This = wxPrintPreview()
238                 Percent = integer()
239
240              Sets the percentage preview zoom, and refreshes the preview can‐
241              vas accordingly.
242
243
244
245wxWidgets team.                    wx 2.1.4                  wxPrintPreview(3)
Impressum