Skip to content

Object Shadowing

An object may be shadowed inherently or contextually. An object is inherently shadowed when its own shadow state has been set to true. An object is contextually shadowed when one of its ancestors’ shadow states has been set to true. In this latter situation, the object’s inherent shadow state is of no effect, but the value of the property remains (latently) present in the object.

The primary interface for object shadowing consists of the following messages:

Set enabled_state to True | False
This sets the object’s explicit shadow state. When this property is false, whether the object will actually be shadowed is a function of this property and the state of its ancestors’ enabled_state.

Get enabled_state to variable
This returns whether an object is shadowed, whether explicitly or implicitly.

Example

In the following example, the checkbox will determine if the radio-group object should be shadowed. When selected, the checkbox will send a message to its sibling radio-group object, passing a parameter to it indicating if the radio (and all of its children) should be shadowed.

Object MyContainer is a Container3d
    Set Size to 80 80
    Set Location to 10 10

    Object MyCheckbox is a CheckBox
        Set Location to 10 10
        Set Label to "Disable Radios"

        Procedure OnClick
            Integer iSelState
            Get Select_State to SelState
            Register_Object oMyRad
            Send Disable to oMyRad iSelState
        End_Procedure
    End_Object

    Object MyRad is a RadioGroup
        Set Label to "My Radio Group"
        Set Size to 50 50
        Set Location to 25 10

        Object R1 is a Radio
            Set Location to 10 10
            Set Label to "Option 1"
        End_Object

        Object R2 is a Radio
            Set Location to 25 10
            Set Label to "Option 2"
        End_Object

        Procedure Disable Integer iSelState
            Set enabled_state to (not(iSelState))
        End_Procedure
    End_Object
End_Object

See Also

Shadowing