rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvViewRectangle Class Reference

Graphic class. More...

#include <ilviews/graphics/rectview.h>

Inheritance diagram for IlvViewRectangle:
IlvFilledRectangle IlvRectangle IlvSimpleGraphic IlvGraphic IlvContainerRectangle

List of all members.

Public Member Functions

 IlvViewRectangle (IlvDisplay *display, const IlvRect &rect, IlvPalette *palette=0)
 Constructor.
virtual void applyTransform (const IlvTransformer *t)
 Applies a transformation function to the graphic object.
const char * className () const
 Returns the class name of an object.
virtual IlvGraphiccopy () const
 Copies this object.
virtual IlvViewcreateView (IlvAbstractView *parent, const IlvRect &size)
 Creates the view.
virtual void draw (IlvPort *, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the graphic object.
virtual IlvClassInfogetClassInfo () const
 Gets class information.
virtual IlvViewgetView () const
 Retrieves the view of this object.
void hide ()
 Hides the view.
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 makeView (IlvPort *dst, const IlvTransformer *t=0)
 Sets up the view.
virtual void setBackground (IlvColor *)
 Sets the background color of the object.
virtual void setPalette (IlvPalette *)
 Sets the internal palette to the given palette value.
virtual void setView (IlvView *view)
 Sets the view of this object.
void show ()
 Shows the view.

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 IlvClassInfoHasProperty (const IlSymbol *key, IlBoolean p=((IlBoolean) 0))
 Checks for the existence of a property for this object's class hierarchy.
static IlvGraphicread (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.

Detailed Description

Graphic class.

Library: views

The IlvViewRectangle class lets the user create a special object that contains an actual instance of the class IlvView. This lets you create a graphic object that stores a view, and that can be connected with external objects.

This class is the most general, allowing you to associate any kind of view. Other classes are provided to treat specific kinds of views such as IlvGadgetContainer. There are also classes to associate a view with an instance of IlvManager (see the classes IlvManagerRectangle, IlvSCManagerRectangle, and IlvSCGrapherRectangle.

IlvViewRectangle and its subclasses are graphic objects (IlvGraphic subclasses). Graphic objects do not know where they will be stored when created and they can be displayed in different views simultaneously. To create its inner view object before actually being drawn the IlvViewRectangle object must know its parent view. IlvViewRectangle can also explicitly request a makeView call whose parameter is the port where the destination view must be.


Constructor & Destructor Documentation

IlvViewRectangle::IlvViewRectangle ( IlvDisplay display,
const IlvRect rect,
IlvPalette palette = 0 
)

Constructor.

Although the object is ready to be used after the constructor is called, the actual view is not created until the first draw or makeView call.

Parameters:
display The display instance.
rect Specifies the geometry of the object.
palette The palette used to set the background color of the encapsulated view object.

Member Function Documentation

static void IlvViewRectangle::AddProperty ( const IlSymbol key,
IlAny  value 
) [static]

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.

Parameters:
key The key to be associated.
value The value to be associated.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

virtual void IlvViewRectangle::applyTransform ( const IlvTransformer t  )  [virtual]

Applies a transformation function to the graphic object.

Applies the transformer t to the shape of the object. Unless the transformation is a scaling operation, the result of applying it to certain objects can be insignificant. For example, applying a non-scaling transformer to an IlvRectangle object is meaningless, since the rectangle remains a rectangle. On the other hand, meaningful transformations can be applied to objects that are instances of types such as IlvLine or IlvPolyPoints.

Warning:
[note] applyTransform is one of the most important method to be rewritten for classes derived from IlvGraphic, since it is called by the resize, move, moveResize, scale, etc., methods.
Parameters:
t The transformer value. If 0, no transformation is performed.

Reimplemented from IlvRectangle.

const char* IlvViewRectangle::className (  )  const

Returns the class name of an object.

This method is equivalent to getClassInfo()->getClassName().

Returns:
The class name of the object. For example, for an IlvRectangle object, the className function returns "IlvRectangle".

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

virtual IlvGraphic* IlvViewRectangle::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.

Returns:
A copy of the object.
See also:
IlvPredefinedIOMembers.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

virtual IlvView* IlvViewRectangle::createView ( IlvAbstractView parent,
const IlvRect size 
) [virtual]

Creates the view.

The new view object is created visible. This virtual member function lets you create graphic objects that store new types of IlvView objects. This member function is called by makeView.

Parameters:
parent The parent view of the created view.
size The dimensions of the view that is created.
See also:
makeView.

Reimplemented in IlvContainerRectangle.

virtual void IlvViewRectangle::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.

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

virtual IlvClassInfo* IlvViewRectangle::getClassInfo (  )  const [virtual]

Gets class information.

Returns a pointer to the IlvClassInfo object associated with this object's class.

Returns:
A pointer to the class information object of the class of this object.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

static IlAny IlvViewRectangle::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.

Parameters:
key The key with which the property value is associated.
checkSuperClass IlTrue specifies iterative search on superclasses.
Returns:
The property value associated with the proper name key, or 0.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

virtual IlvView* IlvViewRectangle::getView (  )  const [virtual]

Retrieves the view of this object.

Returns:
A pointer to the view that has been created by this object. If the objects has not yet been displayed, this pointer can be 0.
static const IlvClassInfo* IlvViewRectangle::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.

Parameters:
key The key with which the property value is associated.
checkSuperClass IlTrue specifies iterative search on superclasses.
Returns:
A pointer to the ClassInfo that indicates a class where the key property exists, or 0.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

IlBoolean IlvViewRectangle::isSubtypeOf ( const IlvClassInfo classInfo  )  const

Checks whether this object's class is a subclass.

This method is equivalent to getClassInfo()->isSubtypeOf(classInfo).

Parameters:
classInfo The name of a class on which the object's class is tested.
Returns:
Either 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 IlvContainerRectangle.

IlBoolean IlvViewRectangle::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).

Parameters:
parentClass A string representing the parent class.
Returns:
Either 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 IlvContainerRectangle.

virtual void IlvViewRectangle::makeView ( IlvPort dst,
const IlvTransformer t = 0 
) [virtual]

Sets up the view.

Makes the IlvView object, meaning that is creates the view by calling the above createView member function, and sets the current background and the delete callback.

This function is called by draw when the view has not yet been created.

Parameters:
dst The destination port where the object is displayed.
t The transformer applied to the object's drawing.

Reimplemented in IlvContainerRectangle.

static IlvGraphic* IlvViewRectangle::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);
 }
