Radio Buttons
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Radio Buttons Expand / Collapse
Author
Message
Posted 8/18/2008 5:31:36 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/19/2008 6:17:05 PM
Posts: 3, Visits: 15
[font=Comic Sans MS]Hello,
I am trying to essentially use radio buttons as you would in Microsoft
visual studio and/or
other programs in E-Prime by inserting a script into an inline slide.
I was wondering if this
was even possible to use radio buttons in e-prime. And was wondering
if anyone actually had a script that would work to achieve this
desired design in the experiment. Thanks!
-Mary [/font]
Post #1965
Posted 8/19/2008 9:04:00 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Administrators
Last Login: Yesterday @ 9:26:59 AM
Posts: 576, Visits: 1,254
You would have to use images that looked like the radio buttons with a on/off version of each.  A number of users have implemented paradigms like this via the Slide object using "HitTest", but primarily for check boxes which are easier to keep track of the state.  Since radio buttons work as a group (only one can be selected) then some additional logic would need to be considered.
Post #1968
Posted 8/19/2008 12:59:19 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: Yesterday @ 4:03:21 PM
Posts: 34, Visits: 153
Just make an array of booleans to represent your radio buttons, and a function for making them all false.

When a button is pressed, call the function to clear them all, and set the one that was pressed as true.



Also, nice try with the comic sans.
Post #1969
Posted 8/19/2008 3:40:15 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/19/2008 6:17:05 PM
Posts: 3, Visits: 15
Brandon.Cernicky, Thanks for the reply but I am not sure what you mean by "HitTest"

RedTurtle,
Do you have any examples of a script that would involve an array of booleans? I am not quit sure what you mean by that and neither does my supervisor. Thanks for the reply though!

Post #1970
Posted 8/19/2008 4:21:08 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: Yesterday @ 4:03:21 PM
Posts: 34, Visits: 153
The following code makes an array of 4 booleans and sets the values. Then the contents of the array are ouput to the console.
Dim buttonArray(4) As Boolean

buttonArray(0) = false
buttonArray(1) = true
buttonArray(2) = false
buttonArray(3) = false

Dim i As Variant

For Each i In buttonArray
debug.print "i is " & i
Next i
Post #1971
Posted 8/26/2008 2:05:10 PM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: 10/30/2008 3:23:17 PM
Posts: 127, Visits: 924
(Cross-posted from the E-Prime Google Group)


Hi Mary,

While this is possible, it cannot be done directly through the E-Prime interface. What you would need to do is use two images - one would be an "empty" (not selected) radio button while the other would be a "full" (selected) radio button. You could then present these images as needed via a Slide object or the Canvas object. Script would be necessary in order to fill the radio button when it is clicked and/or empty the previously selected radio button should a new one be selected.

I would recommend taking a look at the LoadImageUponMouseClick.zip
sample experiment I have attached. This example is very close to what you have described, except that you would replace the "checkbox" images with radio button images. Note that this example allows the subject to select multiple items. Typically, radio buttons allow for only one response, so additional script would be necessary to restrict the subject in this manner.

Please let me know if you have any questions about the sample.


- Matt
PST Technical Consultant
http://pstnet.com


  Post Attachments 
LoadImageUponMouseClick.zip (6 views, 6.88 KB)
Post #1999
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 7:40am

Powered By InstantForum.NET v4.1.4 © 2009