need help with code, I am trying to have two clickable response buttons on a slide

Anne-Wil liwenna at gmail.com
Mon Jul 16 07:20:50 UTC 2012


... and the attachment...


On Monday, 16 July 2012 09:19:39 UTC+2, Anne-Wil wrote:
>
> Hey David,
>
> I clearly misunderstood what you meant with leftbutton and rightbutton - 
> those are the names of the boxes, I realize now.
>
> Glad you got that part working. For the changing colors when mouse hoovers 
> over part: I don't think you can really help you with that one - as I never 
> did that myself. 
>
> I do think you might want to use a different set-up in that case. The 
> script that is used to read out the mouseclicklocation is only accessed 
> after the termination of the slide - in order to have anything happening 
> (i.e. mouse location being read out and acted upon during the showing of 
> the slide) you'd need a script that is accessed before the slide and 
> continues during the slide (the do while type loops that you already tried 
> to implement). My gut feeling tells me that such a script might not work 
> with the ready made "buttons" (text/imageboxes), but perhaps it will if you 
> draw the buttons yourself (in that very same script preceding the slide) 
> using canvas drawing commands. 
>
> Attached is a questionnaire script, which I believe evolved from the 
> ratingscale script provided by PST. In the inline preceding the 
> questionslide answerboxes are being drawn, then the slide is shown and then 
> in the inline following the slide, the mouseclick is assessed, the 
> buttoncolour changes and remains visible for a little bit longer, and the 
> response is logged and processed. Clicks outside the answerbuttons load to 
> a backbutton, similar to your set-up. 
>
> What this program does not do is changing the colour of buttons while a 
> mouse hovers over. I think I tried to get it like that "back then" but 
> didn't manage to do so. I then concluded that the slide needs to be 
> terminated, altered and reshown for this to happen and that that simply 
> takes a bit too long to give a natural feeling to the participant operating 
> the mouse (as if the program stalls). However, back then I wasn't much 
> aware of do-while loops, perhaps those may make it possible. Anyone else's 
> input could be useful on that one? :)
>
>
> Good luck and please let us know if it works out! :)
>
> Best,
>
> Anne-Wil 
> On Monday, 16 July 2012 05:32:57 UTC+2, David Wang wrote:
>>
>> Now I have a new question. The two buttons I used are text boxes (light 
>> gray background, Bold black font).
>>
>> To make the buttons more realistic, I am trying to have the background 
>> color change when my mouse hovers over them.
>>
>> No clicking will happen, I simply want the program to monitor the 
>> location of the cursor; and when the cursor is over the buttons, the 
>> backcolor of the buttons can change.
>>
>> I am sorry to bother you again, but I do need help :(
>>
>> My thought is to 
>>
>>
>>
>> dim leftbutton as rect
>> (is this correct? leftbutton is the string name of a button on the slide.)
>>
>> Dim curPoint As Point    'mouse over
>> Dim ETTime As Long
>> ETTime = Clock.Read
>> Dim ETTimeInterval As Long
>> ETTimeInterval = 10
>>
>>
>> '---loop the positioning mechanism before a response is made
>> Do While Slide5.InputMasks.Responses.Count = 0
>>
>>     '===  request eye or mouse data every ETTimeInterval ms
>> If (Clock.Read > ETTime)  Then
>>
>>         'Set the next log time
>>         ETTime = Clock.Read + ETTimeInterval
>>
>>
>>
>>
>>         '---- highlight AOI ( mouse over )
>>         Mouse.GetCursorPos curPoint.x, curPoint.y
>>  
>>  
>>            
>>                 If PointInRect(curPoint,leftbutton ) Then     'This I 
>> don't understand. Am i in the right path to make a textbox a rect in the 
>> inline, then use it in a pointinrect and color change command?
>>                     leftbutton.BackColor =  color.silver
>>                     leftbutton.Draw
>>                 Else
>>                     leftbutton.BackColor = color.gray    
>>                     leftbutton.Draw
>>                 End If
>>      
>>
>>
>> end if
>> loop
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To view this discussion on the web visit https://groups.google.com/d/msg/e-prime/-/rADC-C69IBEJ.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20120716/9ca0de26/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: panas.es2
Type: application/octet-stream
Size: 93120 bytes
Desc: not available
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20120716/9ca0de26/attachment.obj>


More information about the Eprime mailing list