4 Replies Latest reply on Aug 13, 2010 3:46 AM by JulieTibbs

    Cursor position

      Title

      Cursor position

      Post

      I have a large matrix of buttons on one screen to navigate my data base. Instead of writing a script for each button I could write one script and read the cursor position. I can see the cursor positin in the object info palette but can't find any way of reading it into a script.

      Does any body know how I can read the cursor position in FP10

        • 1. Re: Cursor position
          philmodjunk

          If you give everything an object name, Get (ActiveLayoutObjectName) should tell you the name of the current layout object that has the focus. If it's always a field, you won't need to assign object names, you can use Get(ActiveFieldName) to determine the name of the field that currently has the cursor.

          Sometimes it works best to pass such info as a parameter to the script.

          • 2. Re: Cursor position

            Thanks. I now have a matrix of fields which I click and then having selected one I hit a button which reads the active field then opens the relevant part of the data base. It means I have 2 clicks to do but that works.

            • 3. Re: Cursor position
              philmodjunk

              Two alternatives:

              Use a dropdown list or pop-up menu that lists the places your user might want to select. Use a script trigger to fire a script that goes to the location slected from the drop down when they either exit the field ( drop down ) or modify it ( pop-up ).

              If you prefer a button grid. Use the paramter setting to pass a value, such as a layout name to the script the button is set to perform:

              All the buttons could then use the same script:

              Go To Layout [ Get ( ScriptParameter ) ]    (Use layout name or layout number by calculation options)

              Of course, if you need more sophisticated things to be done besides switching layouts (such as different sorts and finds for different layouts), you can use a series of If-ElseIF-Else-EndIF steps to perform different operations based on the parameter sent to the script.

              Either way, you don't have to do two button clicks just to go to a particular layout.

              • 4. Re: Cursor position
                JulieTibbs

                This is great I wish I had found out about triggers before