PDA

View Full Version : How to stop pickPoint()?


MrSparkle
02-08-2006, 06:00 AM
Hi!

How can I stop the pickPoint() operation, e.g. if the user clicks on another button before he finished picking a point as he's supposed to:


on someButton pressed do (
p1 = pickPoint() -- wait for user to pick a point
)

on anotherButton pressed do (
-- user pressed another button before he
-- finished the last pick point operation, so:

stop_Pick_Point() -- but how???

-- pick another point will not work while
-- another pickPoint operation is in progress...
p2 = pickPoint()
)




Does anybody has a solution for this?

Thanks,
Chris

mobeen
02-09-2006, 06:09 AM
You can disable the second button and enable it as soon as the user gives the first point. For example youo create the ui like this


button b1 "First Point"
button b2 "Second Point" enabled:false


Now when you handle the first point pick enable the second button like this.


on b1 pressed do
(
p1 = pickpoint()
b2.enabled = true
)

on b2 pressed do
(
p2 = pickpoint()
)


Hope this helps
Thanx
Mobeen

MrSparkle
02-10-2006, 08:42 AM
Thank you mobeen!
I tried to work around like you described it. But the result ist not satisfying because the user always has to click right inside the active viewport in order to stop the operation.
I think I'm trying the "on tool create" events instead...
Thanks,
Chris

CGTalk Moderation
02-10-2006, 08:42 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.