Results 1 to 2 of 2

Thread: [RESOLVED] Mouse events in clipped region of custom control

  1. #1

    Thread Starter
    Hyperactive Member cptHotkeys's Avatar
    Join Date
    Apr 2007
    Location
    New Zealand
    Posts
    294

    Resolved [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.

    Signatures suck

  2. #2

    Thread Starter
    Hyperactive Member cptHotkeys's Avatar
    Join Date
    Apr 2007
    Location
    New Zealand
    Posts
    294

    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.

    Signatures suck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width