The IlvPrintable Class
IlvPrintable is an abstract class that provides a base for describing objects that can be printed. Its is associated with a printable job that contains the printing parameters for a given job.
A printable can be described by subclassing the following methods:
A few subclasses of IlvPrintable are available:
-
IlvPrintableContainer encapsulates an instance of IlvContainer.
// declares a printable using the given region of a container.
// if the rectangle is null then the whole container is printed.
IlvPrintableContainer* printcont = new IlvPrintableContainer(container,
&rect);
-
IlvPrintableText allows printing of text. An alignment parameter can be specified.
// declares a printable using a simple text.
IlvPrintableText* printtext = new IlvPrintableText
(display->defaultPalette(),
"This is a text",
IlvCenter);
-
IlvPrintableFormattedText allows printing of text with various predefined attributes. Each Conversion specification is introduced by the character %. The following attributes are defined:
%p
The index of the page will be printed.
%P
The total number of pages will be printed.
%N
The document name will be printed.
%y
The year will be printed.
%M
The month will be printed numerically.
%d
The day of the month will be printed.
%h
The hour of the day (0-24) will be printed.
%H
The hour will be printed.
%m
The minute will be printed.
%s
The second will be printed.
%AM
The AM/PM indicator will be printed in upper case.
%am
The am/pm indicator will be printed in lower case.
You may still print %p codes by replacing them with %\p.
// declares a printable formated text
IlvPrintableFormattedText* printftext = new
IlvPrintableFormattedText(display->defaultPalette(),
"%N : (Page %p/%P - %d/%M/%y - %h:%m:s)");
-
IlvPrintableGraphic encapsulates an instance of IlvGraphic. Any IlvGraphic object can be printed.
// declares a printable graphic
IlvGraphic* ellipse = new IlvFilledEllipse(display,
IlvRect(0, 0, 100, 50));
IlvPrintableGraphic* printgraphic = new IlvPrintableGraphic(ellipse);
-
IlvPrintableFrame encapsulates a simple rectangle.
// declares a printable frame
IlvPrintableFrame* printframe = new IlvPrintableFrame
(display->defaultPalette());
-
IlvPrintableManager, IlvPrintableMgrView, and IlvPrintableManagerLayer (available only with the manager package) allow a whole manager, a manager view, or a manager layer, respectively, to be printed.
-
IlvPrintableComposite allows you to define a printable as a composition of printables.