Get/set scroll position (text fields, portals, layouts)

Idea created by Jason Wood on Jan 6, 2019
    Active
    Score14

    There are many times when we lose an object's scroll position and we have no way to restore it automatically.

     

    This could be solved with

    1) a function: GetScrollPosition ( [ objectName ] )

    Returns the scroll position (in points) of the portal or field with the specified object name, or if no object name is specified, returns the scroll position of the layout.

     

    And 2) a script step: Set Scroll Position [ position ; objectName ; animation speed ]

    Sets the scroll position (in points) of the portal or field with the specified object name, or if no object name is specified, sets the scroll position of the layout.

     

    This would allow for:

     

    Obviously...

    Switch layouts, then return to the original layout and restore the scroll position of the layout or portals

    Scriptable scrolling in tall layouts and list views.

     

    More interestingly...

    Implement an auto-save feature on a "notes" field. For example you might use an OnTimer script to commit the record if the user hasn't typed anything for 5 seconds. We can already restore the position of the cursor, but with this feature we could restore the scroll position for larger notes, making the auto-save process entirely transparent to the user.