5 Replies Latest reply on Feb 16, 2017 1:54 PM by pjohnson64

    Show/Hide, Calculation, or set field. Which is faster?

    pjohnson64

      I have a "to do" list and have a an empty check box and a marked checkbox graphic. My question is which situation would perform the best:

      1) To have two fields on the table one which would have a 1 or a 0 and a second field which has an "If" or "Case" calculation which enters the correct graphic based on the 0 or 1. On the layout have a field to show the auto enter field.

      2) Same situation as above but instead of the 1 and 0 just have one field with a button on the layout with an If statement that toggles the correct graphic into the field and show that field as the button?

      3) Same as #1 but instead of a second field with a calculation put both graphics on the layout with show hide based on the field with the 1 or 0?

       

      There is a lot of flexibility in how to do this but which one would perform fastest?

       

      The checkbox graphic is just under 2kb.

        • 1. Re: Show/Hide, Calculation, or set field. Which is faster?
          Johan Hedman

          I would rather have 1 field (checkbox) and a object with Hide Object depending on your value in that field.

           

          No graphic for checkboxes

          • 2. Re: Show/Hide, Calculation, or set field. Which is faster?
            BMyers

            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.

             

            Advantages:

              - 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

             

            Disadvantages:

              - 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.

             

            Field Setup:

            The type of field is Text

             

            Auto-Enter

              - 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

             

            Styling Setup:

            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.

            1 of 1 people found this helpful
            • 3. Re: Show/Hide, Calculation, or set field. Which is faster?
              pjohnson64

              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?

              • 4. Re: Show/Hide, Calculation, or set field. Which is faster?
                BMyers

                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.  

                • 5. Re: Show/Hide, Calculation, or set field. Which is faster?
                  pjohnson64

                  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!