Here is a sample event handler that I made.
I used two functions:
Function DialogEventHandler(dObj, dEvent, dId, dControl)
DialogEventHandler = False
Select Case (dId)
Case "button_cancel"
If dEvent = buttonClicked Then
Speak "Close dialog"
isVisible = 0
dObj.Close
DialogEventHandler = True
Exit Function
End If
Case "button_ok"
If dEvent = buttonClicked Then
Speak "ok"
GetSettings dObj, dEvent, dId, dControl
Sleep 200
Speak "Closing Dialog"
isVisible = 0
dObj.Close
DialogEventHandler = True
Exit Function
End If
Case Else
If dEvent = dialogCreated Then
isVisible = 1
DialogEventHandler = True
End If
End Select
End Function
Function GetSettings (dObj, dEvent, dId, dControl)
Num = 0
If dObj.Control("radiobutton_choice1").checked Then
Speak "You have selected choice 1! "
Num = 1
end If
If dObj.Control("radiobutton_choice2").checked Then
Speak "You have selected choice 2! "
Num = 1
End If
If dObj.Control("radiobutton_choice3").checked Then
Speak "You have selected choice 3! "
Num = 1
End If
If Num = 0 Then
Speak "You have not chosen any of the radio buttons! "
End If
End Function
Hth
Jeff Weiss
-----Original Message-----
From: Kevin Huber [mailto:[email protected]]
Sent: Wednesday, August 17, 2011 12:11 PM
To: gw-scripting
Subject: creating a dialog with radio buttons
Hi Chip:
I am trying to create a dialog in my ProofReading script in which the
user can set each of the proofreading options to his/her preference.
I have created the dialog using the UI Design App using a set of radio
buttons for each proofreading feature, and it appears on the screen
the way I had envisioned it.
I am not sure, however, how to deal with Radio buttons in an event
handler. I looked at the class 14 examples and they are very helpful,
but I need to find an example of an event handler which handles radio
buttons.
Can you, or anyone else, help me with this?
Kevin Huber