custom buttons

Thomas McGrath III 3mcgrath at adelphia.net
Wed Feb 25 19:15:52 EST 2004


Dar,

yeah, I am actually doing both. Two button state images by icon ID AND 
I need to put an icon on top of that final button.

So far I created a normal button(with my button look and feel as icon 
ids) and then laid an icon over top Then I grouped them and put in 
mouse handlers.
But mouseUp was not going through the top icon image to the button 
underneath. Now I got that working but when the button is pushed the 
icon over it stays in the same spot where as the bottom button goes 
down to the right on mouseDown and back up to the left on mouseUP or 
mouseLeave.

SO, I put a code that moves the top icon down to the left by 5,5 and in 
mouseUp by -5,-5. That works......

Now on mouseLeave I need to do something -- so i send a mouseUp on 
mouseLeave to the icon and it seems to work.

Now The problem is I have to have two scripts since the smaller top 
icon does not cover the bigger bottom button and the user may hit 
either. I would rather these codes were in the group and not the items 
but auto naming seems to work easier this way.

Makes you appreciate the internal methods rev uses to do these things a 
lot.

What message is it that a new button without and handlers receives to 
make it do the pushing in and out thing????
Message watcher reveals only mouseUp and mouseDown.

-----------------------------------
Here is my code as it stands now in the top icon.

on mouseUp
   move me relative -5,-5
   if the mouseLoc is within the rect of me then
   --execute the mouseUp code here
   beep -- then delete this
   end if
   pass mouseUp
end mouseUp
on mouseDown
   move me relative 5,5
   pass mouseDown
end mouseDown
on mouseRelease
   send "mouseUp" to me
end mouseRelease

Tom

On Feb 25, 2004, at 3:54 PM, Dar Scott wrote:

>
> On Wednesday, February 25, 2004, at 11:15 AM, Thomas McGrath III wrote:
>
>> Should I group them??? should I 'do' something to the icon image???
>
> You can group and put mouse handlers in the group.  If some images 
> should not be included in mouse event catching, then your may have to 
> organize grouping accordingly.
>
> Remember, you only need to build this way if you need something 
> special.  An example is the building of button images from scalable 
> pieces as described by Scott.
>
> Otherwise you can have the button refer to images by id and use the 
> referenced images for button states.  Adjust other properties 
> accordingly.
>
> Dar Scott
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

Thomas J. McGrath III
SCS
1000 Killarney Dr.
Pittsburgh, PA 15234
412-885-8541



More information about the use-livecode mailing list