Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Graphic class. More...
#include <ilviews/graphics/relfrect.h>
Public Member Functions | |
IlvReliefRectangle (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=2, IlvPalette *palette=0) | |
Constructor. | |
const char * | className () const |
Returns the class name of an object. | |
virtual IlvGraphic * | copy () const |
Copies this object. | |
virtual void | draw (IlvPort *, const IlvTransformer *=0, const IlvRegion *=0) const |
Draws the graphic object. | |
virtual IlvClassInfo * | getClassInfo () const |
Gets class information. | |
IlUShort | getThickness () const |
Returns the shadow thickness. | |
virtual void | invert (IlBoolean=((IlBoolean) 0)) |
Highlights the object. | |
IlBoolean | isSubtypeOf (const IlvClassInfo *c) const |
Checks whether this object's class is a subclass. | |
IlBoolean | isSubtypeOf (const char *t) const |
Checks whether this object's class is a subclass of a given parent class. | |
virtual void | setAlpha (IlvIntensity) |
Sets the alpha value of the object. | |
virtual void | setAntialiasingMode (IlvAntialiasingMode) |
Sets the anti-aliasing mode of the object. | |
virtual void | setArcMode (IlvArcMode) |
Sets the arc mode of the object. | |
virtual void | setBackground (IlvColor *) |
Sets the background color of the object. | |
virtual void | setColorPattern (IlvColorPattern *) |
Sets the color pattern of the object. | |
virtual void | setFillRule (IlvFillRule) |
Sets the fill rule of the object. | |
virtual void | setFillStyle (IlvFillStyle) |
Sets the fill style of the object. | |
virtual void | setFont (IlvFont *) |
Sets the font of the object. | |
virtual void | setForeground (IlvColor *) |
Sets the foreground color of the object. | |
virtual void | setGradientPattern (IlvGradientPattern *) |
Sets the gradient pattern of the object. | |
virtual void | setLineStyle (IlvLineStyle *) |
Sets the line style of the object. | |
virtual void | setLineWidth (IlUShort) |
Sets the line width of the object. | |
virtual void | setMode (IlvDrawMode) |
Sets the drawing mode of the object temporarily. | |
virtual void | setOverwrite (IlBoolean) |
Sets an overwrite mode that modifies how the drawing member functions operate. | |
virtual void | setPalette (IlvPalette *) |
Sets the internal palette to the given palette value. | |
virtual void | setPattern (IlvPattern *) |
Sets the pattern of the object. | |
void | setThickness (IlUShort thickness) |
Sets the shadow thickness. | |
virtual void | write (IlvOutputFile &) const |
Writes an object description to a file. | |
Static Public Member Functions | |
static void | AddProperty (const IlSymbol *k, IlAny v) |
Adds a property to this object's class. | |
static IlAny | GetProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0)) |
Retrieves the property value associated with the key in this object's class. | |
static const IlvClassInfo * | HasProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0)) |
Checks for the existence of a property for this object's class hierarchy. | |
static IlvGraphic * | read (IlvInputFile &, IlvPalette *pal) |
Reads an object description from a file. | |
static IlBoolean | RemoveProperty (const IlSymbol *key) |
Removes a property from this object's class. | |
static IlBoolean | ReplaceProperty (const IlSymbol *k, IlAny v) |
Replaces a property in this object's class. |
Graphic class.
Library: views
An IlvReliefRectangle
object appears as a filled rectangle whose subtle shading gives the effect of a three-dimensional graphic entity.
IlvReliefRectangle::IlvReliefRectangle | ( | IlvDisplay * | display, | |
const IlvRect & | rect, | |||
IlUShort | thickness = 2 , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
display | The display instance. | |
rect | Specifies the geometry of the graphic object. | |
thickness | Specifies the shadow thickness. | |
palette | The palette used to draw the graphic object. |
Adds a property to this object's class.
This static function associates the given value with the given key for the class of this object only.
key | The key to be associated. | |
value | The value to be associated. |
Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
const char* IlvReliefRectangle::className | ( | ) | const |
Returns the class name of an object.
This method is equivalent to getClassInfo()->getClassName()
.
IlvRectangle
object, the className function returns "IlvRectangle"
. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
virtual IlvGraphic* IlvReliefRectangle::copy | ( | ) | const [virtual] |
Copies this object.
Allocates and returns a copy of this object. If the object is composite, the implementation of this member function makes a copy of the object's components.
IlvPredefinedIOMembers
. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
virtual void IlvReliefRectangle::draw | ( | IlvPort * | dst, | |
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | const [virtual] |
Draws the graphic object.
Draws the object in the given IlvPort
using the transformer t
which might have the value 0
. The clip
parameter, which can also be 0
, represents the clipping region relative to the transformed object.
dst | The destination port. | |
t | The transformer value. If 0, no transformation is performed. | |
clip | The clipping region, or 0 if none. |
Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
virtual IlvClassInfo* IlvReliefRectangle::getClassInfo | ( | ) | const [virtual] |
Gets class information.
Returns a pointer to the IlvClassInfo
object associated with this object's class.
Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
static IlAny IlvReliefRectangle::GetProperty | ( | const IlSymbol * | key, | |
IlBoolean | checkSuperClass = ((IlBoolean) 0) | |||
) | [static] |
Retrieves the property value associated with the key in this object's class.
Retrieves the property value associated with the property name key. If the property cannot be found in the class of this object, and if checkSuperClass is set to IlTrue
, then the function operates iteratively on each superclass until the property is found. If the property cannot be found, then 0
is returned.
key | The key with which the property value is associated. | |
checkSuperClass | IlTrue specifies iterative search on superclasses. |
0
. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
IlUShort IlvReliefRectangle::getThickness | ( | ) | const |
Returns the shadow thickness.
static const IlvClassInfo* IlvReliefRectangle::HasProperty | ( | const IlSymbol * | key, | |
IlBoolean | checkSuperClass = ((IlBoolean) 0) | |||
) | [static] |
Checks for the existence of a property for this object's class hierarchy.
Retrieves a pointer to the IlvClassInfo
that indicates a class where the key property exists. If the returned value is non-0
, then this property actually exists for this class. If this is not the case and if checkSuperClass is set to IlTrue
, then the function operates iteratively on each superclass until a match is found. If the property cannot be found, then 0
is returned.
key | The key with which the property value is associated. | |
checkSuperClass | IlTrue specifies iterative search on superclasses. |
0
. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
Highlights the object.
Highlights the object. It is implemented as swapping the foreground and background colors of the object, but can have other implementations in derived subclasses. The parameter temp controls the way you toggle between the background and the foreground. If temp is omitted or is IlFalse
, then a new palette is computed by calling the IlvDisplay::getPalette()
method. If temp is IlTrue
, the object palette is inverted, and thus all the objects referencing this palette will be affected.
temp | If IlTrue , highlights the object. |
Reimplemented from IlvSimpleGraphic.
IlBoolean IlvReliefRectangle::isSubtypeOf | ( | const IlvClassInfo * | classInfo | ) | const |
Checks whether this object's class is a subclass.
This method is equivalent to getClassInfo()->isSubtypeOf(classInfo)
.
classInfo | The name of a class on which the object's class is tested. |
IlTrue
or IlFalse
, depending on whether or not this object's class is a subclass of the class indicated by classInfo. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
IlBoolean IlvReliefRectangle::isSubtypeOf | ( | const char * | parentClass | ) | const |
Checks whether this object's class is a subclass of a given parent class.
This method is equivalent to getClassInfo()->isSubtypeOf(parentClass)
.
parentClass | A string representing the parent class. |
IlTrue
or IlFalse
, depending on whether or not this object's class inherits parentClass attributes. The parentClass parameter should be a string representing the class name of an IlvGraphic
subclass. A call to this member function for a given class instance returns IlTrue
if given the name of its class. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
static IlvGraphic* IlvReliefRectangle::read | ( | IlvInputFile & | file, | |
IlvPalette * | palette | |||
) | [static] |
Reads an object description from a file.
Reads an object description from the file input, given the palette graphic attributes. It reads the information that was saved by the member function write
to be able to create a new instance of this object. Usually, because of the availability of the constructor that expects an IlvInputFile
, read should be equivalent to:
IlvGraphic* MyClass::read(IlvInputFile& file, IlvPalette* palette) { return new MyClass(file, palette); }
In the following example, the static member function read
of the IlvLabel
class could have the following form:
IlvGraphic* IlvLabel::read(IlvInputFile& file, IlvPalette* pal) { IlvPoint pos; file.getStream() >> pos; // Read the position field return new IlvLabel(pal->getDisplay(), pos, IlvReadString(file.getStream()), pal); }
file | The name of the file to be read from. | |
palette | The name of the palette for the object. |
DeclareTypeInfoRO
, DeclareTypeInfo
, IlvPredefinedIOMembers
. read
method is not capitalized like other static methods so that it is consistent with the write
method. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
Removes a property from this object's class.
This static function removes the indicated property to the class of this object.
key | The key property to be removed. |
IlTrue
if the key property was actually found, or IlFalse
otherwise. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
Replaces a property in this object's class.
This static function replaces the indicated property value to the class of this object.
key | The key to be replaced. | |
value | The value to be replaced. |
IlTrue
if the key property was actually found, or IlFalse
otherwise. Reimplemented from IlvFilledRectangle.
Reimplemented in IlvReliefLabel, and IlvReliefDiamond.
virtual void IlvReliefRectangle::setAlpha | ( | IlvIntensity | alpha | ) | [virtual] |
Sets the alpha value of the object.
alpha | The new alpha value. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setAntialiasingMode | ( | IlvAntialiasingMode | mode | ) | [virtual] |
Sets the anti-aliasing mode of the object.
mode | The new anti-aliasing mode. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setArcMode | ( | IlvArcMode | mode | ) | [virtual] |
Sets the arc mode of the object.
mode | The new arc mode. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setBackground | ( | IlvColor * | background | ) | [virtual] |
Sets the background color of the object.
Sets the background color of the object.
background | The new background color. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setColorPattern | ( | IlvColorPattern * | pattern | ) | [virtual] |
Sets the color pattern of the object.
Sets the color pattern of the object.
pattern | The new color pattern. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setFillRule | ( | IlvFillRule | rule | ) | [virtual] |
Sets the fill rule of the object.
rule | The new fill rule. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setFillStyle | ( | IlvFillStyle | style | ) | [virtual] |
Sets the fill style of the object.
style | The new fill style. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setFont | ( | IlvFont * | font | ) | [virtual] |
Sets the font of the object.
font | The new font. |
Reimplemented from IlvSimpleGraphic.
Reimplemented in IlvReliefLabel.
virtual void IlvReliefRectangle::setForeground | ( | IlvColor * | foreground | ) | [virtual] |
Sets the foreground color of the object.
Sets the foreground color of the object.
foreground | The new foreground color. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setGradientPattern | ( | IlvGradientPattern * | pattern | ) | [virtual] |
Sets the gradient pattern of the object.
Sets the gradient pattern of the object.
pattern | The new gradient pattern. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setLineStyle | ( | IlvLineStyle * | style | ) | [virtual] |
Sets the line style of the object.
style | The new line style. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setLineWidth | ( | IlUShort | width | ) | [virtual] |
Sets the line width of the object.
width | The new line width. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setMode | ( | IlvDrawMode | mode | ) | [virtual] |
Sets the drawing mode of the object temporarily.
Changing the IlvDrawMode
attribute of an object is considered a temporary operation. You have to set the mode to its default value when you no longer need another mode different from the value IlvModeSet
. The drawing mode information is passed to the palette of the graphic object (see the IlvPalette::setOverwrite
method for more details).
mode | The drawing mode to be set. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setOverwrite | ( | IlBoolean | over | ) | [virtual] |
Sets an overwrite mode that modifies how the drawing member functions operate.
Modifies the way the drawing member functions operate. The information is passed to the palette of the graphic object (see the IlvPalette::setOverwrite
method for more details).
over | If IlFalse , sets selective hidden drawing operations. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setPalette | ( | IlvPalette * | palette | ) | [virtual] |
Sets the internal palette to the given palette
value.
Sets the internal palette to the given palette
value. The previous palette is unlocked, and palette is locked.
palette | The new palette of this object. |
Reimplemented from IlvSimpleGraphic.
virtual void IlvReliefRectangle::setPattern | ( | IlvPattern * | pattern | ) | [virtual] |
Sets the pattern of the object.
Sets the pattern of the object.
pattern | The new pattern. |
Reimplemented from IlvSimpleGraphic.
void IlvReliefRectangle::setThickness | ( | IlUShort | thickness | ) |
Sets the shadow thickness.
thickness | The new value of the shadow thickness. |
virtual void IlvReliefRectangle::write | ( | IlvOutputFile & | output | ) | const [virtual] |
Writes an object description to a file.
Writes out, in a file, the object description. This description contains all the information necessary to create an exact copy of this object by means of the member function read
. Information concerning any IlvPalette
object attached to this object is written out by the object containers. All other information, such as the position and size of the object, is written out by this virtual member function.
For example, suppose we have an IlvLabel
class that implements a graphic object drawn as a text string at a given position. It maintains its position in an internal IlvPoint
field called _position
and its textual content in an internal character array field called _text
. The only information we need to save is the contents of those fields. So, the member function write
of such an object should have the following form:
void IlvLabel::write(IlvOutputFile& file) const { // Save the position field file.getStream() << IlvSpc() << _position; // Save the text field IlvWriteString(file.getStream(), _text); }
output | The the output file to be written to. |
DeclareTypeInfo
. Reimplemented from IlvRectangle.
Reimplemented in IlvReliefLabel.
© 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.