wxprintpage
Description
A wxprintpage object represents a page in a wxprintout. Each page in the printout requires a template that establishes what will be printed and where. The page contains the strings and bitmaps that are specific to it and these are associated with the items on the template. In simple terms, the template contains the layout and the page contains the data. In the case of printing a two or more records that use the same layout each time, only one template will be created for the entire printout and it will be used on each page. In the case of a graphical report, there will very likely be a template for each page. If a programmer chooses to create a very complex report, then it may have a template for the beginning, a template for many pages representing the content (where each page may be a record and the same layout), and another for the results page.
Type Tags
wxprintdatacontainer
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. |
firstbitmap | wxprintbitmap |
Specifies the first wxprintbitmap object in the ring of bitmaps
that contain the data associated with this page. This is
.nul if there are no bitmaps associated with the
page.
|
firststring | wxprintstring |
Specifies the first wxprintstring object in the ring of strings
that contain the data associated with this page. This is
.nul if there are no strings associated with the
page.
|
name | string | The name of the wxprintpage object. |
next | wxprintpage | Specifies the next wxprintpage object in the ring of pages that make up the printout. |
printout | wxprintout | Specifies the wxprintout object to which this page belongs. |
template | wxprintpagetemplate | Specifies the wxprintpagetemplate object that is used to output the data from this page. |
type | type | Specifies the wxprintpage 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 | |
---|---|
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
wxprintpagevar
.addbitmap
(
wxbitmap
,
string bitmap
,
wxprintbitmap name
)
next
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
bitmap | .nul | wxbitmap | The content for this wxprintbitmap object. |
name | .nul | string | 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 | .nul | wxprintbitmap |
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 page, then the new
bitmap will become the new firstbitmap. If
there are already some bitmaps in the page and
next is specified to be
.nul then the next bitmap will be the current
firstbitmap for the page, but the new bitmap
will not become a new firstbitmap (i.e. it
becomes a 'last' bitmap).
|
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 used on more than one template, 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 | |
---|---|
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
wxprintpagevar
.addstring
(
string
,
string string
,
wxprintstring name
)
next
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
string | "" | string | The content for this wxprintstring object. |
name | .nul | string | 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 | .nul | wxprintstring |
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 page, then the new
string will become the new firststring. If
there are already some strings in the page and
next is specified to be
.nul then the next string will be the current
firststring for the page, but the new string
will not become a new firststring (i.e. it
becomes a 'last' string).
|
setname()
Description
Sets the name of the page. The wxprintpage object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxprintpagevar
.setname
(
string
)
name
Parameters
Parameter | Default value | Type name | Description | |||
---|---|---|---|---|---|---|
name | None | string |
The new name for the page.
|
setnext()
Description
Sets the position of the page in the ring of pages.
Prototype
wxprintpagevar
.setnext
(
wxprintpage
)
next
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
next | None | wxprintpage |
Calling the method with the value .nul sets a page to be
the last one in the ring (the one before wxprintoutput.firstpage)
and passing any other page as the argument puts the target page
immediately before the one specified as the parameter.
|
wxprintpage!
Get
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 wxprintpage object using the ! operator is not supported.