[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  CancelMouseOver not working as expected

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: CancelMouseOver not working as expected
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  3  

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Mon 30 May 2011 10:24 AM (UTC)  quote  ]
Message
Looking good! I can't reproduce the bug anymore, and everything seems to behave as expected.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 30 May 2011 08:15 AM (UTC)  quote  ]
Message
Well that's odd. It vanished. I put it back.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Mon 30 May 2011 08:07 AM (UTC)  quote  ]
Message
I get a "Page not found" page if I try to get beta4. (For that matter, if I try to get any of the earlier ones too.)

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 30 May 2011 06:50 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Mon 30 May 2011 04:57 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 30 May 2011 04:41 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Mon 30 May 2011 02:39 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Mon 30 May 2011 02:06 AM (UTC)  quote  ]
Message
Cancelling (0,9) - current: (0,9)
Nope.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Mon 30 May 2011 01:00 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Mon 30 May 2011 12:54 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 29 May 2011 11:54 PM (UTC)  quote  ]

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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 29 May 2011 11:51 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 29 May 2011 09:56 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 29 May 2011 09:33 PM (UTC)  quote  ]

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
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 29 May 2011 03:29 AM (UTC)  quote  ]
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
[Go to top] 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.


5,117 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]