z178 Posted September 5, 2007 Posted September 5, 2007 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
dreamingmind Posted September 5, 2007 Posted September 5, 2007 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
dreamingmind Posted September 5, 2007 Posted September 5, 2007 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
Fitch Posted September 12, 2007 Posted September 12, 2007 You could use a webviewer with a javascript to fade the button back to its original color.
z178 Posted September 16, 2007 Author Posted September 16, 2007 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
Stuart Taylor Posted September 16, 2007 Posted September 16, 2007 This seems overly complex Why not a simple toggle button? button.fp7.zip
comment Posted September 16, 2007 Posted September 16, 2007 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/
z178 Posted September 17, 2007 Author Posted September 17, 2007 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?"
Stuart Taylor Posted September 17, 2007 Posted September 17, 2007 I was just thinking does it need to be so complex. Anyway after a little thought it was actually really simple. Attached... best stuart button_2.fp7.zip
Stuart Taylor Posted September 17, 2007 Posted September 17, 2007 Ps as you are using version 9 i would also use conditional formatting but as i am not i can not :
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now