Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Modifies an attribute depending on a condition. More...
#include <ilviews/protos/condacc.h>
Public Member Functions | |
IlvConditionAccessor (const char *name, const IlvValueTypeClass *type, IlvDisplay *display, IlvConditionAccessorOperator op, const char *operand, const char *assignedAttribute, const char *valueIfTrue, const char *valueIfFalse=0) | |
Creates a new condition accessor. | |
Protected Member Functions | |
virtual IlBoolean | changeValue (IlvAccessorHolder *object, const IlvValue &val) |
Called by the method IlvAccessible::changeValue for each IlvAccessor attached to the IlvAccessorHolder . |
Modifies an attribute depending on a condition.
Library: ilvproto
For example, a condition accessor can be defined to change the foreground of an object to red when the accessor value is greater than 100. Several condition accessors can be defined with the same name, which allows several conditional side-effects to be performed.
IlvConditionAccessor::IlvConditionAccessor | ( | const char * | name, | |
const IlvValueTypeClass * | type, | |||
IlvDisplay * | display, | |||
IlvConditionAccessorOperator | op, | |||
const char * | operand, | |||
const char * | assignedAttribute, | |||
const char * | valueIfTrue, | |||
const char * | valueIfFalse = 0 | |||
) |
Creates a new condition accessor.
The accessor value is used as the left-hand side of the condition, and operand is used as the right-hand side. When the accessor value is modified, the condition is evaluated. If the result is IlTrue
, the attribute specified by assignedAttribute is assigned the value valueIfTrue. If the result is IlFalse
and if valueIfFalse is non-null, the attribute specified by assignedAttribute is assigned valueIfFalse. The values operand, valueIfTrue, and valueIfFalse can contain a constant value, the name of another accessor, or an arithmetic expression that can contain accessor names and/or constants (see IlvUserAccessor::getValue
).
name | Name of the attribute. | |
type | Type of the attribute. Used only for initialization purposes. | |
display | A display used to initialize attributes that might be display-dependent. | |
op | Comparison operator. Can be one of:
| |
operand | Operand against which the current attribute of name name is tested.. | |
assignedAttribute | Attribute changed when the test is evaluated. | |
valueIfTrue | Value assigned to assignedAttribute if the test evaluates to IlTrue . | |
valueIfFalse | Value assigned to assignedAttribute if the test evaluates to IlFalse . |
© 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.