Class: Wx::PRT::Printer
- Defined in:
- lib/wx/doc/gen/prt/printer.rb,
lib/wx/doc/prt/printer.rb
Overview
This class represents the Windows or PostScript printer, and is the vehicle through which printing may be launched by an application.
Printing can also be achieved through using of lower functions and classes, but this and associated classes provide a more convenient and general method of printing.
Category: Printing Framework
Class Method Summary collapse
-
.get_last_error ⇒ Wx::PrinterError
Return last error.
Instance Method Summary collapse
-
#create_abort_window(parent, printout) ⇒ Wx::PRT::PrintAbortDialog
Creates the default printing abort window, with a cancel button.
-
#get_abort ⇒ Boolean
(also: #abort)
Returns true if the user has aborted the print job.
-
#get_print_dialog_data ⇒ Wx::PRT::PrintDialogData
(also: #print_dialog_data)
Returns (a copy of) the print dialog data of the printer.
-
#initialize(data = nil) ⇒ Wx::PRT::Printer
constructor
Constructor.
-
#print(parent, printout, prompt = true) ⇒ Boolean
Starts the printing process.
-
#print_dialog(parent) ⇒ Wx::DC
Invokes the print dialog.
-
#report_error(parent, printout, message) ⇒ void
Default error-reporting function.
-
#set_print_dialog_data(prt_data) ⇒ void
(also: #print_dialog_data=)
Updates the print dialog data for the printer.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(data = nil) ⇒ Wx::PRT::Printer
Constructor.
Pass an optional pointer to a block of print dialog data, which will be copied to the printer object’s local data.
33 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 33 def initialize(data=nil) end |
Class Method Details
.get_last_error ⇒ Wx::PrinterError
Return last error.
Valid after calling #print, #print_dialog or Wx::PRT::PrintPreview#print. These functions set last error to Wx::PRT::PrinterError::PRINTER_NO_ERROR if no error happened. Returned value is one of the following:
Wx::PRT::PrinterError::PRINTER_NO_ERROR No error happened.
Wx::PRT::PrinterError::PRINTER_CANCELLED The user cancelled printing.
Wx::PRT::PrinterError::PRINTER_ERROR There was an error during printing.
91 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 91 def self.get_last_error; end |
Instance Method Details
#create_abort_window(parent, printout) ⇒ Wx::PRT::PrintAbortDialog
Creates the default printing abort window, with a cancel button.
39 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 39 def create_abort_window(parent, printout) end |
#get_abort ⇒ Boolean Also known as: abort
Returns true if the user has aborted the print job.
43 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 43 def get_abort; end |
#get_print_dialog_data ⇒ Wx::PRT::PrintDialogData Also known as: print_dialog_data
Returns (a copy of) the print dialog data of the printer.
16 |
# File 'lib/wx/doc/prt/printer.rb', line 16 def get_print_dialog_data; end |
#print(parent, printout, prompt = true) ⇒ Boolean
Starts the printing process.
Provide a parent window, a user-defined Wx::PRT::Printout object which controls the printing of a document, and whether the print dialog should be invoked first. #print could return false if there was a problem initializing the printer device context (current printer not set, for example) or the user cancelled printing. Call get_last_error to get detailed information about the kind of the error.
54 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 54 def print(parent, printout, prompt=true) end |
#print_dialog(parent) ⇒ Wx::DC
Invokes the print dialog.
If successful (the user did not press Cancel and no error occurred), a suitable device context will be returned; otherwise NULL is returned; call get_last_error to get detailed information about the kind of the error.
The application must delete this device context to avoid a memory leak.
67 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 67 def print_dialog(parent) end |
#report_error(parent, printout, message) ⇒ void
This method returns an undefined value.
Default error-reporting function.
74 |
# File 'lib/wx/doc/gen/prt/printer.rb', line 74 def report_error(parent, printout, ) end |
#set_print_dialog_data(prt_data) ⇒ void Also known as: print_dialog_data=
This method returns an undefined value.
Updates the print dialog data for the printer.
22 |
# File 'lib/wx/doc/prt/printer.rb', line 22 def set_print_dialog_data(prt_data); end |