SIMPOL Documentation

wxprintout

Description

A wxprintout object represents a document that is intended to be printed and which can also be sent to the print preview window. The printout object can be used to host strings and bitmaps. The printout also has a ring of pages that are to be printed. Positioning is absolute relative to the left top corner of the paper and is in micrometers (millionths of a meter). Each page contains the bitmaps and strings that are specific to that page, plus a reference to a template. The template can also contain strings and bitmaps, but these would only be part of the template if they do not change and are used on every page where the template is also used. The template also contains the graphical items, and the text and bitmap items. The text and bitmap items describe the physical representation of the text or bitmap, including position, alignment, scaling for bitmaps, and font, text color, and background color for text items. They also contain a reference to the host of the source of their string or bitmap, plus the name of that source. This design allows the layout of items on a page to be part of a template, but the data that changes is associated with the page, and information that is consistent with each template is associated with itself, while information that is used across the printout or in more than one template is associated with the printout object.

[Warning]Warning

On Windows, when printing from the print preview if a different printer is selected from the default printer and does not have the same paper size and resolution as the default printer, the resulting print out may not be correct in its proportions. Printing directly to printer, or printing always to the default printer from print preview or to the printer passed in the dialogdata parameter resolves the problem.

Type Tags

wxprintdatacontainer

Object Value

Properties

PropertyTypeDescription
_type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided.
__type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property.
firstbitmapwxprintbitmap Specifies the first wxprintbitmap object in the ring of bitmaps that contain the data associated with the printout. This is .nul if there are no bitmaps associated with the printout.
firstpagewxprintpage Specifies the first wxprintpage object in the ring of pages that make up the printout. This is .nul if there are no pages associated with the printout.
firststringwxprintstring Specifies the first wxprintstring object in the ring of strings that contain the data associated with the printout. This is .nul if there are no strings associated with the printout.
typetype Specifies the wxprintout type object.

Methods

addbitmap()

Description

Adds a wxprintbitmap object to the ring of printbitmaps. An object of this type is added to hold the content for a wxprintbitmapitem object that is placed in a template. If the content is the same everywhere in the printout, then the bitmap should be added to the printout, if it is the same on each page that uses a specific template, then it should be added to the template, and if it is specific to a given page, then it should be added to the page.

[Note]Note

The name of any item: page, string, bitmap, etc. that can be accessed using the member operator must be unique across all rings associated with an object. For example in the case of a printout object, the same name cannot be assigned to a page and also to a string or a bitmap. The same name can also not be given to two items in the same ring.

Prototype

wxprintoutvar.addbitmap ( wxbitmap bitmap, string name, wxprintbitmap next )

Parameters
ParameterDefault valueType nameDescription
bitmap.nulwxbitmap The content for this wxprintbitmap object.
name.nulstring The name of the wxprintbitmap object. This value is used to link the object with the wxprintbitmapitem that will use it to provide the content for an item on a printed page.
next.nulwxprintbitmap This determines where in the ring of bitmaps the new bitmap will be placed. The new bitmap will be created so that the bitmap specified as next will be after the new bitmap in the ring. If the next bitmap is the current firstbitmap for the printout, then the new bitmap will become the new firstbitmap. If there are already some bitmaps in the printout and next is specified to be .nul then the next bitmap will be the current firstbitmap for the printout, but the new bitmap will not become a new firstbitmap (i.e. it becomes a 'last' bitmap).

addpage()

Description

Adds a page to the printout.

[Note]Note

The name of any item: page, string, bitmap, etc. that can be accessed using the member operator must be unique across all rings associated with an object. For example in the case of a printout object, the same name cannot be assigned to a page and also to a string or a bitmap. The same name can also not be given to two items in the same ring.

Prototype

wxprintoutvar.addpage ( wxprintpagetemplate template, string name, wxprintpage next )

Parameters
ParameterDefault valueType nameDescription
templateNonewxprintpagetemplate The wxprintpagetemplate object that is used to specify the items that will be printed on the page.
nameNonestring The name of the page object.
next.nulwxprintpage This determines where in the ring of pages the new page will be placed. The new page will be created so that the page specified as next will be after the new page in the ring. If the next page is the current firstpage for the printout, then the new page will become the new firstpage. If there are already some pages in the printout and next is specified to be .nul then the next page will be the current firstpage for the printout, but the new page will not become a new firstpage (i.e. it becomes a 'last' page).

addstring()

Description

Adds a wxprintstring object to the ring of printstrings. An object of this type is added to hold the content for a wxprinttextitem object that is placed in a template. If the content is the same everywhere in the printout, then the string should be added to the printout, if it is the same on each page that uses a specific template, then it should be added to the template, and if it is specific to a given page, then it should be added to the page.

[Note]Note

The name of any item: page, string, bitmap, etc. that can be accessed using the member operator must be unique across all rings associated with an object. For example in the case of a printout object, the same name cannot be assigned to a page and also to a string or a bitmap. The same name can also not be given to two items in the same ring.

Prototype

wxprintoutvar.addstring ( string string, string name, wxprintstring next )

Parameters
ParameterDefault valueType nameDescription
string""string The content for this wxprintstring object.
name.nulstring The name of the wxprintstring object. This value is used to link the object with the wxprinttextitem that will use it to provide the content for an item on a printed page.
next.nulwxprintstring This determines where in the ring of strings the new string will be placed. The new string will be created so that the string specified as next will be after the new string in the ring. If the next string is the current firststring for the printout, then the new string will become the new firststring. If there are already some strings in the printout and next is specified to be .nul then the next string will be the current firststring for the printout, but the new string will not become a new firststring (i.e. it becomes a 'last' string).

print()

Description

Sends the printout to the printer.

Prototype

wxprintoutvar.print ( string title, boolean dialog, string dialogdata, integer error )

Parameters
ParameterDefault valueType nameDescription
titleNonestring The title of the printout. This is used on some operating systems or by some drivers for the title of the print job in the printer queue, or as the default file name when printing to file.
dialog.trueboolean Decides whether or not to show the printer dialog prior to printing.
dialogdataNonestring The parameters used to preset the printer dialog.
error.nulinteger Specifies an object which is used to output any error code generated during printing of the wxprintout object. If error is not specified or is .nul then any error that occurs during object creation will halt the program. If an error object is specified and an error occurs during execution of the operation then the error code is output into that object.

startprintpreview()

Description

Sends the printout to the print preview window, from where it can also be printed.

Prototype

wxprintoutvar.startprintpreview ( string title, string dialogdata, integer error )

Parameters
ParameterDefault valueType nameDescription
titleNonestring The title of the printout. This is used on some operating systems or by some drivers for the title of the print job in the printer queue, or as the default file name when printing to file.
dialogdataNonestring The parameters used to preset the printer dialog.
error.nulinteger Specifies an object which is used to output any error code generated during showing or printing of the wxprintout object. If error is not specified or is .nul then any error that occurs during object creation will halt the program. If an error object is specified and an error occurs during execution of the operation then the error code is output into that object.

wxprintout!

Get

If there is a page of the name following the member operator, then the page is returned, otherwise if there is a string of that name, then the string is returned, otherwise if there is a bitmap of that name the bitmap is returned, and if none of these are true an error will occur.

Set

Attempting to assign a reference or a value to a wxprintout object using the ! operator is not supported.