GenValue: 3.3 GenValue Basics: The Increment

Up: GEOS SDK TechDocs | Up | Prev: 3.2 The Minimum and Maximum | Next: 3.4 GenValue States
GVLI_increment, MSG_GEN_VALUE_GET_INCREMENT, MSG_GEN_VALUE_SET_INCREMENT, HINT_VALUE_INCREMENTABLE, HINT_VALUE_NOT_INCREMENTABLE

The GVLI_increment instance field stores the fixed point increment value for a GenValue. The increment value is the amount by which the current value (in GVLI_ value ) may increase or decrease when that value is changed by UI controls. The increment value can be any positive fixed point value between one and 65535.

If GVLI_ increment is greater than the possible range of the GenValue (the distance between minimum and maximum), then incrementing or decrementing the GenValue will toggle GVLI_ value between its maximum and minimum.

Code Display 8-5 Setting Minimum, Maximum, Increment Values

@object GenValueClass MyValue = {
    GI_visMoniker = "My Value";
    GVLI_value = MakeWWFixed(1.0);
    GVLI_minimum = MakeWWFixed(-100.0);
    GVLI_maximum= MakeWWFixed(100.0);
    GVLI_increment = MakeWWFixed(5.0);
}

You may change the fixed point value of this increment with MSG_GEN_VALUE_SET_INCREMENT . You may also return the current increment stored within GVLI_ increment with MSG_GEN_VALUE_GET_INCREMENT . You may wish to change a GenValue's increment one GenValue is being used for multiple roles and must change its increment value.

By default, all GenValues are incrementable. If you do not wish to have your GenValue provide UI controls for incrementing (or decrementing) its value, add HINT_VALUE_NOT_INCREMENTABLE in its instance data. HINT_VALUE_INCREMENTABLE provides the default behavior. (You may still increment or decrement the value manually with MSG_GEN_VALUE_INCREMENT or MSG_GEN_VALUE_DECREMENT .)

MSG_GEN_VALUE_SET_INCREMENT

void	MSG_GEN_VALUE_SET_INCREMENT (
        WWFixedAsDWord 		value);

This message sets the GVLI_increment field to the passed value .

Source: Unrestricted. This message is also used internally when the GenValue is being built.

Destination: Any GenValue object.

Parameters: value fixed point value to set GVLI_ increment to.

Return: Nothing.

Interception: Generally not intercepted.

MSG_GEN_VALUE_GET_INCREMENT

WWFixedAsDWord MSG_GEN_VALUE_GET_INCREMENT();

This message returns the value of the GVLI_increment field of the GenValue.

Source: Unrestricted.

Destination: Any GenValue object.

Parameters: None.

Return: The fixed point value of GVLI_ increment .

Interception: Generally not intercepted.


Up: GEOS SDK TechDocs | Up | Prev: 3.2 The Minimum and Maximum | Next: 3.4 GenValue States