COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 03-01-2017, 12:04 AM   #1
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 341
Default 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:
	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?

Last edited by Bobflip; 03-02-2017 at 07:34 AM.
Bobflip is offline   Reply With Quote
Old 03-02-2017, 09:15 AM   #2
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 341
Default

Further info. From a suggestion on KVR I put a breakpoint inside the onMouseOut() in iGraphics.cpp, and it only breaks when moving the mouse out of the plugin window.

IControl.h is inheriting from iGraphics, but doesn't override the method. Do I need to add an updated onMouseOver to iControl.cpp?
Bobflip is offline   Reply With Quote
Old 03-02-2017, 09:55 AM   #3
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 341
Default

Problem solved... I had defined onMouseOut() instead of OnMouseOut(), hahaha.

*bangs head on desk*
Bobflip is offline   Reply With Quote
Old 03-02-2017, 10:03 AM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by Bobflip View Post
Problem solved... I had defined onMouseOut() instead of OnMouseOut(), hahaha.

*bangs head on desk*
Use the C++11 keyword "override" to avoid these situations. It will give you a compiler error if the method you are trying to override is not actually a virtual method. (Besides ensuring the method name is exactly correct, it also detects errors in function argument types.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 03-02-2017, 10:06 AM   #5
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 341
Default

Hmm, not encountered that, will investigate, thanks!
Bobflip is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.