Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Jan 30, 2002 11:19 pm Post subject: Multiple Select from List... |
|
|
Here's a way to get multiple list selection (unfortunately
it DOES NOT hilight selections). Just click the start and
end items to select, it resets automatically. The status
bar let's ya know which ones ya clicked (by index).
__________________________________________________________________________________________________________________________
Code: |
rem -- VDS3 and VDS4 compatible --
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,Test prog,-1,0,300,200
DIALOG ADD,BUTTON,B1,5,5,100,20,"Show Selection"
DIALOG ADD,LIST,L1,30,5,290,145,,CLICK
DIALOG ADD,STATUS,Stat,"Ready..."
DIALOG SHOW
%x = 0
REPEAT
LIST ADD, L1, "Item number "%x
%x = @succ(%x)
UNTIL @greater(%x, 20)
:EVLOOP
DIALOG SET, Stat, Selected items: %%start - %%end
WAIT EVENT
goto @event()
:L1CLICK
rem -- If already have start and end pos, get new start --
if @both(%%start, %%end)
%%start = @index(L1)
%%end = ""
goto EVLOOP
end
rem -- Get start pos first --
if @not(%%start)
%%start = @index(L1)
else
%%end = @index(L1)
end
goto EVLOOP
:B1BUTTON
%s = ""
if @both(%%start, %%end)
if @greater(%%start,%%end)
%y = %%start
%x = %%end
else
%x = %%start
%y = %%end
end
REPEAT
%s = %s@cr()@item(L1, %x)
%x = @succ(%x)
UNTIL @greater(%x, %y)@not(%y)
else
if %%start
%s = @cr()@item(L1, %%start)
else
%s = @cr()"Nothing selected..."
end
end
INFO Selected items: @tab()@cr()%s
goto EVLOOP
:CLOSE
EXIT
|
[EDIT]
Can select either direction (up or down) or single items now. _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
|
|