Class: Wx::HTML::HtmlEasyPrinting

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/html/html_easy_printing.rb

Overview

This class provides very simple interface to printing architecture.

It allows you to print HTML documents using only a few commands.

Note:

Do not create this class on the stack only. You should create an instance on app startup and use this instance for all printing operations. The reason is that this class stores various settings in it.

Category: Wx::HTML, Printing Framework

Requires:

  • USE_PRINTING_ARCHITECTURE
  • USE_HTML

Defined Under Namespace

Classes: PromptMode

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(name = ("PRINTING"), parentWindow = nil) ⇒ Wx::HTML::HtmlEasyPrinting

Constructor.

Parameters:

  • name (String) (defaults to: ("PRINTING"))

    Name of the printing object. Used by preview frames and setup dialogs.

  • parentWindow (Wx::Window) (defaults to: nil)

    pointer to the window that will own the preview frame and setup dialogs. May be NULL.



65
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 65

def initialize(name=("PRINTING"), parentWindow=nil) end

Instance Method Details

#get_nameWx::String Also known as: name

Returns the current name being used for preview frames and setup dialogs.

Returns:

  • (Wx::String)


69
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 69

def get_name; end

#get_page_setup_dataWx::PRT::PageSetupDialogData Also known as: page_setup_data

Returns a pointer to PRT::PageSetupDialogData instance used by this class.

You can set its parameters (via SetXXXX methods).



76
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 76

def get_page_setup_data; end

#get_parent_windowWx::Window Also known as: parent_window

Gets the parent window for dialogs.

Returns:



81
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 81

def get_parent_window; end

#get_print_dataWx::PRT::PrintData Also known as: print_data

Returns pointer to PRT::PrintData instance used by this class.

You can set its parameters (via SetXXXX methods).

Returns:



88
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 88

def get_print_data; end

#page_setupvoid

This method returns an undefined value.

Display page setup dialog and allows the user to modify settings.



93
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 93

def page_setup; end

#preview_file(htmlfile) ⇒ Boolean

Preview HTML file.

Returns false in case of error call PRT::Printer.get_last_error to get detailed information about the kind of the error.

Parameters:

  • htmlfile (String)

Returns:

  • (Boolean)


100
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 100

def preview_file(htmlfile) end

#preview_text(htmltext, basepath = ('')) ⇒ Boolean

Preview HTML text (not file!).

Returns false in case of error call PRT::Printer.get_last_error to get detailed information about the kind of the error.

Parameters:

  • htmltext (String)

    HTML text.

  • basepath (String) (defaults to: (''))

    base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.

Returns:

  • (Boolean)


108
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 108

def preview_text(htmltext, basepath=('')) end

Print HTML file.

Returns false in case of error call PRT::Printer.get_last_error to get detailed information about the kind of the error.

Parameters:

  • htmlfile (String)

Returns:

  • (Boolean)


115
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 115

def print_file(htmlfile) end

Print HTML text (not file!).

Returns false in case of error call PRT::Printer.get_last_error to get detailed information about the kind of the error.

Parameters:

  • htmltext (String)

    HTML text.

  • basepath (String) (defaults to: (''))

    base directory (html string would be stored there if it was in file). It is used to determine path for loading images, for example.

Returns:

  • (Boolean)


123
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 123

def print_text(htmltext, basepath=('')) end

#set_fonts(normal_face, fixed_face, sizes = nil) ⇒ void

This method returns an undefined value.

Sets fonts.

See Wx::HtmlDCRenderer::SetFonts for detailed description.

Parameters:

  • normal_face (String)
  • fixed_face (String)
  • sizes (Array(Integer,Integer,Integer,Integer,Integer,Integer,Integer), nil) (defaults to: nil)


132
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 132

def set_fonts(normal_face, fixed_face, sizes=nil) end

This method returns an undefined value.

Set page footer.

The following macros can be used inside it: @DATE@ is replaced by the current date in default format @PAGENUM@ is replaced by page number @PAGESCNT@ is replaced by total number of pages @TIME@ is replaced by the current time in default format @TITLE@ is replaced with the title of the document

Parameters:

  • footer (String)

    HTML text to be used as footer.

  • pg (Integer) (defaults to: Wx::HTML::PAGE_ALL)

    one of PAGE_ODD, PAGE_EVEN and PAGE_ALL constants.



157
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 157

def set_footer(footer, pg=Wx::HTML::PAGE_ALL) end

#set_header(header, pg = Wx::HTML::PAGE_ALL) ⇒ void Also known as: header=

This method returns an undefined value.

Set page header.

The following macros can be used inside it:

  • @DATE@ is replaced by the current date in default format

  • @PAGENUM@ is replaced by page number

  • @PAGESCNT@ is replaced by total number of pages

  • @TIME@ is replaced by the current time in default format

  • @TITLE@ is replaced with the title of the document

Parameters:

  • header (String)

    HTML text to be used as header.

  • pg (Integer) (defaults to: Wx::HTML::PAGE_ALL)

    one of PAGE_ODD, PAGE_EVEN and PAGE_ALL constants.



172
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 172

def set_header(header, pg=Wx::HTML::PAGE_ALL) end

#set_name(name) ⇒ void Also known as: name=

This method returns an undefined value.

Sets the name used for preview frames and setup dialogs.

Parameters:

  • name (String)


137
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 137

def set_name(name) end

#set_parent_window(window) ⇒ void Also known as: parent_window=

This method returns an undefined value.

Sets the parent window for dialogs.

Parameters:



178
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 178

def set_parent_window(window) end

#set_prompt_mode(promptMode) ⇒ void Also known as: prompt_mode=

This method returns an undefined value.

Enable or disable showing the dialog before printing.

The prompt mode determines the value of the prompt parameter passed to PRT::Printer#print when it is called by this class. Default prompt mode value is Prompt_Always.

Parameters:

  • promptMode (Wx::HtmlEasyPrinting::PromptMode)


187
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 187

def set_prompt_mode(promptMode) end

#set_standard_fonts(size = -1,, normal_face = (''), fixed_face = ('')) ⇒ void Also known as: standard_fonts=

This method returns an undefined value.

Sets default font sizes and/or default font size.

See Wx::HtmlDCRenderer::SetStandardFonts for detailed description.

Parameters:

  • size (Integer) (defaults to: -1,)
  • normal_face (String) (defaults to: (''))
  • fixed_face (String) (defaults to: (''))

See Also:



148
# File 'lib/wx/doc/gen/html/html_easy_printing.rb', line 148

def set_standard_fonts(size=-1, normal_face=(''), fixed_face=('')) end