Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6274 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I want to create a toggle button in FM.

The button on the first click should just change color and if the user does not click a second time within say 2 seconds, the button returns to its original state.

Would using a repeating container field with 2 repetitions to hold 2 images showing the state of the button work?

Click 1 sets the flag to 1

set the repeating field to show the second image

if click 2 occurs within 2 seconds,

set flag to 0

execute a script

else

set flag to 0

end if

The trouble is how do I time the clicks?

Is there a builtin function that can time the clicks? Should I use a timestamp for each click and calculate the difference to time the click?

Thanks in advance for any help

Posted

A timestamp seems like the way to go. You could have the click set a modification time field or carry a script parameter of the current time-of-click and compare it to a variable that stores the last click time...

Regards, Don

Posted

Thinking a bit more though, you're going to have trouble returning the color to the if there is no second click.

There would have to be some event to trigger a screen refresh...

Are you going to lock the user into a loop so you can keep an eye on the time and update the button image on each cycle?

Regards, Don

Posted

You could use a webviewer with a javascript to fade the button back to its original color.

Posted

How 'bout using an external applescript to track the time elapsed and then Applescript GUI scripting to run a second script to set the state of the button?

That way the user would not be locked into a loop?

Also has anyone tried the zipp script for this problem?

Thanks for all the posts

Posted

I thought there was a request here for 'revert, unless confirmed within 2 seconds' or something like that? Seems very similar to:

http://www.fmforums.com/forum/showtopic.php?tid/176521/

Posted

Absolutely ! the original request is for revert in 2 seconds if not confirmed.

Was hoping to allow users make minimum mouse moves during data entry thus avoiding irritating dialogs like "Are you really sure you want to confirm?"

This topic is 6274 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.