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
Property | Type | Description |
---|---|---|
_ | 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. |
alignment | string |
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.
|
backgroundrgb | rgb | Shows the background color of the text item. |
backgroundvisible | boolean | Indicates whether the background of the text item is visible (and will be rendered) or not. |
contentname | string |
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.
|
contentsource | string |
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.
|
font | wxfont | This is a reference to the wxfont object that describes how the text in the text item is formatted. |
height | integer | Specifies the height of the text item in micrometers. |
left | integer | Specifies the position of the left edge of the text item in micrometers. |
name | string | The name of the wxprinttextitem object. |
next | wxprinttextitem | Specifies the next wxprinttextitem object in the ring of text items that make up the template. |
template | wxprintpagetemplate | Specifies the wxprintpagetemplate object to which this text item belongs. |
textrgb | rgb | Shows the color of the text in the text item. |
top | integer | Specifies the position of the top edge of the text item in micrometers. |
type | type | Specifies the wxprinttextitem type object. |
underbitmaps | boolean | 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. |
undergraphics | boolean | 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. |
width | integer | 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
Parameter | Default value | Type name | Description |
---|---|---|---|
page | .nul | wxprintpage | 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
Parameter | Default value | Type name | Description |
---|---|---|---|
alignment | The current setting of the alignment property | string | 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
,
integer rgb
,
integer red
,
integer green
)
blue
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
rgb | The current value of the backgroundrgb
property | integer | 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. |
red | The current value of the backgroundrgb.red
property | integer | The red component in the new background color of the text item. This must be between 0 and 255 inclusive. |
green | The current value of the backgroundrgb.green
property | integer | The green component in the new background color of the text item. This must be between 0 and 255 inclusive. |
blue | The current value of the backgroundrgb.blue
property | integer | 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
Parameter | Default value | Type name | Description |
---|---|---|---|
backgroundvisible | The 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
,
string contentsource
)
contentname
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
contentsource | The current value of the contentsource property | string |
This must be one of: "printout" ,
"template" , "page" ,
"system" , or the empty string
("" ), in which case nothing will be printed.
|
contentname | The current value of the contentname property | string |
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
Parameter | Default value | Type name | Description |
---|---|---|---|
font | The current value of the font property | wxfont | 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
Parameter | Default value | Type name | Description | |||
---|---|---|---|---|---|---|
name | None | string |
The new name for the text item.
|
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
Parameter | Default value | Type name | Description |
---|---|---|---|
next | None | wxprinttextitem |
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
,
integer left
,
integer top
,
integer width
)
height
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
left | The current value of the left property | integer | The new position of the left side of the text item on the template. |
top | The current value of the top property | integer | The new position of the top edge of the text item on the template. |
width | The current value of the width property | integer | The new width of the text item on the template. |
height | The current value of the height property | integer | 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
,
integer rgb
,
integer red
,
integer green
)
blue
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
rgb | The current value of the textrgb property | integer | 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. |
red | The current value of the textrgb.red property | integer | The red component in the new text color of the text item. This must be between 0 and 255 inclusive. |
green | The current value of the textrgb.green
property | integer | The green component in the new text color of the text item. This must be between 0 and 255 inclusive. |
blue | The current value of the text.blue property | integer | 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
,
boolean undergraphics
)
underbitmaps
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
undergraphics | The current value of the undergraphics property | boolean | This decides whether text items are rendered as being underneath all objects of type wxgraphic on the template. |
underbitmaps | The current value of the underbitmaps property | boolean | 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. |