company logo

ControlContext :: activated - Activated property

The activated property indicates, whether a control is connected with its data (true) source or not (false). The active state is a hierarchical state, i.e. activating or deactivating a control will activate/deactivate all subordinated controls.

Deactivating a control becomes necessary, when the data source changes. Usually, property(rProperty) is called in order to set a new data source. In this case, deactivate and activate is done by the property() function. When, however, just re-opening the data source (Property::open()), the application explicitly must deactivate the control before re-opening the property handle and activating it afterwards calling activated().

... fragment ( ControlContext control, String new_path ) {

  control.activated(false); // deactivate control

  // reopen datasource

  control.property.open(control.database,new_path);

  control.activated(true);  // activate control

}

Return value:  State of function return ( bool  )

A State true indicates, that the function was executed successfully. Otherwise state is false.

Implementation overview

Implementation details

  1. Is conbtrol activated?
    bool ControlContext  :: activated (  )

    The function returns, whether the control is activated (true) or not (false).

  2. to list
  3. Change active state for control
    bool ControlContext  :: activated ( bool bEnable )

    In order to reactivate the control, true should be passed in bEnable. Activating a control will re-open the data source for the control and activate all subordinated controls.

    In order to deactivate the control, false has to be passed in bEnable. Deactivating a control will close the data source for the control and deactivate all subordinated controls. One should activated(true) in order to re-activate the control. Deactivated controls are visible but not filled and appear similar as disabled controls.

    • bEnable - Enable resource

      In order to enable the referenced resource true should be passed. Passing false will disable the resource.

  4. to list