SIMPOL Documentation

wxprinttextitem

Description

A wxprinttextitem object contains the description of where a specific string will be printed on a page as well as its characteristics: which font, which background color, which text color, horizontal and vertical alignment, etc. These are associated with a specific template which in turn is used by a page in a printout. The string used can come from the printout, the template, the actual page being printed, or be system generated, such as with "pagenumber".

Type Tags

None

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.
alignmentstring Shows the alignment of the text item within the rectangle that represents the boundaries of the item. The alignment is for both horizontal and vertical alignment. The string can be made up of two comma separated string values. The valid values are: "left", "right", "top", "bottom", "left,top", "right,bottom", "left,bottom", and "right,top". If a dimension is not present, such as with "left" by itself, then the other dimension will be centered.
backgroundrgbrgb Shows the background color of the text item.
backgroundvisibleboolean Indicates whether the background of the text item is visible (and will be rendered) or not.
contentnamestring Contains the name of the wxprintstring object that contains the actual content of the text item. If this is the empty string "" then nothing will be printed.
contentsourcestring Contains the name of the source for the wxprintstring object, either "printout", "template", "page", "system", or the empty string (""), in which case nothing will be printed.
fontwxfont This is a reference to the wxfont object that describes how the text in the text item is formatted.
heightinteger Specifies the height of the text item in micrometers.
leftinteger Specifies the position of the left edge of the text item in micrometers.
namestring The name of the wxprinttextitem object.
nextwxprinttextitem Specifies the next wxprinttextitem object in the ring of text items that make up the template.
templatewxprintpagetemplate Specifies the wxprintpagetemplate object to which this text item belongs.
textrgbrgb Shows the color of the text in the text item.
topinteger Specifies the position of the top edge of the text item in micrometers.
typetype Specifies the wxprinttextitem type object.
underbitmapsboolean Indicates whether the text item is in front of or behind the bitmap items. This property determines whether the text item appears above or below the bitmap items that have the same undergraphics setting. Text items that are on top of the graphics are (of course) on top of all text and bitmap items that are under the graphics, and text items that are under the graphics are always under all objects that are on top of the graphics.
undergraphicsboolean Indicates whether the text item is considered to be over the graphics items or under them in the z-order. It cannot be over some but under others. Either the text item is over all graphics items, or it is under all of them.
widthinteger Specifies the width of the text item in micrometers.

Methods

getcontent()

Description

This method retrieves the value of the text item from the associated string object. The page parameter is needed for items whose source is "system", "page" or "printout" as a text or bitmap item doesn't know what pages or printouts it is on and system items may differ on each page (in fact a template can be used for pages from many different printouts simultaneously). If the text item has a contentsource of "system" and a contentname of "pagenumber", then getcontent() returns a text representation of the page number from the printout of the page passed as the parameter.

Prototype

wxprinttextitemvar.getcontent ( wxprintpage page )

Parameters
ParameterDefault valueType nameDescription
page.nulwxprintpage The specific page from which to retrieve the text item.

setalignment()

Description

This method assigns both the horizontal and vertical alignment for the text item. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression. The string can be made up of two comma separated string values. The valid values are: "left", "right", "top", "bottom", "left,top", "right,bottom", "left,bottom", and "right,top". Providing two values for the same dimension of alignment is an error, such as "left,right". If an element is not supplied, it is assumed to be middle (in either dimension). Supplying an empty string would create an alignment both horizontally and vertically centered.

Prototype

wxprinttextitemvar.setalignment ( string alignment )

Parameters
ParameterDefault valueType nameDescription
alignmentThe current setting of the alignment propertystring The alignment string for both horizontal and vertical alignment for the text item.

setbackgroundrgb()

Description

Sets the background color of the text item. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression. It is an error to specify both the rgb argument and one or more of the red, green or blue arguments.

Prototype

wxprinttextitemvar.setbackgroundrgb ( integer rgb, integer red, integer green, integer blue )

Parameters
ParameterDefault valueType nameDescription
rgbThe current value of the backgroundrgb propertyinteger The new background color of the text item. It is inadvisable to specify any value for this argument which is not the value of an existing rgb object.
redThe current value of the backgroundrgb.red propertyinteger The red component in the new background color of the text item. This must be between 0 and 255 inclusive.
greenThe current value of the backgroundrgb.green propertyinteger The green component in the new background color of the text item. This must be between 0 and 255 inclusive.
blueThe current value of the backgroundrgb.blue propertyinteger The blue component in the new background color of the text item. This must be between 0 and 255 inclusive.

