| View previous topic :: View next topic |
| Author |
Message |
NathanH Valued Newbie
Joined: 05 Sep 2001 Posts: 32
|
Posted: Thu Jun 23, 2005 5:41 pm Post subject: Jump to item in table? |
|
|
Using VDS5 I have a table with 300 items. When my app starts it seeks the last item that was selected. This works, and the item is selected, but you have to scroll down in the list to see it if it is not in the first 25 visible items.
Is there a to make the list scroll to the item selected using LIST SEEK or @MATCH?
Cheers,
Nathan |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Jun 23, 2005 6:50 pm Post subject: |
|
|
According to the tabletst.dsc script the LIST SEEK command should work. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
NathanH Valued Newbie
Joined: 05 Sep 2001 Posts: 32
|
Posted: Thu Jun 23, 2005 7:31 pm Post subject: |
|
|
If you run the tabletst.dsc script and add 10 items, scroll to the bottom, then seek, it will highlight the first item in the list, but not scroll the list, if you try Match 'Yet another' it will find and highlight 'Yet another table item', but if it is "off screen" it will not scroll to it.
A LIST works as expected, it's just a TABLE that does not auto scroll to the item select
Any other ideas
Cheers
Nathan |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Thu Jun 23, 2005 7:56 pm Post subject: |
|
|
This may or may not be the best way to handle this, but it works
| Code: |
rem Get the topindex
%%LVM_GETTOPINDEX = 4135
%%LVM_SCROLL = 4116
REM This is an educated guess about the font height
%%fontHeight = 15
list seek,table1,20
%%topIndex = @sendmsg(~table1,%%LVM_GETTOPINDEX,0,0)
%%scrollAmt = @diff(@index(table1),%%topIndex)
%z = @sendmsg(~table1,%%LVM_SCROLL,0,@prod(%%scrollAmt,%%fontHeight))
dialog focus,table1
|
Hope this helps. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
NathanH Valued Newbie
Joined: 05 Sep 2001 Posts: 32
|
Posted: Thu Jun 23, 2005 9:17 pm Post subject: |
|
|
Thanks ShinobiSoft, I'll give it a try.
I found another work around that also does the job, basically I move the last selected item so it's at the top.
I'll try your code and see if that fits the bill better!
Cheers,
Nathan |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Jun 23, 2005 11:55 pm Post subject: |
|
|
This will take care of it for ya.
| Code: | %%table = <TableName>
%X = @sendmsg(~%%table,$1013,@index(%%table),0) |
|
|
| Back to top |
|
 |
|