highlight a button in standalone+.rev app

Sarah Reichelt sarahr at genesearch.com.au
Sun Jul 3 18:35:43 EDT 2005


> I'd like to have just one button injector and a system to customise  
> the function
> of the button. What I envisage is a drop down list that enters a  
> script into the
> button. Is it possible (from an standalone) to highlight the button  
> in the
> cloned stack with something like a right click(just like
> in the rev IDE), then a prefernces window (which I'll create) pops  
> up with a
> popup button with the fnuctions.
>
> Then when I click on OK it enters the script into the highlighted  
> button.
>
> EG click on "OK" and it does something ,like this.
>
> On mouseup
> insert on mouseup & cr & dothisaction & cr & end mouseup into the  
> highlighted
> button of the last stack open
> end mopuseup
>

What about a script like this in your cloned stack's script:

on mouseUp pBtnNumber
   global gSelectedButton

   -- check if right mouse button is used and if it is clicked over a  
button
   if pBtnNumber = 3 and the name of the target contains "button" then
     put the target into gSelectedButton
     -- perhaps make some visual change to indicate the selected button
     -- change it's color, draw a box around it or something like that
   else
     pass mouseUp
   end if
end mouseUp

Then your "script insertion" script can use whatever is in the global  
gSelectedButton to set the script.

on mouseUp
   global gSelectedButton
   set the script of gSelectedButton to "on mouseUp" & cr & \
     "doThisAction" & cr & "end mouseUp"
end mouseUp


HTH,
Sarah





More information about the use-livecode mailing list