controlMove message

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6715
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

controlMove message

Post by dunbarx » Fri Oct 03, 2014 4:09 pm

When moving a control with the "move" command, no messages are sent while that process is underway. Like the "mouseMove" message, which can be used in a myriad of ways, it would be useful to have a similar message sent during moves:

controlMove newControlH, newControlV

This came up in another thread, where the OP wanted to determine when a moving control intersected another control. Once the move command had been executed, the only way to determine that condition was to run a concurrent recursive handler that checked the value of the intersect function continuously. All well and good, but it would have been simpler and more direct to be able to trap a "controlMove" message instead.

Craig Newman
Last edited by dunbarx on Mon Oct 06, 2014 2:12 am, edited 1 time in total.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: controlMove message

Post by [-hh] » Sun Oct 05, 2014 8:22 pm

I second this and suggest to use
controlMove currentLoc, nextLoc
because startLoc and endLoc are/were/will be also locs of the object.
And nextLoc could make sense if one is moving along a path of points.
shiftLock happens

sefrojones
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 447
Joined: Mon Jan 23, 2012 12:46 pm

Re: controlMove message

Post by sefrojones » Sun Oct 05, 2014 8:43 pm

I would like to see this feature as well. :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6715
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: controlMove message

Post by dunbarx » Mon Oct 06, 2014 2:06 am

Hermann.

Interesting.

Can you give an example of how knowing the pending loc of a moving control as it traverses from point to point can be used to advantage? Perhaps to stop or divert that motion at a certain point? Maybe if, along that path, a condition would soon be attained that mattered (say, for example, the moving object went too far in one direction)?

If so, maybe the second param you propose might be a list of all the pending points? This list would be trimmed as each "milestone" was reached.

Craig

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: controlMove message

Post by [-hh] » Tue Oct 07, 2014 12:21 am

Hi Craig.

As an illustrative example let's have the project "Kitchen clock" (@Sefro: Would count this as a "game"?):
Three objects move from quite different locations to one end point, say "high noon", the time you wish to eat, indicating the remaining time. They all shall reach this point at the 'same' time, exact as possible on user's machine and moving as smooth as possible to there.

No problem for three timers (potatoes, meat and leek) to count down to high noon, the time you wish to eat. Now compute the remaining way of three "hands" on your kitchen clock for their move along the points (!) of a circle to high noon.

As always, your machine is doing a lot of things while you pretend to be busy with cooking. So some of the timers may be waiting in a queue after other things to do: Again no problem because new moves cancel old ones. One could use this somehow, but you'll loose smoothness of movement then.

To avoid this you have to compute the time your hands need to keep smoothly the clock pulse. For this you need the *actual* current location of your hand on its way to high noon, not the location where it should be in theory.

This math would become simpler with the info from your message. One could continuously update the time needed for the remaining movement. Nothing separately needed any more for getting these locs.

Good Appetite!
Hermann
shiftLock happens

Post Reply

Return to “Feature Proposals”