Using the Resource Editor to Design a Dialog Box
- When you create a project and use one of the Fortran AppWizards (for example, when using the Fortran Windows Application AppWizard).
- When you save the resources that you define using one of the Resource Editors.
- From theFilemenu, selectNew>Project...
- Select the Intel(R) Fortran Projects item.
- From the list of project types, select Console Application.
- EnterTempas the name for the project, verify where the project will be created, and click OK.
- In the Fortran Console Application Wizard, click Finish.
- The Solution View displays the solution.
- Click the plus sign (+) next to the project name to display the categories of source files, if necessary .
- From theFilemenu, selectAdd New Item...
- SelectResourceand change the name toTemp.rc. ClickOpen.
- Right-click on the .rc file in the Solution View, selectOpen With>Resource Editor.
- From theEdit>menu, selectAdd Resource... From the list of possible resources, selectDialog.
- Click the New button. The Dialog Editor (one of the resource editors) appears on the screen as shown below.
Combo box (such as a drop-down list box)
Scroll bar, horizontal
Scroll bar, vertical
- Point at one of the available controls in the Toolbox, then hold down the left mouse button and drag the control to the dialog box.
- Place the dialog control where you want it on the dialog box and release the mouse button. You can delete controls by selecting them with the mouse, then pressing the Delete (or DEL) key.
- Click on one of the controls in your dialog box and selectPropertiesfrom the pop-up (right-click) menu. A Properties window appears showing the default name and properties for that control.The following figure shows the Properties box for the Horizontal Scroll bar.Dialog Editor Sample 3
- Change the control name by modifying the ID property (currently,IDC_SCROLLBAR1) to another name (for example,IDC_SCROLLBAR_TEMPERATURE).
- Select the available options in the left column to change the control's properties.
INTEGER slide_position retlog = DLGGET (dlg, IDC_SCROLLBAR_TEMPERATURE, & slide_position, DLG_POSITION)
- SelectFile>Save All.Typically, only one resource file is used with each Intel Visual Fortran project (see Including Resources Using Multiple Resource Files).
- When you save your resource file for the first time, the resource editor also creates a Resource.h file. This file is included by the .RC file. To create the Fortran equivalent of this file (resource.fd), do the following:
- Add Resource.h to your project usingFile>Add Existing Item....
- Select the Resource.h file in the Solution View and the selectView>Property Pagesfrom the main menu bar.
- Set the Command Line option to use the deftofd tool by entering:deftofd resource.h resource.fd(For more information on the deftofd tool, see The Include (.FD and .H) Files.)
- Set the Description option toGenerating Fortran include file...
- Set the Outputs option toresource.fd.
- From theFilemenu, open the project .
- Double-click the RC file.
- Click the plus sign (+) next to Dialog.
- Double-click the appropriate dialog name, such as IDD_DIALOG1.
- Use the Resource Editor to add a new control or modify an existing control. To modify an existing control, use the Tab key to select the appropriate control. Now selectView>Properties Window(or, on the pop-up menu, clickProperties) to view or modify its properties.