Rogue Wave Views
Annotated Text Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions
IlvATPalette Class Reference

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...
 
IlvATInteractorgetInteractor () 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...
 
IlvPalettegetPalette () 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...
 
IlListgetZones () 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...
 

Detailed Description

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:

Note
The attributes relative to paragraphs will be applied to a paragraph if its end (either the paragraph mark inserted with 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.
An 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.
There are also internal objects, referred to as tabulation, which are included in the marker text flow to the method 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.
See also
IlvAnnoText, IlvATCursor, IlvATInsertionCursor, IlvATInteractor, IlvATZone.

Constructor & Destructor Documentation

§ IlvATPalette() [1/2]

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.

Parameters
displayThe display instance.
paletteThe palette used for drawing operations.
linespacingThe line spacing attribute in pixels.
rightmarginThe right margin attribute in pixels.
leftmarginThe left margin attribute in pixels.
firstlineoffsetThe first line offset attribute in pixels.
spaceafterThe space after attribute in pixels.
spacebeforeThe space before attribute in pixels.
vertoffsetThe vertical offset attribute in pixels.
visibleThe visible attribute.
drawbackgroundSpecifies drawing background attribute.
wrapThe line wrapping attribute.

§ IlvATPalette() [2/2]

IlvATPalette::IlvATPalette ( const IlvATPalette atPalette)

Constructor.

Creates a new instance of the IlvATPalette class and initializes it by copying all the information from atPalette.

Parameters
atPaletteThe IlvATPalette to copy.

Member Function Documentation

§ addZone()

void IlvATPalette::addZone ( IlvATZone zone)

Adds a zone to the Text Palette.

Parameters
zoneThe zone to add.

§ copyPaletteTabulationMarks()

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.

Parameters
atPalSpecifies the Text Palette.

§ getFirstLineOffset()

IlvDim IlvATPalette::getFirstLineOffset ( ) const

Returns the first line offset attribute.

Returns
The first line offset attribute in pixels.

§ getInteractor()

IlvATInteractor* IlvATPalette::getInteractor ( ) const

Returns the interactor associated with the Text Palette.

Returns
The interactor associated with the Text Palette.

§ getLeftMargin()

IlvDim IlvATPalette::getLeftMargin ( ) const

Returns the left margin attribute.

Returns
The left margin attribute in pixels.

§ getLineSpacing()

IlvDim IlvATPalette::getLineSpacing ( ) const

Returns the line spacing attribute.

Returns
The line spacing attribute in pixels.

§ getNextTabulationMark()

IlvDim IlvATPalette::getNextTabulationMark ( IlvDim  x) const

Gets the first tabulation mark after a given position.

Parameters
xSpecifies the position to start from.
Returns
The position of the first tabulation mark after the position x or 0 if none is found.

§ getPalette()

IlvPalette* IlvATPalette::getPalette ( ) const

Returns the palette used to draw text.

Returns
The IlvPalette used when drawing text.

§ getPreviousTabulationMark()

IlvDim IlvATPalette::getPreviousTabulationMark ( IlvDim  x) const

Gets the first tabulation mark before a given position.

Parameters
xSpecifies the position to start from.
Returns
The position of the first tabulation mark before the position x. A tabulation at the position 0 is always present.

§ getRightMargin()

IlvDim IlvATPalette::getRightMargin ( ) const

Returns the right margin attribute.

Returns
The right margin attribute in pixels.

§ getSpaceAfter()

IlvDim IlvATPalette::getSpaceAfter ( ) const

Returns the space after attribute.

Returns
The space after attribute in pixels.

§ getSpaceBefore()

IlvDim IlvATPalette::getSpaceBefore ( ) const

Returns the space before attribute.

Returns
The space before attribute in pixels.

§ getUserData()

IlAny IlvATPalette::getUserData ( ) const

Returns the user data.

Returns
The user data.

§ getVertOffset()

IlvDim IlvATPalette::getVertOffset ( ) const

Returns the vertical offset attribute.

Returns
The vertical offset attribute in pixels.

§ getWrap()

IlvATWrap IlvATPalette::getWrap ( ) const

Returns the line wrapping attribute.

Returns
The line wrapping attribute.

§ getZones()

IlList* IlvATPalette::getZones ( ) const

Returns the list of zones of the Text Palette.

Returns
A pointer to the list of zones managed by the IlvATPalette.

§ insertRegularTabulationMarks()

void IlvATPalette::insertRegularTabulationMarks ( IlvDim  start,
IlvDim  end,
IlvDim  spacing 
)

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.

Parameters
startSpecifies the starting position.
endSpecifies the ending position.
spacingSpecifies the spacing.

§ insertTabulationMark()

IlBoolean IlvATPalette::insertTabulationMark ( IlvDim  x)

Inserts a tabulation mark at a given position.

Sets a tabulation mark at the specified position.

Returns
IlFalse if there is already a tabulation mark at this position, otherwise IlTrue is returned.

§ isDrawingBackground()

IlBoolean IlvATPalette::isDrawingBackground ( ) const

Returns the drawing background attribute.

Returns
The drawing background attribute.

§ isVisible()

IlBoolean IlvATPalette::isVisible ( ) const

Returns the visible attribute.

Returns
IlTrue if the IlvATPalette is set to draw text.

§ removeTabulationMark()

IlBoolean IlvATPalette::removeTabulationMark ( IlvDim  x)

Removes the tabulation mark at a given position.

Removes the tabulation mark found at the specified position.

Returns
IlFalse if no tabulation mark is found, otherwise IlTrue is returned.

§ removeTabulationMarks()

IlBoolean IlvATPalette::removeTabulationMarks ( IlvDim  start,
IlvDim  end 
)

Removes all tabulation marks in the given range.

Removes all tabulation marks found between position start and end.

Parameters
startSpecifies the starting position.
endSpecifies the ending position.
Returns
IlFalse if no tabulation mark is found, otherwise IlTrue is returned.

§ removeZone()

void IlvATPalette::removeZone ( IlvATZone zone)

Removes a zone from the Text Palette.

Parameters
zoneThe zone to remove.

§ setDrawingBackground()

void IlvATPalette::setDrawingBackground ( IlBoolean  b)

Sets the drawing background attribute.

Parameters
bIf IlTrue, the background is drawn under the characters, otherwise the background is not drawn.

§ setFirstLineOffset()

void IlvATPalette::setFirstLineOffset ( IlvDim  val)

Sets the first line offset attribute in pixels.

Parameters
valThe first line offset attribute in pixels.

§ setInteractor()

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.

Parameters
interThe annotated text interactor.

§ setLeftMargin()

void IlvATPalette::setLeftMargin ( IlvDim  val)

Returns the left margin attribute.

Parameters
valThe left margin attribute in pixels.

§ setLineSpacing()

void IlvATPalette::setLineSpacing ( IlvDim  val)

Set the line spacing attribute.

Parameters
valThe line spacing attribute in pixels.

§ setPalette()

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.

Parameters
paletteThe palette.

§ setRightMargin()

void IlvATPalette::setRightMargin ( IlvDim  val)

Sets the right margin attribute.

Parameters
valThe right margin attribute in pixels.

§ setSpaceAfter()

void IlvATPalette::setSpaceAfter ( IlvDim  val)

Sets the space after attribute.

Parameters
valThe space after attribute in pixels.

§ setSpaceBefore()

void IlvATPalette::setSpaceBefore ( IlvDim  val)

Sets the space before attribute.

Parameters
valThe space before attribute in pixels.

§ setUserData()

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.

Parameters
userDataThe user data to set.

§ setVertOffset()

void IlvATPalette::setVertOffset ( IlvDim  val)

Sets the vertical offset attribute.

Parameters
valThe vertical offset attribute in pixels.

§ setVisible()

void IlvATPalette::setVisible ( IlBoolean  visible)

Sets the visible attribute.

Parameters
visibleIf 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.

§ setWrap()

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.

Parameters
wrapThe 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.