Login / Register  0 items | $0.00 NewWhat is KVR? Submit News Advertise

onMouseOut() not being called

Kickflip
KVRer
 
24 posts since 10 Dec, 2009

Postby Kickflip; Thu Mar 02, 2017 6:34 am onMouseOut() not being called

I have this code, with mouseOver being initialised to FALSE, and draw() only draws lines for the crossfair if the mouseOver is TRUE. Moving the mouse over the control successfully activates the crosshair, but moving away from the control does not.

Code: Select all
   void OnMouseOver(int x, int y, IMouseMod* pMod)
   {
      mouseOver = TRUE;
      crosshairX = x;
      crosshairY = y;
   }

   void onMouseOut()
   {
      mouseOver = FALSE;
   }


For testing, I commented out all of OnMouseOver and put the code into onMouseOut, and it's not being called at all! I called pGraphics->HandleMouseOver(true) when setting up the GUI, is there something else I'm missing?
BertKoor
KVRAF
 
9730 posts since 8 Mar, 2005, from Utrecht, Holland

Postby BertKoor; Thu Mar 02, 2017 7:07 am Re: onMouseOut() not being called

Looks like you use the event naming conventions from JavaScript. Windows GUI elements have a slightly different naming convention. Isn't it named onMouseLeave instead?
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is back online!!
Kickflip
KVRer
 
24 posts since 10 Dec, 2009

Postby Kickflip; Thu Mar 02, 2017 7:26 am Re: onMouseOut() not being called

I'm using WDL-OL, and inheriting from an IControl, which uses onMouseOut rather than onMouseLeave.

Just tried it anyway though, and no luck!
User avatar
BlitBit
KVRist
 
126 posts since 28 Nov, 2013, from Germany

Postby BlitBit; Thu Mar 02, 2017 7:43 am Re: onMouseOut() not being called

This comment right above the function declaration in the header IControl.h might bring enlightenment:
// For efficiency, mouseovers/mouseouts are ignored unless you call IGraphics::HandleMouseOver.

Good luck! :)


Edit: Sorry, I should have read your whole post. I have just noticed that you already call that method.
Kickflip
KVRer
 
24 posts since 10 Dec, 2009

Postby Kickflip; Thu Mar 02, 2017 7:49 am Re: onMouseOut() not being called

No worries, it's easily done! Would feel like the obvious fix, but the onMouseOver event is working perfectly.
User avatar
BlitBit
KVRist
 
126 posts since 28 Nov, 2013, from Germany

Postby BlitBit; Thu Mar 02, 2017 7:54 am Re: onMouseOut() not being called

So, did you get it to work? Because I wanted to propose to set breakpoints at places in the framework where that method is called. In my version it is called in IGraphicsWin::WndProc and IGraphics::OnMouseOver. That way it's possible to find out what's preventing the call.
Kickflip
KVRer
 
24 posts since 10 Dec, 2009

Postby Kickflip; Thu Mar 02, 2017 7:58 am Re: onMouseOut() not being called

I didn't yet, I'll give that a try and let you know how I get on, thanks!
Kickflip
KVRer
 
24 posts since 10 Dec, 2009

Postby Kickflip; Thu Mar 02, 2017 8:05 am Re: onMouseOut() not being called

Hmmm, so the onMouseOut in iGraphics.cpp isn't being called at all for the controls, only when you mouse the mouse off the window.
Kickflip
KVRer
 
24 posts since 10 Dec, 2009

Postby Kickflip; Thu Mar 02, 2017 8:53 am Re: onMouseOut() not being called

Damn it damn it damn it.... was meant to be calling OnMouseOut(), instead I had onMouseOut(), hah!

*bangs head on desk*
stratum
KVRian
 
1130 posts since 29 May, 2012

Postby stratum; Thu Mar 02, 2017 9:19 am Re: onMouseOut() not being called

Such things happen. I couldn't figure out how to draw a textured rectangle with d3d9 and it has been 2 days.:) When I figure it out finally I'll probably say *bangs head on desk* too:)
~stratum~
Kickflip
KVRer
 
24 posts since 10 Dec, 2009

Postby Kickflip; Thu Mar 02, 2017 9:24 am Re: onMouseOut() not being called

Yeah, it's all part of the process!

I just wish getting Cairo set up on OSX was as easy, hahaha.

Good luck with your rectangle!

Moderator: Moderators (Main)

Return to DSP and Plug-in Development