12 Replies Latest reply on Sep 6, 2016 7:58 AM by jfletch

    button bar bug? does not autosize when hidden

    aeu477

      I'm wondering if anyone else has come across this issue, and if it's a bug how do I report it to Filemaker?

       

      1. Put a button bar on a layout. Set the auto-sizing to anchor left and right, so it would stretch with layout resize.

      2. Create several segments and make them popovers. Each popover is given a unique object name.

      3. Go to browse mode and notice the button bar scales horizontally, properly, as the layout is resized.

      4. Now set the button bar's "Hide object when" calc to True, so the entire bar will now be hidden.

      5. Use a script or a second button bar with normal buttons set to GoToObject for any given popover object on the now-hidden first button bar.

      6. Notice the hidden button bar is now *not* properly scaling horizontally; and, as such, the pop-over segments (being called by object name to make them visible) are not in the same horizontal place they were when the button bar was previously visible.

       

      This is a significant problem for my current development because I have button bar A with buttons that call a script to execute code that is needed before the associated popups pop up (hence, I can't simply do an OnObjectEnter trigger on the popover). Then I have a mirror button bar B, hidden and overlayed, with popovers (as previously described) that then pop-up after the initial code is executed. However, the hidden button bar is not scaling properly, so its popovers no longer line up with the visible buttons.   >:-|

        • 1. Re: button bar bug? does not autosize when hidden
          BruceRobertson

          Well, my vote is that I can't see how any of this should be treated as a bug or in any way unexpected.

           

          "Don't draw me;  but be sure all the pieces I commanded you not to draw at all are exactly to scale."

          • 2. Re: button bar bug? does not autosize when hidden
            aeu477

            As far as I know, every other layout object scaling/anchoring behaves as expected, regardless of whether it's hidden or not.

            • 3. Re: button bar bug? does not autosize when hidden
              jfletch

              Define "as expected." Button bars have some powerful and very unique abilities that no other object has. You're probably not going to be able to do what you're trying to do, because button bars are not designed that way. Thats's not a bug, either. There are some very cool UI tricks that take advantage of the awesomeness that is the button bar--things that there's never been a way to do before.

              • 4. Re: button bar bug? does not autosize when hidden
                aeu477

                Maybe I did a poor job of explaining what I believe to be the issue. Simply: when the object is visible on a layout, its anchors/scaling behave one way; yet when it's flagged as invisible, those properties behave differently.

                 

                I expect the object's anchoring and scaling properties to behave the same way whether it's flagged as visible or not. If I have the anchors on an object locked to left and right, thus I expect it to scale left and right, visible or not. Why would anyone expect that to behave differently? Am I really off the mark here?

                • 5. Re: button bar bug? does not autosize when hidden
                  jfletch

                  That's exactly what I was talking about. I created a reporting module last week that used a 30 segment button bar in the body part of a list view.

                   

                  I stuffed an global array (a la "virtual list") with the numbers for the report, but there are a lot of possibilities for the input, so it never has the same number of values. The display calc in each button would grab its own segment of the data based on row and column. I also set each segment to hide when it is empty.

                   

                  As a result, no matter how many columns you have, be it 30 or 3, they always evenly fill the width of the report.

                   

                  Matt Petrowsky has also showed off a navigation bar technique that has way more segments than can be cleanly displayed on a layout, but simply turns them on and off to show the ones he wants for the circumstances. They always fit nice and even, filling up the space available. The hidden ones are there waiting for their turn, but staying totally out of the way otherwise.

                   

                  There are two examples for you where there never was any way to do that in the past. I LIKE the possibilities that the new button bar object presents.

                   

                  Your use-case calls for a different behavior. Perhaps you need to rethink how you are doing what you need. The button bar may be a square peg for your round hole, but it is not performing improperly.

                  • 6. Re: button bar bug? does not autosize when hidden
                    user19752

                    I tested it on FM15.

                    Hidden button bar is resized, but buttons (segments) on it don't have size (width).

                    This is same behavior as hidden portal and fields in it.

                    1 of 1 people found this helpful
                    • 7. Re: button bar bug? does not autosize when hidden
                      BruceRobertson

                      Maybe you should NOT hide anything; but instead set fill and line to none; including active and hover states.

                      See layout V4

                      • 8. Re: button bar bug? does not autosize when hidden
                        beverly

                        "button bar in body part of a List View"? would it be the same for every record?

                        beverly

                        • 9. Re: button bar bug? does not autosize when hidden
                          keywords

                          Re: "I expect the object's anchoring and scaling properties to behave the same way whether it's flagged as visible or not."

                          Why would you expect that? When an object is hidden, it is treated by FM as if it is not there at all—if it's a field you can't enter it; if it's a button you can't click it—the object has, to all intents and purposes, vanished. The behaviour you describe is just another aspect of this—why should FM rescale an object that is, in effect, not there?

                          In any case, given that this is the behaviour you are experiencing, try to devise another method.

                          • 10. Re: button bar bug? does not autosize when hidden
                            jfletch

                            Each record has a field that gets its data from a row of the array based on its record number, and then each segment of the button bar gets a piece of the row based on a field. Typical VL stuff. (Thanks, Bruce!) The fun happens because the segments all have IsEmpty ( self ) hide calculations on them, so it's as if they weren't there when you need less than 30 segments. So cool.

                            • 11. Re: button bar bug? does not autosize when hidden
                              beverly

                              is that something you can post, because it's not the demo Bruce posted.

                               

                              beverly

                              • 12. Re: button bar bug? does not autosize when hidden
                                jfletch

                                Ok. I'm leaving at 3:00 tomorrow morning to drive up to Chgo for Find Your Moose, so it won't be for a few days. Sorry.