5 Replies Latest reply on Sep 15, 2010 4:41 PM by philmodjunk

    Is there a get header height calculation/work around?

    zinny

      Title

      Is there a get header height calculation/work around?

      Post

      Hi, I am a newbie using small personal projects to learn filemaker before embarking on some more important ones.

      I am calculation the size of windows using list layouts. I am adding the [height of the header and footer] + 30 or 80 pix for the status bar header depending whether it is on or off + the number of records times the [height of the body]of the layout.

      Is there anyway I can get(headerheight), get(bodyheight) and get (footerheight)?

      I am hoping it is somewhere secret that I can't find or there is a work around. I don't want to rewrite the calculation for each layout/everytime I change it.

      Any thoughts would be appreciated

        • 2. Re: Is there a get header height calculation/work around?
          zinny

          Thanks, I tried that but it gives you the content height as it is, not as you want it to be - ie. if you increase the size of the window by dragging on the corner it gives you a different result. It doesn't help me find how big the window should be, just how big it is.

          I appreciate the thought though, thanks

          • 3. Re: Is there a get header height calculation/work around?
            philmodjunk

            In some situations, I set the window height and width in variables. Which are then referenced by the New Window script step to compute height, width and also a top and left that centers the window on the screen. If I then modify the layout, I just edit the Set Variable script step that assigns the window height and/or width.

            Also, haven't tried this, but there's a function named GetLayoutObjectAttribute that can return the height and width of a layout object. If you place an invisible rectangle back behind all your layout objects and use the Inspector to give it an object name, you could use this function to get the dimensions of that rectangle--which would also be the dimensions of the layout part if you resize it correctly each time you modify the layout design.

            • 4. Re: Is there a get header height calculation/work around?
              zinny

              Thanks for the quick reply, it works a treat!

              So here is the code I ended up using.

              Get(FoundCount)*(GetLayoutObjectAttribute ( "Body" ; "bottom" ) - GetLayoutObjectAttribute ( "Body" ; "top" ))+

              (GetLayoutObjectAttribute ( "Header" ; "bottom" ) - GetLayoutObjectAttribute ( "Header" ; "top" ))

              +37+(Get ( StatusAreaState )*80)

              This code gets height of the header and body, calculates the total interior content and then adds on the extra status bar if it is active. 

               You must create an invisible background object that fills the header and name it "header" and one that fills the height of the body and name it "body" in the position attributes tab. If you change the size of the layout you must change the size of the object.

              Thanks phil, hope the family situation gets better

              • 5. Re: Is there a get header height calculation/work around?
                philmodjunk

                Thanks phil, hope the family situation gets better

                It is. Family member came home from hospital today so I might finally get a decent night's sleep tonight.