By David J. Weiner
In our first blog post on the topic of FileMaker 14 button bar techniques, I outlined why we love them so much (calculated labels!), and the main reason they’re so useful (calculated labels!). In our second post on Button Bar Techniques, I delve into the first of several actual tricks we use them for. And, as I looked over some of the examples that I’ll be explaining, it occurred to me that one thing that these techniques all have in common is that the formatting of the button bars is typically invisible — entirely, or partially.
By invisible formatting, I mean that we remove outlines and fills for most or all of the states (active, inactive, hover, and pressed), so that the button simply appears to be text on the layout. Sometimes, we’ll actually use the hover state, to indicate that the text can be edited, or as a navigation link, but whatever the use case, we’re not making the object look like a button.
That being said, the button bar technique we probably use the most is simply replacing merge data with dynamically formatted text.
Merge fields can be useful, but without resorting to a calculated field, they can’t dynamically change depending on various criteria (as when using a case statement, for example). Further, one of the biggest problems with merge fields is that the data in the field can become too long to fit in the area allotted for the merge text (not to mention the problem with stupidly-long fully-qualified field names that won’t fit in layout mode). Using the calculation engine in a button bar label, you can resize or truncate text as needed for the purpose of making it fit. Additionally, you gain the benefit of all the button states available (hover, active, pressed, etc), plus an icon if you want it. We now regularly use button bar calculated text on report subsummary parts to describe the section (instead of using fields or merge text).
By using a case statement, we can display just about anything we need to, and using functions like TextStyleAdd or TextColor we can change the formatting of just parts of the text, but more on those tricks in our next installment…