Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Bug reports ➜ CancelMouseOver not working as expected

CancelMouseOver not working as expected

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 3  

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #15 on Sat 28 May 2011 08:53 AM (UTC)
Message
Well you said you got one anyway, and the way it is written you will only ever get one.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #16 on Sat 28 May 2011 11:55 PM (UTC)

Amended on Sun 29 May 2011 12:05 AM (UTC) by Nick Gammon

Message
Fiendish I seem to have misplaced your email address. If you email me I'll give you a link to the beta test version with the CancelMouseOver fixes in it.

[EDIT] I sent a forum message to you, if your email address on the forum is correct you should get that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,537 posts)  Bio   Global Moderator
Date Reply #17 on Sun 29 May 2011 01:54 AM (UTC)

Amended on Sun 29 May 2011 02:22 AM (UTC) by Fiendish

Message
I got it, thanks.

[EDIT] WindowInfo option 19 appears to work as expected now. And cancelmouseovers still work properly, so that's good.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #18 on Sun 29 May 2011 03:29 AM (UTC)
Message
OK good. Well if you could keep testing this version please to confirm that the new things work the way you want them to, and existing stuff isn't broken. Thanks.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #19 on Sun 29 May 2011 09:33 PM (UTC)

Amended on Sun 29 May 2011 09:35 PM (UTC) by Twisol

Message
I found a pretty decent bug. Click down on a hotspot, then move outside the window and release. Then mouse over the hotspot (or any hotspot) and the mouseover event won't fire.

Inside (0,9) - current: (0,9)
Outside (0,9) - current: 
Clicking (0,9) - current: 
Cancelling (0,9) - current: (0,9)


"Cancelling" is the cancelmousedown event (cancelmouseover is "Outside"), and current shows the return value of WindowInfo option 19. I'm guessing that when you release the mouse button, MUSHclient sets the current hotspot back to what it was before the click, since it clears option 19 during a click. Since MUSHclient thinks you're over a hotspot, it never emits another mouseover event. This situation clears itself if you click and release within the same hotspot afterwards.

It appears also that you need to move the mouse completely outside of the miniwindow for this to happen. Moving it elsewhere in the window doesn't do it.


For the record, I'm not entirely sure I understand why MUSHclient emits a cancelmouseover when you click, either.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #20 on Sun 29 May 2011 09:56 PM (UTC)
Message
Here's the plugin I used to test the changes.

http://dl.dropbox.com/u/10356966/HotspotTest.plugin.zip

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #21 on Sun 29 May 2011 11:51 PM (UTC)
Message
OK fixed that. The corrected version is in the same place except change "beta" to "beta2".

My test code btw is:


win = "test_" .. GetPluginID ()  -- get a unique name, ensure not empty if outside plugin
WindowCreate (win, 0, 0, 400, 400, miniwin.pos_center_all, 0, ColourNameToRGB("white"))  -- create window
WindowShow (win,  true)  -- show it 


-- Grid
for i = 1, math.max (WindowInfo (win, 3), WindowInfo (win, 4)) / 20 do
  WindowLine (win, i * 20, 0, i * 20, WindowInfo (win, 4), 0xC0C0C0, miniwin.pen_solid, 1)
  WindowLine (win, 0, i * 20, WindowInfo (win, 3), i * 20, 0xC0C0C0, miniwin.pen_solid, 1)
end -- for


function showhotspot ()
  ColourNote ("gray", "", "  Current hotspot over = " .. WindowInfo (win, 19))
  ColourNote ("gray", "", "  Current hotspot down = " .. WindowInfo (win, 20))
end -- showhotspot

function mouseover (flags, hotspot_id)
  Note ("we moused over hotspot " .. hotspot_id)
  showhotspot ();
  
end -- mouseover

function cancelmouseover (flags, hotspot_id)
  Note ("we cancelled mouseover hotspot " .. hotspot_id)
  showhotspot ();
end -- cancelmouseover 

function mousedown (flags, hotspot_id)
  Note ("we moused down over hotspot " .. hotspot_id)
  showhotspot ();
end -- mousedown

function cancelmousedown (flags, hotspot_id)
  Note ("we cancelled mouse down over hotspot " .. hotspot_id)
  showhotspot ();
end -- cancelmousedown 

function mouseup (flags, hotspot_id)
  Note ("we moused up over hotspot " .. hotspot_id)
  showhotspot ();
end -- mouseup 

WindowAddHotspot(win, "hs1",  
                 10, 10, 60, 80,   -- rectangle
                 "mouseover", 
                 "cancelmouseover", 
                 "mousedown",
                 "cancelmousedown", 
                 "mouseup", 
                 "Hot Spot 1",  -- tooltip text
                 miniwin.cursor_hand, 0)  -- hand cursor


WindowRectOp ( win, miniwin.rect_frame, 10, 10, 60, 80, ColourNameToRGB ("red"), 0)


WindowAddHotspot(win, "hs2",  
                 50, 10, 160, 100,   -- rectangle
                 "mouseover", 
                 "cancelmouseover", 
                 "mousedown",
                 "cancelmousedown", 
                 "mouseup", 
                 "Hot Spot 2",  -- tooltip text
                 miniwin.cursor_hand, 0)  -- hand cursor


WindowRectOp ( win, miniwin.rect_frame, 50, 10, 160, 100, ColourNameToRGB ("blue"), 0)



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #22 on Sun 29 May 2011 11:54 PM (UTC)

Amended on Sun 29 May 2011 11:55 PM (UTC) by Nick Gammon

Message
The fix was pretty minor:

https://github.com/nickgammon/mushclient/commit/c87c92ea8a98e0

I keep getting confused about the difference between emptying a string and erasing it.


-      it->second->m_sMouseDownHotspot.empty ();
+      it->second->m_sMouseDownHotspot.erase ();



[EDIT]

Well spotted though!

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #23 on Mon 30 May 2011 12:54 AM (UTC)
Message
That's working again, but WindowInfo 19 should be empty during that cancelmousedown event, since you're letting go of the mouse outside the window.

Nick Gammon said:
I keep getting confused about the difference between emptying a string and erasing it.

Heheh, yes, ::empty() just checks if it's empty or not. I'm glad Ruby lets you use names like empty? and destroy!, it really helps...

Nick Gammon said:
Well spotted though!

Thanks!

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #24 on Mon 30 May 2011 01:00 AM (UTC)
Message
Twisol said:

That's working again, but WindowInfo 19 should be empty during that cancelmousedown event, since you're letting go of the mouse outside the window.


It is, isn't it?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #25 on Mon 30 May 2011 02:06 AM (UTC)
Message
Cancelling (0,9) - current: (0,9)
Nope.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #26 on Mon 30 May 2011 02:39 AM (UTC)
Message
Strange. Sometimes it is, sometime it isn't. I haven't found any pattern to it yet.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #27 on Mon 30 May 2011 04:41 AM (UTC)
Message
Another good catch!

I hope I fixed that.

The corrected version is in the same place except change "beta2" to "beta3".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #28 on Mon 30 May 2011 04:57 AM (UTC)
Message
Hmm, I'm still seeing it. Most of the time it shows the hotspot name, and only occasionally is it clear.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #29 on Mon 30 May 2011 06:50 AM (UTC)
Message
<sigh>

Oh well, try file "beta4".

It seems I was a little aggressive in storing the mouse-over hotspot when you moved the mouse - it was filling that field in, even if the mouse was down.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


92,477 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.