Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How can I detect Button press / release
Re: How can I detect Button press / release [message #29487 is a reply to message #29486] Sat, 23 October 2010 20:20 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

jerson wrote on Sat, 23 October 2010 18:22

Can someone point me to a callback for button which does the following

WhenPush - I know this one
WhenRelease - does this exist?

Hi Jerson,

WhenAction is called when the mouse button is released above the button widget. If you also need to detect when user moves the mouse pointer out of the widgets area (which you probably want, otherwise your I/O pin would stay in high state), then you can either inherit from Button and overwrite MouseLeave() to take care of that. Other solution (without making your own class) might be some ugly use of WhenRepeat with timecallbacks setting turning the state of pin after some time unless another WhenRepeat is called, but that would be ugly and error prone.

Best regards,
Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Layout call procedure buggy for invisible controls?
Next Topic: Problem with Calendar control
Goto Forum:
  


Current Time: Fri May 17 23:16:02 CEST 2024

Total time taken to generate the page: 0.01479 seconds