View previous topic :: View next topic
|
Author |
Message |
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I have not figured this out yet...
I have a panel with a scrollable area, for example:
Code: |
)ATTR
} AREA(SCRL) EXTEND(ON)
...
)BODY
Command ===>_zcmd +
...
} SCRLAREA }
)AREA SCRLAREA
line 1 . . . _var1 +
line 2 . . . _var2 +
...
line 99 . . . _var99+
|
Lets say that the user scrolls down some and sees line 55 through line 80. I would like for the user to press Enter and to be able to display line 55 through 80 again.
If the cursor is on var55, I can cause the panel to show var55 first through the use of the .CURSOR tag. But if the cursor is on the command line, I do not know the relative position of the scrollable area.
Is there a way to know the position? |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Does the LVLINE variable tell you anything? Its intended use is for dynamic areas, but I have never tried it on a panel with a scrollable area. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
Does the LVLINE variable tell you anything? |
It did not work:
Code: |
ISPP286
Panel 'TESTPNL' error
The area referenced by the LVLINE function is not a dynamic or graphic
area on the panel. |
|
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
ZSCREENI? Perhaps you could parse it and figure out what is visible to the user at the time they hit ENTER and then re-position the area accordingly.
Just another guess, I have used ZSCREENI before, but never for this purpose. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
and then re-position the area accordingly. |
I was trying ZSCREENI earlier today. You can determine the current location, but I worry about scalability. That is, my proof of concept was for a few lines on a single panel. But implementing that for hundreds of lines on hundreds of panels is nightmarish.
And positioning to where you were before is problematic. I have not yet figured out how. If you use .CURSOR, there is a case where if your field is within the first page, no scrolling is done.
I am trying to use DOWN 20, for example, but that results in a Enter situation. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
newsflash: old dog learns new tricks!
I did not know this before. If you do not provide a panel parameter, the same panel and same position is displayed. Woot!
Code: |
panel = "PANEL(TESTPNL)"
Do while (rc=0)
"DISPLAY" panel
panel = ''
End |
|
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Cool! I will have to remember that one.
I once had a panel with a very large scrollable area. There were many fields in the scrollable area that were defined as point and shoot. The idea was to mimiic hyperlinks so that selecting one would take you to another panel. On returning to the main panel, I had to bend over backwards using the .CURSOR field to reposition the area. If I had only known there was an easier way...... |
|
Back to top |
|
|
|