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 


How to fill a COMBO?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 10:13 pm    Post subject: How to fill a COMBO? Reply with quote

Someone told me how to fill a COMBO with contents. But I managed to delete the PM.

Here's my code so far:
Code:
Title Experiment
  DIALOG CREATE,New Dialog,-1,0,240,160
REM *** Modified by Dialog Designer on 21.02.2003 - 19:49 ***
  DIALOG ADD,MENU,File,About,-,Exit
  DIALOG ADD,COMBO,COMBO1,40,32,176,21,A,Tooltip,LIST,CLICK,EXIT
  gosub fillcombo1
  DIALOG SHOW

:Evloop
wait event
goto @event()

:fillcombo1
list loadtext,combo1,
"A
"E
"C
"G
"B
DIALOG SET,COMBO1,A
exit

:Close
exit


Is this the right way to do it? By using the list command I mean.
And how do I set a default value. When I run this nothing shows up in the list.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Fri Feb 21, 2003 10:19 pm    Post subject: Reply with quote

LIST SEEK, COMBO1, 0
_________________
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
Mac
Professional Member
Professional Member


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

PostPosted: Fri Feb 21, 2003 10:22 pm    Post subject: Reply with quote

OR ya can use:

if @match(COMBO1, "A")
end


BTW, @match() searches from the current index position - so
ya gotta use LIST SEEK, COMBO1, 0 first to search from
the beginning (if the index isn't already at the start). Wink

Cheers, Mac Smile

_________________
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


Last edited by Mac on Fri Feb 21, 2003 10:25 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 10:24 pm    Post subject: Reply with quote

Oh, that easy? Laughing

Thanks again Mac Smile

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


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

PostPosted: Fri Feb 21, 2003 10:27 pm    Post subject: Reply with quote

No prob - but you posted while I was adding a BTW
ya might wanna see... Wink

Cheers, Mac Smile

_________________
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
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 10:42 pm    Post subject: Reply with quote

I just did it like this and it works great. Atleast on my machine. I'm using VDS 4.5
Code:
:fillcombo1
rem Fills the COMBO1 box with data
list loadtext,combo1,
"A
"E
"C
"G
"B
rem Sets A as the standard selection
if @match(COMBO1, "A")
end
exit

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Feb 21, 2003 11:44 pm    Post subject: Reply with quote

Here's a script that might help... I added some extra event labels that
would pertain to your code. Wink

Also note that the code Mac and you discussed doesn't need to be placed
in a script with a COMBO without the LIST style: without it you can use
the value (right after the 21 in your code). Smile

Code:
Title Experiment
  DIALOG CREATE,New Dialog,-1,0,240,134
  DIALOG ADD,MENU,File,About,-,Exit
  REM -- The "list" style will make it so that input cannot be typed into the COMBO --
  DIALOG ADD,COMBO,COMBO1,40,32,176,21,A,Tooltip,LIST,CLICK,EXIT
  gosub fillcombo1
  DIALOG ADD,BUTTON,ClickMe,70,72,92,24,Click Me
  DIALOG SHOW

:Evloop
wait event
goto @event()

:fillcombo1
list loadtext,combo1,
"A
"E
"C
"G
"B
DIALOG SET,COMBO1,A
exit

REM -- Added events --

:COMBO1EXIT
warn You've left the COMBO1 focus !
goto evloop

:CLICKMEBUTTON
warn You've clicked the 'Click Me' button !
goto evloop

:COMBO1CLICK
warn You've clicked the item @item(COMBO1)!
goto evloop

:Close
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


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

PostPosted: Fri Feb 21, 2003 11:44 pm    Post subject: Reply with quote

Yep - that works because ya just loaded the list. However, if
the user clicks on "C" (for example), and then ya use @match()
again, it will only search from "C". That's why I mentioned the
LIST SEEK command. Wink

Cheers, Mac Smile


OOPS - FF beat me to the post.... Embarassed

_________________
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
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Fri Feb 21, 2003 11:54 pm    Post subject: Reply with quote

You guys are great.
I'm gonna add FreezingFire to the thank you section in my program Wink
Along with Mac and Rubes_sw Very Happy

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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