rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Annotated Text Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvATPalette Class Reference

Palette for the annotated text gadget. More...

#include <ilviews/annotext/palette.h>

List of all members.

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

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:

Warning:
[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::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.

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

Parameters:
palette The IlvATPalette to copy.

Member Function Documentation

void IlvATPalette::addZone ( IlvATZone  ) 

Adds a zone to the Text Palette.

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

Parameters:
palette Specifies the Text Palette.
IlvDim IlvATPalette::getFirstLineOffset (  )  const

Returns the first line offset attribute.

Returns:
The first line offset attribute in pixels.
IlvATInteractor* IlvATPalette::getInteractor (  )  const

Returns the interactor associated with the Text Palette.

Returns:
The interactor associated with the Text Palette.
IlvDim IlvATPalette::getLeftMargin (  )  const

Returns the left margin attribute.

Returns:
The left margin attribute in pixels.
IlvDim IlvATPalette::getLineSpacing (  )  const

Returns the line spacing attribute.

Returns:
The line spacing attribute in pixels.
IlvDim IlvATPalette::getNextTabulationMark ( IlvDim  x  )  const

Gets the first tabulation mark after a given position.

Returns:
The position of the first tabulation mark after the position x or 0 if none is found.
Parameters:
x Specifies the position to start from.
IlvPalette* IlvATPalette::getPalette (  )  const

Returns the palette used to draw text.

Returns:
The IlvPalette used when drawing text.
IlvDim IlvATPalette::getPreviousTabulationMark ( IlvDim  x  )  const

Gets the first tabulation mark before a given position.

Returns:
The position of the first tabulation mark before the position x. A tabulation at the position 0 is always present.
Parameters:
x Specifies the position to start from.
IlvDim IlvATPalette::getRightMargin (  )  const

Returns the right margin attribute.

Returns:
The right margin attribute in pixels.
IlvDim IlvATPalette::getSpaceAfter (  )  const

Returns the space after attribute.

Returns:
The space after attribute in pixels.
IlvDim IlvATPalette::getSpaceBefore (  )  const

Returns the space before attribute.

Returns:
The space before attribute in pixels.
IlAny IlvATPalette::getUserData (  )  const

Returns the user data.

Returns:
The user data.
IlvDim IlvATPalette::getVertOffset (  )  const

Returns the vertical offset attribute.

Returns:
The vertical offset attribute in pixels.
IlvATWrap IlvATPalette::getWrap (  )  const

Returns the line wrapping attribute.

Returns:
The line wrapping attribute.
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.
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:
start Specifies the starting position.
end Specifies the ending position.
spacing Specifies the spacing.
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.
IlBoolean IlvATPalette::isDrawingBackground (  )  const

Returns the drawing background attribute.

Returns:
The drawing background attribute.
IlBoolean IlvATPalette::isVisible (  )  const

Returns the visible attribute.

Returns:
IlTrue if the IlvATPalette is set to draw text.
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.
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.

Returns:
IlFalse if no tabulation mark is found, otherwise IlTrue is returned.
Parameters:
start Specifies the starting position.
end Specifies the ending position.
void IlvATPalette::removeZone ( IlvATZone  ) 

Removes a zone from the Text Palette.

Parameters:
zone The zone to remove.
void IlvATPalette::setDrawingBackground ( IlBoolean  b  ) 

Sets the drawing background attribute.

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

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

Parameters:
inter The annotated text interactor.
void IlvATPalette::setLeftMargin ( IlvDim  val  ) 

Returns the left margin attribute.

Parameters:
val The left margin attribute in pixels.
void IlvATPalette::setLineSpacing ( IlvDim  val  ) 

Set the line spacing attribute.

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

Parameters:
palette The palette.
void IlvATPalette::setRightMargin ( IlvDim  val  ) 

Sets the right margin attribute.

Parameters:
val The right margin attribute in pixels.
void IlvATPalette::setSpaceAfter ( IlvDim  val  ) 

Sets the space after attribute.

Parameters:
val The space after attribute in pixels.
void IlvATPalette::setSpaceBefore ( IlvDim  val  ) 

Sets the space before attribute.

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

Parameters:
userdata The user data to set.
void IlvATPalette::setVertOffset ( IlvDim  val  ) 

Sets the vertical offset attribute.

Parameters:
val The vertical offset attribute in pixels.
void IlvATPalette::setVisible ( IlBoolean  visible  ) 

Sets the visible attribute.

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

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