Skip to content

The Complete Public Interface

The messages listed in Object Shadowing and Item Shadowing will handle almost all of your interface needs. This section provides additional messages that may be required for more advanced usage. Below is a list of the complete public object and item-shadowing interface.

Enabled State — boolean — true | false

Sets the object’s inherent shadow state. When this property is set, the object and all of its descendants are notified of the change as required. Changing this property will not affect the object’s actual shadowed state if an ancestor’s enabled_state is false.

Get enabled_state ascertains whether an object is actually shadowed regardless of whether inherently or contextually. If false, the object is shadowed and all of its descendants are shadowed (they cannot be entered). If true, the object is not shadowed (it is enterable) and none of its descendants is contextually shadowed by this object.

Note that the Get and Set versions of the enabled_state message are not true mirrors of each other. While this may seem illogical, it is designed to generate fewer programming errors. Most often, a program will explicitly set an object’s shadow state (set enabled_state), but will need to know whether an object is enterable (get enabled_state) regardless of how it got that way. If you need to know if an object’s shadow state has been explicitly set, you will need to query the explicit_shadow_state property. Get explicit_shadow_state is the true converse of set enabled_state.

Explicit Shadow State — boolean — true | false

This returns the object’s inherent shadow state. If true, this object’s shadow state has been explicitly set with a set enabled_state message. If false, it has not been set explicitly. When false, this property does not tell you whether the object is actually shadowed. This property should not be set.

Implicit Shadow State — boolean — true | false

This indicates if an object is contextually shadowed by an ancestor. This property should not be set.

The properties implicit_shadow_state, explicit_shadow_state, and enabled_state interact in the following manner:

Explicit Shadow State Implicit Shadow State Enabled State
True True False
True False False
False True False
False False True

Shadow Display — procedure

This procedure is called whenever a change in shadow state occurs, or when an object is paged. It is used to properly set the display to reflect an enterable or non-enterable object. By default, this sets visual attributes that are consistent with enabled and non-enabled objects in Windows. You may use this to set other custom conditions. This message should be forwarded and it is meant to be used as part of object shadowing and not item shadowing.

When augmenting this procedure, you may access the current shadow condition of the object by querying the enabled_state property and, in more unusual conditions, the implicit_shadow_state and explicit_shadow_state properties.

Item Shadow State item_num — boolean — true | false

This is used to set and get the shadow state of a single item. This is not needed in single-item objects, for which the state of the object is applicable.

Shadow State [item_num] — boolean — true | false

The shadow_state property is provided primarily for legacy purposes. In prior revisions of DataFlex for Windows, it was used at times for object shadowing and at times for item shadowing. Because of this dual purpose, its use will always be somewhat confusing. It is probably easier to choose not to use this property at all and to use the properties enabled_state and item_shadow_state instead. Therefore, you are encouraged not to use get/set shadow_state in your programs.

shadow_state has been configured to do the most logical thing based on the class of the object. If an object is not multi-item, shadow_state works the opposite of enabled_state. If the object is multi-item, the property works the same as item_shadow_state.

In single and no-item objects (non-multi-item), the following pairs are equivalent:

Set Shadow_State to True  // Set enabled_state to false
If (Shadow_State(Self, 0))..  // If(Object_Shadow_State(Self))..

Note that when using shadow_state in an expression, an item number must be passed.

This pair is inversely related:

Get Shadow_State to var  // Get enabled_state to var

In multi-item objects, the following are equivalent:

Set Shadow_State 3 to True  // Set Item_Shadow_State 3 to True
Get Shadow_State 4 to state  // Get Item_Shadow_State 4 to state
If (Shadow_State(Self, 5))..  // If(Item_Shadow_State(Self, 5))..

See Also

Shadowing