Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

dialog box application

rswy
Beginner
505 Views
Hi,
How do I detect changes made in a selection of radio buttons before I click on the Ok button in a modal dialog box.I want to be able to make and detect the changes in the selection of radio buttons even before I click Ok.
If I use the dlgmodal option, the selected button is known only after I hit on the Ok button.I want to be able to keep track of changes made in the choice of a given set of radio buttons.Should I use the dlgmodeless option?If yes,how do I use the GetMessage function to get the selected radio buttons?
--rswy
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
506 Views
Write a callback for each radio button from the group. Note that it can be the same callback routine:
EXTERNAL OnRadioButton
...
j = DlgSetSub(Dlg,IDC_RADIO_X,OnRadioButton)
j = DlgSetSub(Dlg,IDC_RADIO_Y,OnRadioButton)
j = DlgSetSub(Dlg,IDC_RADIO_Z,OnRadioButton)
...
SUBROUTINE OnRadioButton(Dlg,ID,iEvent)
TYPE(DIALOG):: Dlg
INTEGER::      ID, iEvent
INCLUDE "Resource.fd"
SELECT CASE (ID)
CASE (IDC_RADIO_X)
   !Do this
CASE (IDC_RADIO_Y)
   !Do that
CASE (IDC_RADIO_Z)
   !Do something
END SELECT
END SUBROUTINE OnRadioButton
0 Kudos
Reply