Instead of a button I'd use a Text box with a Perform Script attached to it.
The Script could change the state of a field i.e., if 0 then 1, if 1 then 2, if 2 then 0.
Then use conditional formatting on the text box to change the colour.
If 0 then fill colour transparent (the white box with red line through it),
if 1 then choose a fill colour and set the opacity to 50%,
if 2 then choose a bright colour.
Is it possible to set transparency of a square/button at all, and specifically with a script?
Conditional formatting can change the fill to transparent, but not the button's border. But FileMaker 13's "Hide object when" setting can completely hide the object. This keeps the button from being clicked or tapped, but if this is strictly to be a touch screen interface for your iPad, you might be able to use a the OnGestureTap layout based script trigger to capture the coordinates of the area of the screen that you tapped and not need a grid of actual buttons, just a grid of layout objects that appear/disappear to mark the position of plants in your garden.
(Interestingly, I've been contemplating an iPhone based system to track info on the individual trees of a small orchard farm in much the same way as your garden map interface shown here....)
Thank you both! I didn't see the transparency option until now. I only need two states, one transparent and one 50%.This could work!
Good luck on the orchard app, PhilModJunk!
I've made a test layout with text boxes and conditional formatting. It seems to work except for two factors:
1. The text in the boxes can't be set to 50% transparency.
2. I now have 300 text boxes (one per square meter) that by this method should correspond to 300 fields. I would rather have 300 buttons (with conditional formatting) that corresponds to one field in the way that checkboxes work. I.e. when a button is "true" it adds a unique value (A1 to Z12) to the field, and when it is pressed again it becomes "false" and removes that value from the list in the text field.
Any tips on scripts that is able to use checkbox functionality to add and remove correct values from a non-ordered, semi-colon-separated list in a text field?
You can select a field and use Button Setup... in the format menu to turn the field into a button. (It actually creates an invisible button object and groups it with the field object.) You can set a different script parameter with each of your 300 buttons so that you can have a single script where the parameter passed to it is the name of the field to modify so that set field by name can then be used to change the value of the field.