setbackgroundvisible()

Description

Sets the visibility of the text item background on or off. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxprinttextitemvar.setbackgroundvisible ( boolean backgroundvisible )

Parameters
ParameterDefault valueType nameDescription
backgroundvisibleThe current value of the backgroundvisible property boolean The desired visibility of the background of the text item.

setcontent()

Description

Sets the name of the contentsource and the contentname properties for the text item. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxprinttextitemvar.setcontent ( string contentsource, string contentname )

Parameters
ParameterDefault valueType nameDescription
contentsourceThe current value of the contentsource propertystring This must be one of: "printout", "template", "page", "system", or the empty string (""), in which case nothing will be printed.
contentnameThe current value of the contentname propertystring This is the name of the wxprintstring object that is used to provide the content for this text item when it is printed. If the "system" contentsource is used, then currently the only valid contentname is "pagenumber". This allows the page number to be retrieved for the current page in the printout. If the empty string ("") is assigned to this parameter then nothing will be printed.

setfont()

Description

Sets the font to be used for the text in the text item. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxprinttextitemvar.setfont ( wxfont font )

Parameters
ParameterDefault valueType nameDescription
fontThe current value of the font propertywxfont The wxfont object that will be used to format the text.

setname()

Description

Sets the name of the text item. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxprinttextitemvar.setname ( string name )

Parameters
ParameterDefault valueType nameDescription
nameNonestring

The new name for the text item.

[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.

setnext()

Description

Sets the position and z-order of the text item in the ring of text items. The first item in the ring is the lowest in the z-order.

Prototype

wxprinttextitemvar.setnext ( wxprinttextitem next )

Parameters
ParameterDefault valueType nameDescription
nextNonewxprinttextitem Calling the method with the value .nul sets a text item to be the last one in the ring (the one before wxprintpagetemplate.firsttextitem) and passing any other text item as the argument puts the target text item immediately before the one specified as the parameter.

setposition()

Description

Sets the size and/or position of the text item. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression.

Prototype

wxprinttextitemvar.setposition ( integer left, integer top, integer width, integer height )

Parameters
ParameterDefault valueType nameDescription
leftThe current value of the left propertyinteger The new position of the left side of the text item on the template.
topThe current value of the top propertyinteger The new position of the top edge of the text item on the template.
widthThe current value of the width propertyinteger The new width of the text item on the template.
heightThe current value of the height propertyinteger The new height of the text item on the template.

settextrgb()

Description

Sets the color of the text for the text item. The wxprinttextitem object itself is returned, to allow multiple setting methods to be put into one expression. It is an error to specify both the rgb argument and one or more of the red, green or blue arguments.

Prototype

wxprinttextitemvar.settextrgb ( integer rgb, integer red, integer green, integer blue )

Parameters
ParameterDefault valueType nameDescription
rgbThe current value of the textrgb propertyinteger The new color of the text for the text item. It is inadvisable to specify any value for this argument that is not the value of an existing rgb object.
redThe current value of the textrgb.red propertyinteger The red component in the new text color of the text item. This must be between 0 and 255 inclusive.
greenThe current value of the textrgb.green propertyinteger The green component in the new text color of the text item. This must be between 0 and 255 inclusive.
blueThe current value of the text.blue propertyinteger The blue component in the new text color of the text item. This must be between 0 and 255 inclusive.

setunders()

Description

Sets whether the text item appears above or below graphics and bitmaps.

Prototype

wxprinttextitemvar.setunders ( boolean undergraphics, boolean underbitmaps )

Parameters
ParameterDefault valueType nameDescription
undergraphicsThe current value of the undergraphics propertyboolean This decides whether text items are rendered as being underneath all objects of type wxgraphic on the template.
underbitmapsThe current value of the underbitmaps propertyboolean Decides whether the text item is in front or behind the bitmap items. This parameter determines whether the text item appears above or below the bitmap items that have the same undergraphics setting. Text items that are on top of the graphics are (of course) on top of all text and bitmap items that are under the graphics, and text items that are under the graphics are always under all objects that are on top of the graphics.