Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Views User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

9.2 Property Objects

Objective Views stores property values as objects in a cache. The CODProperty class is the base class for property values. Classes derived from CODProperty represent either specific data types or nested properties. A nested property is a container for other property values. The CODProperty class ties a property value and a property ID into a single object.

Property value objects are usually accessed only through a property container interface. The CODComponent class does provide methods for accessing property value objects directly, however it is usually more convenient to get and set property values through the property container interfaces. It is sometimes useful to manipulate nested or compound properties directly.

The description of a property is maintained by a separate object, which is an instance of the CProperty class defined by the SFL Properties package. The CProperty class implements the IProperty interface, which provides access to the ID, name, description, data type, and other information that describes a property. Storing the value of a property separately from its registered description is more efficient in terms of space. The CODProperty class and its derivatives only store the property ID and property value and should not be confused with SFL's CProperty class and IProperty interface. The CODProperty class and its derivatives are described below.

9.2.1 CODProperty

The CODProperty class is the base class for property values. It stores a property ID and has a group of GetValue() and SetValue() methods for storing and retrieving the property value. The GetValue() and SetValue() methods are overloaded for various data types and the default implementation for these methods throws the exception CODPropertyConversionException. Classes derived from CODProperty override the appropriate GetValue() and SetValue() methods. Classes derived from CODProperty represent either specific data types such as string, integer, or Boolean properties or they represent nested properties. A nested property is a property that contains other property values and implements the IODPropertyContainer interface.

9.2.2 CODBoolProperty

The Boolean property represents a simple Boolean value.

9.2.3 CODEditProperties

The edit properties determine what actions the end-user can take on a particular component. This is a nested property that contains the following sub-properties.

9.2.4 CODFillProperties

This is a nested property that describes the brush used to fill the interior of a component. Note that only components with closed interiors can be filled. The CODFillProperties class contains data members that describe a GDI brush. The CreateBrush() member function creates a brush using the fill properties and returns it to the caller. The GetBrush() member function returns a cached brush that matches the fill properties. The CODFillProperties class contains the following sub-properties.

9.2.5 CODFontProperties

This is a nested property that describes the font used for text drawn by a component. The CODFontProperties class contains data members that describe a GDI font. The CreateFont() member function creates a font using the font properties and returns it to the caller. The GetFont() member function returns a cached font that matches the font properties. The CODFontProperties class contains the following sub-properties.

Note that setting the point size of the font recalculates the font height and vice versa. The point size and the font height are two different ways of measuring the size of the font, so they are kept synchronized.

9.2.6 CODIntProperty

The integer property represents a simple integer value.

9.2.7 CODLineOrientation

The line orientation property determines the orientation of an object in relation to a line. This class can be used to orient labels and other components along a given line or link. CODLineOrientation is a nested property that contains the following sub-properties.

The orientation consists of a percentage along the given line, an anchor point, and an offset value. The percentage along value is used to calculate a position on the line based on a percentage of the line length. The anchor point is an OD_CONTROL_POINT value that indicates the point on the label or component that should coincide with the calculated point on the line. The offset value is a distance in logical units away from the line to offset the final calculated point. This is a distance along an imaginary perpendicular bisecting line.

9.2.8 CODLineProperties

This is a nested property that describes the pen used to draw the lines and vector graphics of a component. The CODLineProperties class contains data members that describe a GDI pen. The CreatePen() member function creates a pen using the line properties and returns it to the caller. The GetPen() member function returns a cached pen that matches the line properties. The CODLineProperties class contains the following sub-properties.

It is important to note that due to limitations in the MFC graphics implementation, only lines of width zero (meaning they are always drawn one pixel wide) can have a style other than solid.

9.2.9 CODOrientationProperties

The orientation properties determine how a label component is positioned in relation to its associated symbol component. You can set label components to appear at a predefined place, such as centered below the symbol, or they can be free floating. CODOrientationProperties is a nested property containing the following sub-properties.

9.2.10 CODStringProperty

The string property represents a simple string value.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.