forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Multiple Select from List...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Jan 30, 2002 11:19 pm    Post subject: Multiple Select from List... Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
laurent_H
Contributor
Contributor


Joined: 30 Jun 2001
Posts: 60

PostPosted: Thu Jan 31, 2002 8:46 am    Post subject: Reply with quote

Thanks Mac,

but it's to difficult for the user to follow this way...
I hope a dll will be created to implement this kind of elements

Thank you again Mac for your great help

_________________
Thanks
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group