4 Replies Latest reply on Nov 15, 2013 8:21 AM by philmodjunk

    finding the coordinates of an object

    med

      Title

      finding the coordinates of an object

      Post

           I am trying to display a window containing a layout with choices  so I use the new window command but I need to be able to determine the top and left of the window depending on the location of the layout object clicked. This is because the pop up window is needed to appear next to the clicked object and there is more than one on the layout.

           The reason I am doing this is that I tried to simply use a hidden object (of type pop up menu) which I go to it using a script triggered by clicking the original object. But the pop up menu behaves in MAC  very differently than in WINDOWS and you cannot even control the appearance as far as border shadows. The application needs to run seemlesly on both Mac and Windows.

           And I tried the drop down list but the number of choices displayed is limited to 11 and the user does not want to scroll because they need a speedy usage.

           So I came up with the idea of using a radio button field in a pop up window of modal style, and it is working fine except that I cannot control the location. 

           Is there a way to find the top and left coordinates of the active layout object ?

        • 1. Re: finding the coordinates of an object
          philmodjunk

               Is the object fixed by using the default top, left auto-resize anchors or will its position change as the window size changes?

               If it is fixed, you can pass the needed data as a script parameter that you specify for the button. (Clicking a button does not make it the active object.)

               If this a button in a portal or the body of a list view, it get's a bit more complicated. The active portal row number can be used to adjust the postion for a portal, but a list view might be problematic as there is no way to detect the scroll posiiton of the window.

          • 2. Re: finding the coordinates of an object
            med

                 Actually the reason I said that there are many objects on the layout is the following.

                 The layout is actually a list view, there are 7 objects across and of course they repeat with the list. These objects are anchored to left.

                 Each of these objects is an actual table field but I also assigned it a button definition to run a script called "clickcell" and that script does the rest  of the work like opening the pop up window etc.

                 I can pass the left coordinates of each of the 7 objects across in the script parameter but of course the top is unknown unless there is a function to tell me where am I on the layout.

            • 3. Re: finding the coordinates of an object
              med

                   I also forgot to say that these 7 objects are read only 

              • 4. Re: finding the coordinates of an object
                philmodjunk

                     Then you have a problem as there is no way from just FileMaker functions to determine the scroll position of your window and thus the height remains an unknown quantity.