-
Content Count
135 -
Joined
-
Last visited
Posts posted by Steve Maughan
-
-
-
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
-
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
-
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 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
-
Thanks - my username worked!
-
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
-
On 12/14/2018 at 7:24 AM, Fritzew said:If it is the distance you are looking for, I don't think presorting are really faster as calculate the
distance direct.
from my experience presorting is in the most cases slower.
But it depends. If the Data is more or less static then maybe presorting will win.
in other casesUse Hypot to calculate the distance.
for point in Pointlist do begin dist := Hypot(checkx-point.x, checky-point.y); if dist < checkdist then ..... end;
Hypot is very fast
You can also use a parallel Loop in this case
I didn't know about "Hypot": thanks for sharing!!
Steve
-
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
- 1
- 2
Right Process for Changing an Application's Icon?
in VCL
Posted
The way Delphi handles application icons seems to be terrible.
Here's what happened. We have a new icon for our application. I managed to delete the old icon and all *.res file and update it with a new icon. Then suddenly the application is using the wrong icon in the main form. I've repeated the icon update process once again and now I seem to have messed things up. I now have the default icon as the application icon.
OK - rant over, now for my questions:
Thanks,
Steve