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

DLG_DEFAULT

Same as not specifying a control index

DLG_ENABLE

The enable state of the control (value = .TRUE. means enabled, value = .FALSE. means disabled)

DLG_GAINFOCUS

A subroutine called when an Edit Box receives input focus.

DLG_IDISPATCH

The object pointer of an ActiveX control

DLG_LOSEFOCUS

A subroutine called when an Edit Box loses input focus

DLG_NUMITEMS

The total number of items in a List box, Combo box, or Tab control

DLG_POSITION

The current position of the Scroll bar, Spin, Slider, or Progress bar. Also, the current cursor position in the edit box.

DLG_RANGEMIN

The minimum value of a Scroll bar's, Spin's, Slider's, or Progress' position (default = 1 for scroll bar, 0 for other controls)

DLG_RANGEMAX

The maximum value of a Scroll bar's, Spin's, Slider's, or Progress' position (default = 100)

DLG_SELCHANGE

A subroutine called when the selection in a List Box or Combo Box changes

DLG_SELCHANGING

A subroutine called when the selected Tab control is about to be changed. In this subroutine, calling DLGGETINT with the index DLG_STATE refers to the Tab that was active before the change.

DLG_SMALLSTEP

The amount of change that occurs in a Slider's position when the user presses the keyboard arrow keys (default = 1)

DLG_STATE

The user changeable state of a control

DLG_TEXTLENGTH

The length of text in an edit box

DLG_TICKFREQ

The interval frequency for tick marks in a Slider (default = 1)

DLG_TITLE

The title text associated with a control

DLG_UPDATE

A subroutine called after the user has modified the control state but before the control has been updated on the screen

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.

Did you find the information on this page useful?

Characters remaining:

Feedback Message