Using Intel® Visual Fortran to Create and Build Windows*-Based Applications

ID 757211
Date 7/23/2021
Public
Document Table of Contents

Using Control Indexes

The value of a dialog control's index is set with the DLGSET functions: DLGSET, DLGSETSUB, and DLGSETCHAR , DLGSETLOG, DLGSETINT. The control name and control index name are arguments to the DLGSET functions and specify the particular control index being set. For example:

   retlog = DlgSet( dlg, IDC_SCROLLBAR_TEMPERATURE, 45, DLG_POSITION )

The index DLG_POSITION specifies the scroll bar position is set to 45. Consider the following:

   retlog = DlgSet( dlg, IDC_SCROLLBAR_TEMPERATURE, 200, DLG_RANGEMAX )

In this statement, the index DLG_RANGEMAX specifies the scroll bar maximum range is set to 200. The DLGSET functions have the following syntax:

            result = DLGSET (dlg, control_name, value, control_index_name)

The control_index_name determines what the value in the DLGSET function means.

The control index names are declared in the module IFLOGM.MOD and should not be declared in your routines. Available control indexes and how they specify the interpretation of the value argument are listed in the following Control Indexes table.

Control Index

How the Value is Interpreted

DLG_ADDSTRING

Used with DLGSETCHAR to add an entry to a List box or Combo box

DLG_BIGSTEP

The amount of change that occurs in a Scroll bar's or Slider's position when the user clicks beside the Scroll bar's or slider's slide (default = 10)

DLG_CHANGE

A subroutine called after the user has modified a control and the control has been updated on the screen

DLG_CLICKED

A subroutine called when the control receives a mouse-click

DLG_DBLCLICK

A subroutine called when a control is double-clicked

The index names associated with dialog controls do not need to be used unless there is more than one variable of the same type for the control and you do not want the default variable. For example:

  retlog = DlgSet(dlg, IDC_SCROLLBAR_TEMPERATURE, 45, DLG_POSITION)
  retlog = DlgSet(dlg, IDC_SCROLLBAR_TEMPERATURE, 45)

These statements both set the Scroll bar position to 45, because DLG_POSITION is the default control index for the scroll bar.

Dialog Indexes

The control identifier specified in DLGSETSUB can also be the identifier of the dialog box. In this case, the index must be one of the values listed in the Dialog Indexes table:

Dialog Index

How the Value is Interpreted

DLG_INIT

A subroutine called after the dialog box is created but before it is displayed (with callbacktype=DLG_INIT) and immediately before the dialog box is destroyed (with callbacktype=DLG_DESTROY).

DLG_SIZECHANGE

A subroutine called after the dialog box is resized.

For more information on dialog controls, see Available Indexes for Each Dialog Control.