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 can I get items from this list to another?

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


Joined: 19 Oct 2001
Posts: 104

PostPosted: Thu Apr 11, 2002 7:12 pm    Post subject: How can I get items from this list to another? Reply with quote

I have a dialog list box (LIST1) and when someone double clicks on an item in the listbox, I would like it to be removed from LIST1 dialog and added to a LIST2 dialog. How can I do this, 'o great ones??
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


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

PostPosted: Thu Apr 11, 2002 7:19 pm    Post subject: Reply with quote

__________________________________________________________________________________________________________________________
When you create List1, add the DBLCLICK style.
This creates a List1DBLCLICK event, so you need
something like this:
Code:

:EVLOOP
  WAIT EVENT
  goto @event()

:List1DBLCLICK
  rem -- Add the selected item to List2 --
  LIST ADD, List2, @item(List1)
  rem -- Remove the selected item from List1 --
  LIST DELETE, List1
  goto EVLOOP

BTW, you can use both CLICK and DBLCLICK styles
on the same list. You just need two labels (such as
List1CLICK and List1DBLCLICK).

_________________
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
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Thu Apr 11, 2002 7:47 pm    Post subject: Reply with quote

Thanks yet again...

One more question along the same line, is there an easy way to add LIST2 back into LIST1? I know I could go through and add them back in one by one, but is there an easier way?

I don't know why I find lists so difficult. Twisted Evil Thanks for sorting me out.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


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

PostPosted: Thu Apr 11, 2002 8:44 pm    Post subject: Reply with quote

If you have VDS4x, there's a LIST APPEND command
that appends one list to another.

You can use LIST ASSIGN which overwrites one list
with another one. Other than these, I think you're
stuck with using a loop...

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
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Fri Apr 12, 2002 4:22 pm    Post subject: Reply with quote

Damn, another list question...

With the list dialog box again, I have the list sorted, and it appears that I can start typing the last name and it will go to that name in the list. Now, once a name is selected in the list is there a way that I can use either the DBLCLICK or the user pressing enter to move it to a new list?

I hope it's okay to continue to ask in this thread. I'd really hate to start thirty-nine threads for this stuff.
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Apr 12, 2002 5:04 pm    Post subject: Reply with quote

flypaper wrote:
With the list dialog box again, I have the list sorted, and it appears that I can
start typing the last name and it will go to that name in the list. Now, once a name is selected in
the list is there a way that I can use either the DBLCLICK or the user pressing enter to move
it to a new list?

I think that the first part of your question (moving an item by double-clicking) should
be adequately covered by Mac's first answer above.

You cannot make Enter work directly on your list. But there may be a way of making it work. If you
have some sort of Go button that is used for performing your move action when a line is selected in your list,
then give that button the DEFAULT style and it will catch an Enter command given when your
list is in focus. If you don't have such a button then make a hidden dummy button to do the same thing:
Code:
DIALOG ADD,BUTTON,Dummy,1,1,0,0,,DEFAULT


Then make a section for the new dummy button:

:DummyBUTTON
LIST ADD, List2, @item(List1)
LIST DELETE, List1
goto EVLOOP

Greetz
Dr. Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
moke
Contributor
Contributor


Joined: 02 Jan 2002
Posts: 162

PostPosted: Fri Apr 12, 2002 5:27 pm    Post subject: Reply with quote

If I understand the question you should be able to use a dblclick event to move it for you like this.

:dblclicklist1
list add, list2,@item(list1)
list delete,list1
goto evloop
Back to top
View user's profile Send private message Send e-mail
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Fri Apr 12, 2002 6:05 pm    Post subject: Reply with quote

Sorry guys. Didn't mean to confuse. I've got the DBLCLICK thing down, just need to figure out how to make the ENTER key work.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


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

PostPosted: Fri Apr 12, 2002 6:25 pm    Post subject: Reply with quote

Then all you need is a button with the DEFAULT style.
It can either be hidden as Dread suggested, or you
can show a button (DEFAULT style) that the user can
either click with the mouse or hit the keyboard ENTER
key.

BTW, I usually set all 4 parameters to zero on a button
I want hidden.

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
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Sun Apr 14, 2002 12:14 am    Post subject: Reply with quote

You can also make a menu item with ENTER as the shortcut key... or use a hotkey dll.... there are lots of ways
Back to top
View user's profile Send private message Send e-mail 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