I would rather have 1 field (checkbox) and a object with Hide Object depending on your value in that field.
No graphic for checkboxes
1 of 1 people found this helpful
I'd like to suggest another method because simple checkboxes are one of those things that should be simple but aren't in FMP. I looked a long time before I found this method.
- Simple and fast
- Can be copied and pasted quickly to other layouts or tables (just change the table::field setting in the Inspector)
- No "hide object when" so it's faster to re-use anywhere in an app
- Works in Find Mode
- You can sorta emulate the standard OSX-style blue checkbox, but it's not quite identical.
- Stuck with the simple checkmark, no fancy graphics. But this method is so easy to implement that the restriction is worth it.
The type of field is Text
- Use calculated value: If ( IsEmpty ( YourTable::YourField ) ; 0 ; 1 )
- All other boxes unchecked
Validation - check these:
- Validate date Only During Data Entry
- Allow user to override during data entry
Storage Options - Use Default
Value List Setup:
In the Inspector, under the Data Tab,
- Use Control Style called Checkbox Set
- Create a Value List with only one value, the number 1
- Specify a checkmark or an X to go in the box
In the Inspector, under the Appearance Tab,
- Under Style it should say Checkbox Set
- Where the box says "Checkbox Set" the four options (Normal, Hover, Pressed, In Focus) should have no formatting
- Change the box to "Checkbox Set:Checkbox" This is the background of the checkbox, so your pick. I set Normal to white and use a light blue for Hover. Pressed and In Focus are white.
- Change the box to "Checkbox Set:Icon" This is the color of the checkmark, so your pick. I use OSX blue for mine.
Also under the Appearance Tab,
- You can make the checkbox any size, but I use Height 13, Width 14
- Alignment left and top
- Padding: This is key: set padding to “left 6” to get the number 1 in the checkbox set to disappear. All that will appear is the box itself.
I created a FMP Style called Checkbox Field that sets all of this.
Took me awhile to get back to this but this works great. Almost no delay on the individual checkbox. Do you ever include a toggle all check box function?
pjohnson64: I haven't tried that. I suppose a button could trigger a script that would put a '1' in each of a group of checkbox fields.
In my app there are certain checkboxes that are usually checked, so I set those fields to auto-enter the value '1' in addition to the calculation.
I am using Replace Field Contents but it is slow. It takes 2 seconds to put a "1" or " " into the found set (usually around 30 records). I made an independent table which only has a the unique ID and a number field for the "1" or " ". This dropped the time from 3 seconds to 2, but still a little slow. Thanks for your help on this, your suggestion cut the time from 5- 7 seconds!