New topic: Subclassing Canvas MouseDown not working
<http://forums.realsoftware.com/viewtopic.php?t=44039> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message neonash7777 Post subject: Subclassing Canvas MouseDown not workingPosted: Wed May 16, 2012 4:46 pm Joined: Mon Nov 29, 2010 7:01 pm Posts: 179 I have a custom button control subclassed from the Canvas. I want the MouseDown event to color the button differently Clicking = true me.Invalidate return true In the Paint event it knows that if Clicking is true, to draw the button differently. However the Event won't trigger no matter what I do. I couldn't find a known bug and I no idea at this point what I could be doing wrong... The MouseDown event is working on a normal Canvas control, just not subclassed Canvas controls. Top DaveS Post subject: Re: Subclassing Canvas MouseDown not workingPosted: Wed May 16, 2012 5:18 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 3693 Location: San Diego, CA well I just created a new project added a class... told it the super was canvas added your code into the MouseDown event of the new subclass put this code in PAINT just for effect g.ForeColor=&cff0000 if clicking then g.ForeColor=&c00ff00 g.fillrect 0,0,100,100 and when I click on the canvas it turns from RED to GREEN just like I expected it would Of course I assume that SOMEWHERE you plan on resetting CLICKING back to false? _________________ Dave Sisemore MacPro, OSX 10.7.3 RB2011r3 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
