-
Content Count
135 -
Joined
-
Last visited
Everything posted by Steve Maughan
-
Right Process for Changing an Application's Icon?
Steve Maughan replied to Steve Maughan's topic in VCL
Thanks Anders. This is really helpful. Can I ask, what is the resource editor you're using in the screenshot? Steve -
How to "eat" the second OnMouseDown / OnMouseUp events after a DblClick?
Steve Maughan posted a topic in VCL
I have a TPaintBox where I normally process OnMouseDown, OnMouseMove and OnMouseUp events. I'd like to perform an action using the DoubleClick even. It seems that when the user double clicks the order of events is as follows: OnMouseDown OnMouseUp OnDblClick OnMouseDown OnMouseUp I'd like to cancel / "eat" the second OnMouseDown and OnMouseUp events. How can I do this? Setting them to "nil" doesn't seem to work. Thanks - Steve -
How to "eat" the second OnMouseDown / OnMouseUp events after a DblClick?
Steve Maughan replied to Steve Maughan's topic in VCL
Thanks Peter! -
How to "eat" the second OnMouseDown / OnMouseUp events after a DblClick?
Steve Maughan replied to Steve Maughan's topic in VCL
Hi Attila, Thanks! Yes - I managed to get it working using a similar technique. I set a flag in the DblClick event and then sent a message to clear the flag. Steve -
How to "eat" the second OnMouseDown / OnMouseUp events after a DblClick?
Steve Maughan replied to Steve Maughan's topic in VCL
Looks like I haven't figured it out at all. It seems much more complex. Here's the order of events: OnMouseDown (processed with no problem) OnMouseUp (processed with no problem) OnDblClick - I'm showing a form for the user at this point. The GUI is recording the mousemove actions and generating OnMouseMove messages OnMouseDown - the second OnMouseDown of the double click, which can be ignored using a flag OnMouseUp - the second OnMouseUp of the double click, which can be ignored using a flag, and the fag can be reset Multiple OnMouseMove - then all of the OnMouseMove messages that were generated while the form was showing are now processed How do I either ensure the OnMouseMove messages aren't generated when the form is shown, or how do I remove them from the message queue? Here's a short video that shows the behavior: All help appreciate! Thanks, Steve -
How to "eat" the second OnMouseDown / OnMouseUp events after a DblClick?
Steve Maughan replied to Steve Maughan's topic in VCL
I figured it out. Set a flag on the DblClick event, exit out of the OnMouseDown if the flag is set, then do the same for OnMouseUp but also reset the flag. -
I hope this is an easy question to answer... How to get access to quality.embarcadero.com? My normal email and password that I use for the Maintenance site doesn't work. Thanks, Steve
-
How to get access to quality.embarcadero.com?
Steve Maughan replied to Steve Maughan's topic in General Help
Thanks - my username worked! -
Fast way to find points near a given point?
Steve Maughan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
I didn't know about "Hypot": thanks for sharing!! Steve -
Fast way to find points near a given point?
Steve Maughan replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
I do this all the time in AlignMix, our mapping package. Here's our super-fast algorithm: 1. Have a sorted list along one dimension (I normally do longitude) 2. Do a binary search to find the point with the closest longitude (let's call this P:0 ) and record the distance between this point and the search point 3. Start a loop: look at the next sequential point from P:0 in the sorted list; record the distance and update if smaller than previous; exit the loop if the difference in the longitude is now greater than the shortest distance found, otherwise move on to next point 4. Start a loop: look at the previous sequential point from P:0 in the sorted list: record the distance and update if smaller than previous; exit the loop if the difference in the longitude is now greater than the shortest distance found, otherwise move on to next point In practice I combine steps 3 & 4 so it alternates searching for the next above and the next below P:0. Hope that helps. In my tests this is extremely fast and scales the same as a binary search (log(n)) Steve