Luke Patterson Posted May 4, 2011 Report Posted May 4, 2011 Hi, I'm trying to get "hover popup" behavior to work, and am running into some difficulties. By "hover popup", I mean: a) when the mouse hovers over my icon, a smaller screen with contextual information will show at the cursor location b) when I navigate away (move the mouse away) from the popup, the popup will hide (close) automatically So, I'm getting close with: a) in my icon's touch "On Mouse Over" "Action Script", { show my popup window, which is positioned over the icon so that the mouse will be underneath the popup when it opens } Show("My Popup"); b) in "My Popup" window's "On Show" script: DIM result AS DISCRETE; { the system will set the PopupContextIdentifier tag to my UUID when I hover over My Window } result = WWContext("My Popup", 0, 0, 10000, 10000, PopupContextIdentifier.Name, "51ca9bd1-b2cd-479c-b6e6-2430569d88ee"); c) in "My Popup" window's "While Showing" script: { close if PopupContextIdentifier isn't my UUID that I set in "On Show" } IF (PopupContextIdentifier <> "51ca9bd1-b2cd-479c-b6e6-2430569d88ee") THEN HideSelf; ENDIF; The problem is, "While Showing" is called before the window is showing, and so PopupContextIdentifier isn't set yet, and then my popup window immediately closes. I can sorta do a half-workaround by making a longer "Every x Msec" delay in my "While Showing" script, but I've already crept up to 1 second and I still occasionally see the problem. I don't want to go too much higher or else the "navigate away to close" behavior is too slow. Thoughts? I tried to use the "Wonderware Developer Network", but I don't think it is monitored anymore. I posted something last week to a forum but the moderator(s) haven't reviewed my posting yet. Thanks, Luke
EasyButton Posted May 9, 2011 Report Posted May 9, 2011 Maybe you could have the "On Mouse Over" close any open popups but you may have icons being hidden under the popup... Maybe you could do a time delay (tag = tag+1; If tag = 2 then...), not clean but it should work.
Luke Patterson Posted May 16, 2011 Author Report Posted May 16, 2011 Thanks, EasyButton. I eventually went with a QuickFunction I called "CloseIfCursorOutsideWindow": DIM UseDesktop AS INTEGER; UseDesktop = 1; GetWindowPosition( WindowName, WnPosition\Left.Name, WnPosition\Top.Name, WnPosition\Right.Name, WnPosition\Bottom.Name, UseDesktop); GetCursorPosition( Cursor\X.Name, Cursor\Y.Name, UseDesktop); IF ( (Cursor\X < WnPosition\Left) OR (Cursor\X > WnPosition\Right) OR (Cursor\Y < WnPosition\Top) OR (Cursor\Y > WnPosition\Bottom) ) THEN Hide(WindowName); ENDIF; It has a WindowName (Message) argument. I had to use a couple of the addon libraries so I could have GetWindowPosition and GetCursorPosition functions. Now my popup windows just use a "While Showing" script: CALL CloseIfCursorOutsideWindow("my popup"); Thanks, Luke
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now