![]() Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
View rectangle class. More...
Public Member Functions | |
| IlvContainerRectangle (IlvDisplay *display, const IlvRect &rect, IlvPalette *palette=0) | |
| Constructor. | |
| const char * | className () const |
| Returns the class name of an object. | |
| virtual IlvGraphic * | copy () const |
| Copies this object. | |
| virtual IlvView * | createView (IlvAbstractView *parent, const IlvRect &size) |
| Creates the view. | |
| virtual IlvClassInfo * | getClassInfo () const |
| Gets class information. | |
| virtual IlvContainer * | getContainer () const |
| Returns a pointer to the encapsulated container object. | |
| const char * | getFilename () const |
| Returns the file name associated with this 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 | makeView (IlvPort *dst, const IlvTransformer *t=0) |
| Sets up the view. | |
| void | setFilename (const char *name, IlBoolean redraw=((IlBoolean) 0)) |
| Sets the name of the file associated with the container. | |
| 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. | |
View rectangle class.
Library: views
The IlvContainerRectangle class defines a graphic object that encapsulates an instance of IlvContainer. This instance can be associated with a file name. When the container is created, it reads the corresponding file.
IlvContainer. | IlvContainerRectangle::IlvContainerRectangle | ( | IlvDisplay * | display, | |
| const IlvRect & | rect, | |||
| IlvPalette * | palette = 0 | |||
| ) |
Constructor.
Initializes a new instance of the IlvContainerRectangle class.
| display | The connection to the display. | |
| rect | The size and position of the object. | |
| palette | The palette used to draw the object. The palette background color is set to the background color of the encapsulated container. |
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 IlvViewRectangle.
| const char* IlvContainerRectangle::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 IlvViewRectangle.
| virtual IlvGraphic* IlvContainerRectangle::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 IlvViewRectangle.
| virtual IlvView* IlvContainerRectangle::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.
| parent | The parent view of the created view. | |
| size | The dimensions of the view that is created. |
makeView. Reimplemented from IlvViewRectangle.
| virtual IlvClassInfo* IlvContainerRectangle::getClassInfo | ( | ) | const [virtual] |
Gets class information.
Returns a pointer to the IlvClassInfo object associated with this object's class.
Reimplemented from IlvViewRectangle.
| virtual IlvContainer* IlvContainerRectangle::getContainer | ( | ) | const [virtual] |
Returns a pointer to the encapsulated container object.
| const char* IlvContainerRectangle::getFilename | ( | ) | const |
Returns the file name associated with this object.
This file is read by the container upon its creation.
0 if there is none. | static IlAny IlvContainerRectangle::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 IlvViewRectangle.
| static const IlvClassInfo* IlvContainerRectangle::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 IlvViewRectangle.
| IlBoolean IlvContainerRectangle::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 IlvViewRectangle.
| IlBoolean IlvContainerRectangle::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 IlvViewRectangle.
| virtual void IlvContainerRectangle::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.
| dst | The destination port where the object is displayed. | |
| t | The transformer applied to the object's drawing. |
Reimplemented from IlvViewRectangle.
| static IlvGraphic* IlvContainerRectangle::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 IlvViewRectangle.
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 IlvViewRectangle.
| static IlBoolean IlvContainerRectangle::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.
| 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 IlvViewRectangle.
Sets the name of the file associated with the container.
This file is read by the container upon its creation.
| name | The name of the file to load. | |
| redraw | A Boolean value indicating whether to redraw the container or not. |
| virtual void IlvContainerRectangle::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.
© 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.