Rogue Wave Views Annotated Text Package API Reference Guide |
Rogue Wave Views Documentation Home |
Palette for the annotated text gadget. More...
#include <ilviews/annotext/palette.h>
Public Member Functions | |
IlvATPalette (IlvDisplay *display, IlvPalette *palette=0, IlvDim linespacing=0, IlvDim rightmargin=0, IlvDim leftmargin=1, IlvDim firstlineoffset=0, IlvDim spaceafter=0, IlvDim spacebefore=0, IlvDim vertoffset=0, IlBoolean visible=IlTrue, IlBoolean drawbackground=IlFalse, IlvATWrap wrap=IlvWordWrap) | |
Constructor. More... | |
IlvATPalette (const IlvATPalette &atPalette) | |
Constructor. More... | |
void | addZone (IlvATZone *zone) |
Adds a zone to the Text Palette. More... | |
void | copyPaletteTabulationMarks (const IlvATPalette *atPal) |
Copies the tabulation marks of another Text Palette. More... | |
IlvDim | getFirstLineOffset () const |
Returns the first line offset attribute. More... | |
IlvATInteractor * | getInteractor () const |
Returns the interactor associated with the Text Palette. More... | |
IlvDim | getLeftMargin () const |
Returns the left margin attribute. More... | |
IlvDim | getLineSpacing () const |
Returns the line spacing attribute. More... | |
IlvDim | getNextTabulationMark (IlvDim x) const |
Gets the first tabulation mark after a given position. More... | |
IlvPalette * | getPalette () const |
Returns the palette used to draw text. More... | |
IlvDim | getPreviousTabulationMark (IlvDim x) const |
Gets the first tabulation mark before a given position. More... | |
IlvDim | getRightMargin () const |
Returns the right margin attribute. More... | |
IlvDim | getSpaceAfter () const |
Returns the space after attribute. More... | |
IlvDim | getSpaceBefore () const |
Returns the space before attribute. More... | |
IlAny | getUserData () const |
Returns the user data. More... | |
IlvDim | getVertOffset () const |
Returns the vertical offset attribute. More... | |
IlvATWrap | getWrap () const |
Returns the line wrapping attribute. More... | |
IlList * | getZones () const |
Returns the list of zones of the Text Palette. More... | |
void | insertRegularTabulationMarks (IlvDim start, IlvDim end, IlvDim spacing) |
Inserts tabulation marks at regular intervals in a given range. More... | |
IlBoolean | insertTabulationMark (IlvDim x) |
Inserts a tabulation mark at a given position. More... | |
IlBoolean | isDrawingBackground () const |
Returns the drawing background attribute. More... | |
IlBoolean | isVisible () const |
Returns the visible attribute. More... | |
IlBoolean | removeTabulationMark (IlvDim x) |
Removes the tabulation mark at a given position. More... | |
IlBoolean | removeTabulationMarks (IlvDim start, IlvDim end) |
Removes all tabulation marks in the given range. More... | |
void | removeZone (IlvATZone *zone) |
Removes a zone from the Text Palette. More... | |
void | setDrawingBackground (IlBoolean b) |
Sets the drawing background attribute. More... | |
void | setFirstLineOffset (IlvDim val) |
Sets the first line offset attribute in pixels. More... | |
void | setInteractor (IlvATInteractor *inter) |
Sets an interactor on the Text Palette. More... | |
void | setLeftMargin (IlvDim val) |
Returns the left margin attribute. More... | |
void | setLineSpacing (IlvDim val) |
Set the line spacing attribute. More... | |
void | setPalette (IlvPalette *palette) |
Sets the palette used to draw text. More... | |
void | setRightMargin (IlvDim val) |
Sets the right margin attribute. More... | |
void | setSpaceAfter (IlvDim val) |
Sets the space after attribute. More... | |
void | setSpaceBefore (IlvDim val) |
Sets the space before attribute. More... | |
void | setUserData (IlAny userData) |
Sets the Text Palette user data. More... | |
void | setVertOffset (IlvDim val) |
Sets the vertical offset attribute. More... | |
void | setVisible (IlBoolean visible) |
Sets the visible attribute. More... | |
void | setWrap (IlvATWrap wrap) |
Sets the line wrapping attribute. More... | |
Palette for the annotated text gadget.
Library: ilvatext
An instance of the IlvATPalette
(also called a Text Palette) class contains graphical and text formatting information used to display zones of an IlvAnnoText
object. Each IlvATZone
of an IlvAnnoText
object is associated with a Text Palette to draw the textual information contained the text zone.
The graphical resources for drawing (color, font, ...) are specified by an IlvATPalette
.
The IlvATPalette
class defines the following formatting attributes:
IlFalse
, the text is not drawn. IlvCharWrap
: the text can be cut anywhere. IlvWordWrap
: the text can only be cut at word boundaries. IlvNoWrap
: no line wrapping, the text cannot be cut. IlvAnnoText::insertParagraph()
or the break mark inserted with IlvAnnoText::insertBreak()
) is in the Text Palette. We recommend that you use only paragraph attributes on Text Palettes whose zones boundaries are paragraph (or break) boundaries.IlvATInteractor
can be attached to an IlvATPalette
; this interactor will be applied to any IlvATZone
associated to the IlvATPalette
.IlvATPalette
provides ways to handle tabulation marks in an IlvAnnoText
. Tabulation marks are markers placed on an imaginary ruler at the top of the Annotext editing zone (similar to Word or FrameMaker). The positions are in fact pixel coordinates. The tabulation marks are registered either individually by insertTabulationMark()
or grouped with insetRegularTabulationMarks()
which regularly sets marks between two precise pixel coordinates and at a regular distance from one another. IlvAnnotext::insertTabulation()
. As the tabulation objects are invisible, they have no set position in the text, and merely serve as guidelines when the text is being recalculated. Tabulation marks are designed to tell Annotext that the next character should be drawn at the next tabulation mark, or on the following line if there is no mark on this line.IlvAnnoText
, IlvATCursor
, IlvATInsertionCursor
, IlvATInteractor
, IlvATZone
. IlvATPalette::IlvATPalette | ( | IlvDisplay * | display, |
IlvPalette * | palette = 0 , |
||
IlvDim | linespacing = 0 , |
||
IlvDim | rightmargin = 0 , |
||
IlvDim | leftmargin = 1 , |
||
IlvDim | firstlineoffset = 0 , |
||
IlvDim | spaceafter = 0 , |
||
IlvDim | spacebefore = 0 , |
||
IlvDim | vertoffset = 0 , |
||
IlBoolean | visible = IlTrue , |
||
IlBoolean | drawbackground = IlFalse , |
||
IlvATWrap | wrap = IlvWordWrap |
||
) |
Constructor.
Creates and initializes a new instance of the IlvATPalette
class.
display | The display instance. |
palette | The palette used for drawing operations. |
linespacing | The line spacing attribute in pixels. |
rightmargin | The right margin attribute in pixels. |
leftmargin | The left margin attribute in pixels. |
firstlineoffset | The first line offset attribute in pixels. |
spaceafter | The space after attribute in pixels. |
spacebefore | The space before attribute in pixels. |
vertoffset | The vertical offset attribute in pixels. |
visible | The visible attribute. |
drawbackground | Specifies drawing background attribute. |
wrap | The line wrapping attribute. |
IlvATPalette::IlvATPalette | ( | const IlvATPalette & | atPalette | ) |
Constructor.
Creates a new instance of the IlvATPalette
class and initializes it by copying all the information from atPalette.
atPalette | The IlvATPalette to copy. |
void IlvATPalette::addZone | ( | IlvATZone * | zone | ) |
Adds a zone to the Text Palette.
zone | The zone to add. |
void IlvATPalette::copyPaletteTabulationMarks | ( | const IlvATPalette * | atPal | ) |
Copies the tabulation marks of another Text Palette.
Replaces the current tabulation marks by those of the specified Text Palette.
atPal | Specifies the Text Palette. |
IlvDim IlvATPalette::getFirstLineOffset | ( | ) | const |
Returns the first line offset attribute.
IlvATInteractor* IlvATPalette::getInteractor | ( | ) | const |
Returns the interactor associated with the Text Palette.
IlvDim IlvATPalette::getLeftMargin | ( | ) | const |
Returns the left margin attribute.
IlvDim IlvATPalette::getLineSpacing | ( | ) | const |
Returns the line spacing attribute.
Gets the first tabulation mark after a given position.
x | Specifies the position to start from. |
0
if none is found. IlvPalette* IlvATPalette::getPalette | ( | ) | const |
Returns the palette used to draw text.
IlvPalette
used when drawing text. Gets the first tabulation mark before a given position.
x | Specifies the position to start from. |
0
is always present. IlvDim IlvATPalette::getRightMargin | ( | ) | const |
Returns the right margin attribute.
IlvDim IlvATPalette::getSpaceAfter | ( | ) | const |
Returns the space after attribute.
IlvDim IlvATPalette::getSpaceBefore | ( | ) | const |
Returns the space before attribute.
IlAny IlvATPalette::getUserData | ( | ) | const |
Returns the user data.
IlvDim IlvATPalette::getVertOffset | ( | ) | const |
Returns the vertical offset attribute.
IlvATWrap IlvATPalette::getWrap | ( | ) | const |
Returns the line wrapping attribute.
IlList* IlvATPalette::getZones | ( | ) | const |
Returns the list of zones of the Text Palette.
IlvATPalette
. Inserts tabulation marks at regular intervals in a given range.
Sets tabulation marks starting at position start, separated by spacing pixels, until position end is reached.
start | Specifies the starting position. |
end | Specifies the ending position. |
spacing | Specifies the spacing. |
Inserts a tabulation mark at a given position.
Sets a tabulation mark at the specified position.
IlFalse
if there is already a tabulation mark at this position, otherwise IlTrue
is returned. IlBoolean IlvATPalette::isDrawingBackground | ( | ) | const |
Returns the drawing background attribute.
IlBoolean IlvATPalette::isVisible | ( | ) | const |
Returns the visible attribute.
IlTrue
if the IlvATPalette
is set to draw text. Removes the tabulation mark at a given position.
Removes the tabulation mark found at the specified position.
IlFalse
if no tabulation mark is found, otherwise IlTrue
is returned. Removes all tabulation marks in the given range.
Removes all tabulation marks found between position start and end.
start | Specifies the starting position. |
end | Specifies the ending position. |
IlFalse
if no tabulation mark is found, otherwise IlTrue
is returned. void IlvATPalette::removeZone | ( | IlvATZone * | zone | ) |
Removes a zone from the Text Palette.
zone | The zone to remove. |
void IlvATPalette::setDrawingBackground | ( | IlBoolean | b | ) |
Sets the drawing background attribute.
b | If IlTrue , the background is drawn under the characters, otherwise the background is not drawn. |
void IlvATPalette::setFirstLineOffset | ( | IlvDim | val | ) |
Sets the first line offset attribute in pixels.
val | The first line offset attribute in pixels. |
void IlvATPalette::setInteractor | ( | IlvATInteractor * | inter | ) |
Sets an interactor on the Text Palette.
Attaches the interactor to the Text Palette. Any IlvATZone
associated to the Text Palette and not defining its own interactor will use inter. If this is the default palette of the IlvAnnoText
, this interactor will also be used when no zone is defined.
inter | The annotated text interactor. |
void IlvATPalette::setLeftMargin | ( | IlvDim | val | ) |
Returns the left margin attribute.
val | The left margin attribute in pixels. |
void IlvATPalette::setLineSpacing | ( | IlvDim | val | ) |
Set the line spacing attribute.
val | The line spacing attribute in pixels. |
void IlvATPalette::setPalette | ( | IlvPalette * | palette | ) |
Sets the palette used to draw text.
Sets palette as the IlvPalette
used to draw the text, locks palette and unlocks the IlvPalette
previously used.
palette | The palette. |
void IlvATPalette::setRightMargin | ( | IlvDim | val | ) |
Sets the right margin attribute.
val | The right margin attribute in pixels. |
void IlvATPalette::setSpaceAfter | ( | IlvDim | val | ) |
Sets the space after attribute.
val | The space after attribute in pixels. |
void IlvATPalette::setSpaceBefore | ( | IlvDim | val | ) |
Sets the space before attribute.
val | The space before attribute in pixels. |
void IlvATPalette::setUserData | ( | IlAny | userData | ) |
Sets the Text Palette user data.
The Text Palette just provides a storage for an anonymous pointer; the memory pointed to must be handled and deleted by the application.
userData | The user data to set. |
void IlvATPalette::setVertOffset | ( | IlvDim | val | ) |
Sets the vertical offset attribute.
val | The vertical offset attribute in pixels. |
void IlvATPalette::setVisible | ( | IlBoolean | visible | ) |
Sets the visible attribute.
visible | If set to IlTrue , the text is considered visible and the IlvATPalette will draw it. Otherwise, the text is set to be invisible and will not be drawn. |
void IlvATPalette::setWrap | ( | IlvATWrap | wrap | ) |
Sets the line wrapping attribute.
The recalculation of the layout must be explicitly requested using the IlvAnnoText::computeLines()
member function. This policy allows you to group together several changes in graphic settings before requesting a final calculation of the layout.
wrap | The line wrapping attribute. |
© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.