rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Prototypes Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvConditionAccessor Class Reference

Modifies an attribute depending on a condition. More...

#include <ilviews/protos/condacc.h>

Inheritance diagram for IlvConditionAccessor:
IlvUserAccessor IlvAccessor

List of all members.

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.

Detailed Description

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.

See also:
IlvTriggerAccessor.

Constructor & Destructor Documentation

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

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

  • IlvCondNoOp (No comparison performed)
  • IlvCondEqual (== test)
  • IlvCondNotEqual (!= test)
  • IlvCondLessThan (< test)
  • IlvCondGreaterThan (> test)
  • IlvCondLessOrEqual (<= test)
  • IlvCondGreaterOrEqual (>= test)
  • IlvCondOperator (the operand is a Boolean and its value determines the outcome).
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.
 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.