- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to use the group feature with radio buttons in Intel Visual Fortran?
I've achieved the effect by using call backs for each of the buttons, but is that the only way? I'm using MS Dev. Env. 2003 Ver. 7.1.3008, and the help describes how to do it, setting the group property to TRUE for the first radio button, right clicking on that button and selecting "add variable...", but it's grayed. Does anyone have a clue? Apparently the "add variable..." wizard works with "classes", and apparently FORTRAN projects have no classes.
help
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the Fortran code, however, you still have to process the message loop for the dialog, set the initial status of the group when the dialog opens (set which button is initially selected) and then read the buttons either as they are toggled, or when the dialog exits.
My experience (not that you asked) from doing this a lot, is that it is preferable to do the logic for your controls explicitly in the Fortran dialog code, rather than have it be an implicit part of the VS dialog setup where you can't see the code or the logic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
* Using Check Boxes and Radio Buttons and
* Using Dialog Boxes for Application Controls Overview
in the Intel Visual Compiler documentation (rather than Visual studio online help).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks to you both for your replies. As I now understand, to sum up, IVF itself does not support MFC, and so the resource file would have to be in a second project, a C++ project which supported MFC (an option in the C++ project). So the easiest route is to process the buttons in my own callback routine which saved a button specific value in a global variable whenever any of the buttons in the group was selected. Having the group property selected for the first in the group, having it set to false for the rest, and having the tab order correct, will ensure that only one of the buttons is selected at a time. So my callback will not have to handle that detail. After the dialog is dismissed, my global variable will indicate which of the buttons was selected at the time, so if that is all I need the callback is very simple.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now you got me thoroughly confused. You don't need MFC to deal with the dialogs at all; if I may drop a 2c, handling dialogs with MFC is probably one of most contrived ways to do so. You can use dialogs from an all-fortran solution, if you take a look at the help pages I referred to. Or are you saying that you're already using MFC and mixing it with Fortran code? Or...?john.walter@inl.gov:
Thanks to you both for your replies. As I now understand, to sum up, IVF itself does not support MFC, and so the resource file would have to be in a second project, a C++ project which supported MFC (an option in the C++ project).
A purely Fortran code with a dialog containing 3 radio buttons, OK and cancel button will look as simple as:
USE DFLOGM
INCLUDE "resource.fd"
LOGICAL:: ret, bRadio1, bRadio2, bRadio3
TYPE(Dialog):: Dlg
ret = DlgInit(IDD_DIALOG1, Dlg)
!Initialize e.g. radio2 to checked:
ret = DlgSet(Dlg, IDC_RADIO2, .TRUE.)
!Display the dialog:
IF (DlgModal(Dlg)==IDOK) THEN
ret = DlgGet(Dlg, IDC_RADIO1, bRadio1)
ret = DlgGet(Dlg, IDC_RADIO2, bRadio2)
ret = DlgGet(Dlg, IDC_RADIO3, bRadio3)
IF (bRadio1) THEN
...
ELSE IF (bRadio2) THEN
...
ELSE IF (bRadio3) THEN
...
END IF
END IF
call DlgUnInit(Dlg)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page