Create a panel using mouseEnter

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Gautami
Posts: 35
Joined: Tue Aug 06, 2013 5:25 am

Create a panel using mouseEnter

Post by Gautami » Sun Aug 25, 2013 11:06 am

Hi all,

I am trying to create a sot of panel of buttons that slides into view when the user's mouse hovers about it.

So this is what I have:

on mousemove
set the visible of group id "18974" to false
show group id "18974" with visual effect push right very fast
end mousemove

It works for the most part but the visual effect keeps getting repeated whenever i move to the next button.
Is there a way to make the group stay in play while the mouse in in that group??

Thank you and any help will be appreciated!

Gautami

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Create a panel using mouseEnter

Post by Klaus » Sun Aug 25, 2013 11:53 am

Hi Gautami,

you have the answer in the post title, use "Mouseenter" and NOT "mousemove"! 8-)

"mousemove" is being sent CONTINUOUSLY while the mouse is moving, which
may be a bit disturbing in your case ;-)


Best

Klaus

Gautami
Posts: 35
Joined: Tue Aug 06, 2013 5:25 am

Re: Create a panel using mouseEnter

Post by Gautami » Sun Aug 25, 2013 12:12 pm

oops sorry, i am copying from all the wrong places :/

i get the problem with this:

on mouseEnter
set the visible of group id "18974" to false
show group id "18974" with visual effect push right very fast
end mouseEnter


when i place the cursor over this group it pops up yes, but when i move
the cursor, the group repeats the effect of pushing from the left.
I understand why it happens, but i would like to know if there is a
way to make this effect occur only once while the cursor is hovering over the buttons..
i want to user to move the cursor to the right and have the panel pop up and remain there while the user chooses a button to click. After that i would have the panel disappear.


Thanks for the response!

Regards,
G

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Create a panel using mouseEnter

Post by Klaus » Sun Aug 25, 2013 12:26 pm

AHA! :-D

Some hints:
1. Give your objects meaningful names!
I'm sure next week you do not know immediately what "group ID 123456789" is ;-)
2. And do not use QUOTES areound NUMBERS like IDs!

Well, you should check if you really need to show that group in your script!
If it is already visible, well then not :-)

This is a quick guess, since I don't have any ida about your concept/app!

Code: Select all

on mouseEnter
  ## Group already visible? then get out of this handler!
  if the visible of group "the popup group" = TRUE then
    exit mouseenter
  end if

  ## NOT visible, so show it:
  show group "the popup group" with visual effect push right very fast
end mouseEnter
Best

Klaus

Gautami
Posts: 35
Joined: Tue Aug 06, 2013 5:25 am

Re: Create a panel using mouseEnter

Post by Gautami » Sun Aug 25, 2013 12:43 pm

HI Klaus,

You are like such a huge pillar of support arnd here!
Thanks for the all help.
:)

But anyway, the code you provided stopped the panel (aka the group) from doing the sliding in effect.
I wish i can attach a video here to show what i wanted.

I had to

Code: Select all

set the visible of group "panel" to false
so that the sliding in effect kicks in.

"i want to user to move the cursor to the right and have the panel pop up and remain there while the user chooses a button to click. After that i would have the panel disappear"

uhm i don't know how to be more clearer haha, perhaps you can tell me which parts are unclear and I will explain.

G

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Create a panel using mouseEnter

Post by Klaus » Sun Aug 25, 2013 12:47 pm

You can send me the stack, if you like, otherwise it might take some time before I get what you want :-)

Send it to: klaus AT major-k.de

Gautami
Posts: 35
Joined: Tue Aug 06, 2013 5:25 am

Re: Create a panel using mouseEnter

Post by Gautami » Sun Aug 25, 2013 2:32 pm

Really??!!

Thank you so much!!
Sending it right now :)

G

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7391
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Create a panel using mouseEnter

Post by jacque » Sun Aug 25, 2013 5:56 pm

It might be that you have not blocked the mouseEnter message in each button. If there is no handler in the button to catch the message, it will pass to the group and trigger it there.

You can do the block two different ways:

1. The easiest is to put an empty mouseEnter handler in each button:

on mouseEnter
end mouseEnter

That will trap the message and not pass it to the group.

2. In the group handler, check "the target" to make sure it is the group and not one of the buttons. If it isn't the group, don't do anything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply