ControlContext :: control - Get control contect
The function returns a subordinated control context by name or position. Whe the current control context is not valid or when the requested control context does not exist, the function throws an exception.
ControlContext classes are created for field ( ADK_Field ) as well as for control ( ADK_FieldControl ) resources.
When referring a field resource, the field context will overload the context implemented for the subordinated field control (control context).
Implementation overview
- Get context for a control by Name
ControlContext :: control ( sControl ) - Get control context at position
ControlContext :: control ( iPosition )
Implementation details
-
Get context for a control by Name
odabagui::ControlContext & ControlContext  :: control ( odaba::String &sControl )
The function searches for a subordinated control context with the name passed in sControl . When a name has been used several times, the function returns the context for the first control with the given name. Since control names are re-used frequently, field() might return a more precise result.
When passing an empty control name, the function returns the context of the current control.
The control name might be defined as context path, which refers to the control hierarchy starting with the current control. In order to go up one or more levels in the hierarchy, a corresponding number of dots may precede the path.
In order to avoid possible exceptions, one may check the existence of the cotrol by calling controlExist() .
control("city"); // search city control in current control
control("..city"); // search city control in parent-parent-control
control("address.city"); // search city control in subordinated address form
- sControl
- Control name
The control name is the name of the control resource as being defined within the parent control.
"city" // search city control in current control
"..city" // search city control in parent-parent-control
"address.city" // search city control in subordinated address form
to list
- sControl
- Control name
-
Get control context at position
odabagui::ControlContext & ControlContext  :: control ( int32 iPosition )
The function returns the context for the control at position passed in iPosition . iPosition must be greater or equal to 0 and less than the value returned from controlCount() . Otherwise, the function throws an exception.
- iPosition
- Position in collection
The position of an entry in a collection or list is the number of the entry in the collection beginning with 0 for the first entry.
to list
- iPosition
- Position in collection