Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Palette for the annotated text gadget. More...
#include <ilviews/annotext/palette.h>
Public Member Functions | |
IlvATPalette (const IlvATPalette &) | |
Constructor. | |
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 drawingbackground=IlFalse, IlvATWrap wrap=IlvWordWrap) | |
Constructor. | |
void | addZone (IlvATZone *) |
Adds a zone to the Text Palette. | |
void | copyPaletteTabulationMarks (const IlvATPalette *) |
Copies the tabulation marks of another Text Palette. | |
IlvDim | getFirstLineOffset () const |
Returns the first line offset attribute. | |
IlvATInteractor * | getInteractor () const |
Returns the interactor associated with the Text Palette. | |
IlvDim | getLeftMargin () const |
Returns the left margin attribute. | |
IlvDim | getLineSpacing () const |
Returns the line spacing attribute. | |
IlvDim | getNextTabulationMark (IlvDim x) const |
Gets the first tabulation mark after a given position. | |
IlvPalette * | getPalette () const |
Returns the palette used to draw text. | |
IlvDim | getPreviousTabulationMark (IlvDim x) const |
Gets the first tabulation mark before a given position. | |
IlvDim | getRightMargin () const |
Returns the right margin attribute. | |
IlvDim | getSpaceAfter () const |
Returns the space after attribute. | |
IlvDim | getSpaceBefore () const |
Returns the space before attribute. | |
IlAny | getUserData () const |
Returns the user data. | |
IlvDim | getVertOffset () const |
Returns the vertical offset attribute. | |
IlvATWrap | getWrap () const |
Returns the line wrapping attribute. | |
IlList * | getZones () const |
Returns the list of zones of the Text Palette. | |
void | insertRegularTabulationMarks (IlvDim start, IlvDim end, IlvDim spacing) |
Inserts tabulation marks at regular intervals in a given range. | |
IlBoolean | insertTabulationMark (IlvDim x) |
Inserts a tabulation mark at a given position. | |
IlBoolean | isDrawingBackground () const |
Returns the drawing background attribute. | |
IlBoolean | isVisible () const |
Returns the visible attribute. | |
IlBoolean | removeTabulationMark (IlvDim x) |
Removes the tabulation mark at a given position. | |
IlBoolean | removeTabulationMarks (IlvDim start, IlvDim end) |
Removes all tabulation marks in the given range. | |
void | removeZone (IlvATZone *) |
Removes a zone from the Text Palette. | |
void | setDrawingBackground (IlBoolean b) |
Sets the drawing background attribute. | |
void | setFirstLineOffset (IlvDim val) |
Sets the first line offset attribute in pixels. | |
void | setInteractor (IlvATInteractor *inter) |
Sets an interactor on the Text Palette. | |
void | setLeftMargin (IlvDim val) |
Returns the left margin attribute. | |
void | setLineSpacing (IlvDim val) |
Set the line spacing attribute. | |
void | setPalette (IlvPalette *palette) |
Sets the palette used to draw text. | |
void | setRightMargin (IlvDim val) |
Sets the right margin attribute. | |
void | setSpaceAfter (IlvDim val) |
Sets the space after attribute. | |
void | setSpaceBefore (IlvDim val) |
Sets the space before attribute. | |
void | setUserData (IlAny userData) |
Sets the Text Palette user data. | |
void | setVertOffset (IlvDim val) |
Sets the vertical offset attribute. | |
void | setVisible (IlBoolean visible) |
Sets the visible attribute. | |
void | setWrap (IlvATWrap wrap) |
Sets the line wrapping attribute. |
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.
A user data field enables the storage of user information in each instance.
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 | drawingbackground = 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 & | ) |
Constructor.
Creates a new instance of the IlvATPalette
class and initializes it by copying all the information from atpalette.
palette | The IlvATPalette to copy. |
void IlvATPalette::addZone | ( | IlvATZone * | ) |
Adds a zone to the Text Palette.
zone | The zone to add. |
void IlvATPalette::copyPaletteTabulationMarks | ( | const IlvATPalette * | ) |
Copies the tabulation marks of another Text Palette.
Replaces the current tabulation marks by those of the specified Text Palette.
palette | 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.
0
if none is found. x | Specifies the position to start from. |
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.
0
is always present. x | Specifies the position to start from. |
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.
IlFalse
if no tabulation mark is found, otherwise IlTrue
is returned. start | Specifies the starting position. | |
end | Specifies the ending position. |
void IlvATPalette::removeZone | ( | IlvATZone * | ) |
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 2012, 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.