Parameters:
file The name of the file to be read from.
palette The name of the palette for the object.
See also:
DeclareTypeInfoRO, DeclareTypeInfo, IlvPredefinedIOMembers.
Warning:
[note] The read method is not capitalized like other static methods so that it is consistent with the write method.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

static IlBoolean IlvViewRectangle::RemoveProperty ( const IlSymbol key  )  [static]

Removes a property from this object's class.

This static function removes the indicated property to the class of this object.

Parameters:
key The key property to be removed.
Returns:
IlTrue if the key property was actually found, or IlFalse otherwise.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

static IlBoolean IlvViewRectangle::ReplaceProperty ( const IlSymbol key,
IlAny  value 
) [static]

Replaces a property in this object's class.

This static function replaces the indicated property value to the class of this object.

Parameters:
key The key to be replaced.
value The value to be replaced.
Returns:
IlTrue if the key property was actually found, or IlFalse otherwise.

Reimplemented from IlvFilledRectangle.

Reimplemented in IlvContainerRectangle.

virtual void IlvViewRectangle::setBackground ( IlvColor background  )  [virtual]

Sets the background color of the object.

Sets the background color of the object.

Parameters:
background The new background color.

Reimplemented from IlvSimpleGraphic.

virtual void IlvViewRectangle::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.

Parameters:
palette The new palette of this object.

Reimplemented from IlvSimpleGraphic.

virtual void IlvViewRectangle::setView ( IlvView view  )  [virtual]

Sets the view of this object.

Parameters:
view The new view encapsulated in this graphic object. This view must not be a top-window.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© 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.