|
-
Oct 6th, 2009, 12:48 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Mouse events in clipped region of custom control
Hi, I have made a control which inherits from container, I set the region of the control to round the corners.
I want to prevent the mouse events firing when they occur in the clipped region, I can tell when they are in the clipped or visible areas but cant figure out how the events such as enter,leave,up and down can be prevented in this area?
Any help would be appreciated.
Thanks
Last edited by cptHotkeys; Oct 8th, 2009 at 01:42 AM.
-
Oct 8th, 2009, 01:39 AM
#2
Thread Starter
Hyperactive Member
Re: Mouse events in clipped region of custom control
I figured it out, I overrid the base classes OnMouse... methods and checked wether the mouse was inside the visible region, It took a bit of thaught to prevent events from firing twice (once when they left the clipped region and once when they left the controls rectangle bounds) but I got it to work flawlessly and efficiently..
Code:
if (this.region.isVisible(mousepos)) { base.OnMouse...}
It went something like that, if someone wants I can post the code, you can paste it and it will work in any control which inherits an object with the OnMouse events.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|