View previous topic :: View next topic |
Author |
Message |
flypaper Contributor
Joined: 19 Oct 2001 Posts: 104
|
Posted: Thu Apr 11, 2002 7:12 pm Post subject: How can I get items from this list to another? |
|
|
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 |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Apr 11, 2002 7:19 pm Post subject: |
|
|
__________________________________________________________________________________________________________________________
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 |
|
|
flypaper Contributor
Joined: 19 Oct 2001 Posts: 104
|
Posted: Thu Apr 11, 2002 7:47 pm Post subject: |
|
|
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. Thanks for sorting me out. |
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Apr 11, 2002 8:44 pm Post subject: |
|
|
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 _________________ 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 |
|
|
flypaper Contributor
Joined: 19 Oct 2001 Posts: 104
|
Posted: Fri Apr 12, 2002 4:22 pm Post subject: |
|
|
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 |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Apr 12, 2002 5:04 pm Post subject: |
|
|
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 |
|
|
moke Contributor
Joined: 02 Jan 2002 Posts: 162
|
Posted: Fri Apr 12, 2002 5:27 pm Post subject: |
|
|
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 |
|
|
flypaper Contributor
Joined: 19 Oct 2001 Posts: 104
|
Posted: Fri Apr 12, 2002 6:05 pm Post subject: |
|
|
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 |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Apr 12, 2002 6:25 pm Post subject: |
|
|
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 _________________ 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 |
|
|
Protected Valued Contributor
Joined: 02 Jan 2001 Posts: 228 Location: Portugal
|
Posted: Sun Apr 14, 2002 12:14 am Post subject: |
|
|
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 |
|
|
|