Class: Wx::PRT::PrintPreview
- Defined in:
- lib/wx/doc/gen/prt/printer.rb
Overview
Objects of this class manage the print preview process.
The object is passed a Printout object, and the PrintPreview object itself is passed to a PreviewFrame object. Previewing is started by initializing and showing the preview frame. Unlike Wx::PRT::Printer#print, flow of control returns to the application immediately after the frame is shown.
The preview shown is only exact on Windows. On other platforms, the DC 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 DC#get_text_extent heavily (for example, HTML::HtmlEasyPrinting and other HTML classes do) is affected. It is recommended to use native preview functionality on platforms that offer it (macOS, GTK+).
Category: Printing Framework
Instance Method Summary collapse
-
#get_canvas ⇒ wxScrolledWindow
(also: #canvas)
Gets the preview window used for displaying the print preview image.
-
#get_current_page ⇒ Integer
(also: #current_page)
Gets the page currently being previewed.
-
#get_frame ⇒ Wx::Frame
(also: #frame)
Gets the frame used for displaying the print preview canvas and control bar.
-
#get_max_page ⇒ Integer
(also: #max_page)
Returns the maximum page number.
-
#get_min_page ⇒ Integer
(also: #min_page)
Returns the minimum page number.
-
#get_printout ⇒ Wx::PRT::Printout
(also: #printout)
Gets the preview printout object associated with the PrintPreview object.
-
#get_printout_for_printing ⇒ Wx::PRT::Printout
(also: #printout_for_printing)
Gets the printout object to be used for printing from within the preview interface, or NULL if none exists.
-
#get_zoom ⇒ Integer
(also: #zoom)
Gets the current percentage zoom level of the preview canvas.
-
#initialize(*args) ⇒ PrintPreview
constructor
A new instance of PrintPreview.
-
#is_ok ⇒ Boolean
(also: #ok?)
Returns true if the PrintPreview is valid, false otherwise.
-
#print(prompt) ⇒ Boolean
Invokes the print process using the second Printout object supplied in the PrintPreview constructor.
-
#render_page(pageNum) ⇒ Boolean
Renders a page into a MemoryDC.
-
#set_current_page(pageNum) ⇒ Boolean
(also: #current_page=)
Sets the current page to be previewed.
-
#set_frame(frame) ⇒ void
(also: #frame=)
Sets the frame to be used for displaying the print preview canvas and control bar.
-
#set_printout(printout) ⇒ void
(also: #printout=)
Associates a printout object with the PrintPreview object.
-
#set_zoom(percent) ⇒ void
(also: #zoom=)
Sets the percentage preview zoom, and refreshes the preview canvas accordingly.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(printout, printoutForPrinting = nil, data = nil) ⇒ Wx::PRT::PrintPreview #initialize(printout, printoutForPrinting, data) ⇒ Wx::PRT::PrintPreview
Returns a new instance of PrintPreview.
401 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 401 def initialize(*args) end |
Instance Method Details
#get_canvas ⇒ wxScrolledWindow Also known as: canvas
Gets the preview window used for displaying the print preview image.
405 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 405 def get_canvas; end |
#get_current_page ⇒ Integer Also known as: current_page
Gets the page currently being previewed.
410 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 410 def get_current_page; end |
#get_frame ⇒ Wx::Frame Also known as: frame
Gets the frame used for displaying the print preview canvas and control bar.
415 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 415 def get_frame; end |
#get_max_page ⇒ Integer Also known as: max_page
Returns the maximum page number.
420 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 420 def get_max_page; end |
#get_min_page ⇒ Integer Also known as: min_page
Returns the minimum page number.
425 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 425 def get_min_page; end |
#get_printout ⇒ Wx::PRT::Printout Also known as: printout
Gets the preview printout object associated with the Wx::PRT::PrintPreview object.
430 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 430 def get_printout; end |
#get_printout_for_printing ⇒ Wx::PRT::Printout Also known as: printout_for_printing
Gets the printout object to be used for printing from within the preview interface, or NULL if none exists.
435 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 435 def get_printout_for_printing; end |
#get_zoom ⇒ Integer Also known as: zoom
Gets the current percentage zoom level of the preview canvas.
443 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 443 def get_zoom; end |
#is_ok ⇒ Boolean Also known as: ok?
Returns true if the Wx::PRT::PrintPreview is valid, false otherwise.
It could return false if there was a problem initializing the printer device context (current printer not set, for example).
450 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 450 def is_ok; end |
#print(prompt) ⇒ Boolean
Invokes the print process using the second Wx::PRT::Printout object supplied in the Wx::PRT::PrintPreview constructor.
Will normally be called by the Print… panel item on the preview frame’s control bar. Returns false in case of error call Wx::PRT::Printer.get_last_error to get detailed information about the kind of the error.
459 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 459 def print(prompt) end |
#render_page(pageNum) ⇒ Boolean
Renders a page into a MemoryDC.
Used internally by Wx::PRT::PrintPreview.
466 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 466 def render_page(pageNum) end |
#set_current_page(pageNum) ⇒ Boolean Also known as: current_page=
Sets the current page to be previewed.
471 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 471 def set_current_page(pageNum) end |
#set_frame(frame) ⇒ void Also known as: frame=
This method returns an undefined value.
Sets the frame to be used for displaying the print preview canvas and control bar.
477 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 477 def set_frame(frame) end |
#set_printout(printout) ⇒ void Also known as: printout=
This method returns an undefined value.
Associates a printout object with the Wx::PRT::PrintPreview object.
483 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 483 def set_printout(printout) end |
#set_zoom(percent) ⇒ void Also known as: zoom=
This method returns an undefined value.
Sets the percentage preview zoom, and refreshes the preview canvas accordingly.
492 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 492 def set_zoom(percent) end |