Where there is only one possibility for a particular dialog control's index type (integer, logical, character, or subroutine), you do not need to specify the control index name in an argument list. For example, you can set the Static text control
to a new value with either of the following statements:
retlog = DLGSETCHAR (dlg, IDC_TEXT_CELSIUS, "New Celsius Title", &
retlog = DLGSET (dlg, IDC_TEXT_CELSIUS, "New Celsius Title")
You do not need the control index
because there is only one character index for a Static text control. The generic function
chooses the control index to change based on the argument type, in this case CHARACTER.
For each type of index, you can use the generic
function or the specific
function for that type:
For example, you can disable the Static text control
by setting its logical value to .FALSE. with either
retlog = DLGSETLOG (dlg, IDC_TEXT_CELSIUS, .FALSE., DLG_ENABLE)
retlog = DLGSET (dlg, IDC_TEXT_CELSIUS, .FALSE., DLG_ENABLE)
In both these cases, the control index
can be omitted because there is only one logical control index for Static text controls.
You can query the value of a particular control index with the
. For example:
retlog = DLGGET (dlg, IDC_SCROLLBAR_TEMPERATURE, current_val, &
retlog = DLGGET (dlg, IDC_SCROLLBAR_TEMPERATURE, are_you_enabled, &
This code returns the maximum range and the enable state of the scroll bar. The arguments you declare (
in the preceding example) to hold the queried values must be of the same type as the values retrieved. If you use specific
functions such as
, the control index value retrieved must be the appropriate type. For example, you cannot use
to retrieve an integer or logical value. The
functions return .FALSE. for illegal type combinations. You cannot query for the name of an external callback routine.
In general, it is better to use the generic functions
rather than their type-specific variations because then you do not have to worry about matching the function to the type of value set or retrieved.
perform the correct operation automatically, based on the type of argument you pass to them.
More information on these routines is available in the