Hi Kevin,

they really turn out to be exactly like working with a checkbox; that is,
you work with each radio button as if it were a stand-alone control such as
a checkbox.  you don't have to do anything which references the other radio
buttons in the group; WE will handle this for you.

Below is an example of my event handler declaration line, and part of the
case statement where I handle one radio button; except for the actual event
constant I'm testing against, you can't really tell that handling it is much
different from handling a checkbox.  

you'll also need to initialize the particular radio button which is the
default in the dialog creation portion (there, you would reference the
control by  it's name the Way Jeff did in his example for you; that is, you
have to use the dialog object, and use it's controls property, which is a
collection, pass in the name of the radio button you want to set to true,
and you'll get back a radio button object which you can use to set it's
.checked property to true).  I'll add a bit of the dialog creation code down
below as well to show this.


Function preferencesDialogEventHandler(dObj, dEvent, dId, _
dControl)
' ...


Select Case dId
Case "table_headers_first_cell"
' above is the ID of the particular radio button I'm testing for; you'll
have to have a CASE like this for each radio button
        If dEvent = radiobuttonClicked Then
                dControl.Checked = True ' this shifts the radio button
selection on the screen to this button
                preferencesDialogEventHandler = True
' and here you'd put some code to deal with the radio button which is
particular to your app
        End If

Case Else
' now for the choices which are not related to a specific control
        If dEvent = dialogCreated Then
' initialize a particular radio button to be the default
                dObj.control("table_headers_off").Checked = True
        end if
end select
 
hth,

Chip

-----Original Message-----
From: Kevin Huber [mailto:[email protected]] 
Sent: Wednesday, August 17, 2011 1: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

Reply via email to