| View previous topic :: View next topic |
| Author |
Message |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Sep 23, 2002 10:08 pm Post subject: List box - emulate list box with columns |
|
|
One way of having two list boxes perform as a multi-column list. Keeps the two lists in sync.
Greetz
Dr. Dread
| Code: |
title Multi-column list box emulation
option DECIMALSEP,"."
dialog CREATE, ..by Dr. Dread,-1,0,700,400,,DRAGDROP
dialog add,text,t1,5,10,,,Drag&&drop files to box. Second column can be double-clicked to edit values.
dialog ADD,LIST,LB,30,10,500,360,,CLICK
dialog ADD,LIST,LB2,30,510,180,360,,DBLCLICK,CLICK
dialog SHOW
:evloop
wait event
goto @event()
:dragdrop
list DROPFILES,LB
%%countLB = @count(LB)
%%diff = @diff(@count(LB),@count(LB2))
%%inc = 0
repeat
list add,LB2,property #%%inc
%%inc = @succ(%%inc)
until @equal(%%diff,%%inc)
goto evloop
:LBclick
%%dummy = @sendmsg(@win(~LB),$018E,0,0)
%%dummy = @sendmsg(@win(~LB2),$0197,%%dummy,0)
%%indexLB = @index(LB)
list seek,LB2,%%indexLB
goto evloop
:LB2click
%%dummy = @sendmsg(@win(~LB2),$018E,0,0)
%%dummy = @sendmsg(@win(~LB),$0197,%%dummy,0)
%%indexLB2 = @index(LB2)
list seek,LB,%%indexLB2
goto evloop
:LB2dblclick
%%dummy = @sendmsg(@win(~LB2),$018E,0,0)
%%dummy = @sendmsg(@win(~LB),$0197,%%dummy,0)
%%indexLB2 = @index(LB2)
%%valueLB2 = @item(LB2)
%%newvalue = @INPUT(Enter new value:,%%valueLB2,)
list put,LB2,%%newvalue
%%dummy = @sendmsg(@win(~LB2),$0186,%%indexLB2,0)
goto evloop
:CLOSE
exit
|
_________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Sep 23, 2002 10:39 pm Post subject: |
|
|
Hey Dread,
Here's a different approach that allows you to click
on different columns in a single list, but it requires
the "columns" to be parsable:
__________________________________________________________________________________________________________________________
| Code: |
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,"List Columns",-1,0,300,200
DIALOG ADD,STYLE,S1,Courier New,10,B
DIALOG ADD,TEXT,T1,3,2,,," Column1 Column2 Column3",,S1
DIALOG ADD,LIST,L1,20,5,290,155,,CLICK,S1
DIALOG ADD,STATUS,Stat
DIALOG SHOW
LIST ADD, L1, " Row1-Col1 | Row1-Col2 | Row1-Col3 "
LIST ADD, L1, " Row2-Col1 | Row2-Col2 | Row2-Col3 "
LIST ADD, L1, " Row3-Col1 | Row3-Col2 | Row3-Col3 "
LIST ADD, L1, " Row4-Col1 | Row4-Col2 | Row4-Col3 "
LIST ADD, L1, " Row5-Col1 | Row5-Col2 | Row5-Col3 "
LIST ADD, L1, " Row6-Col1 | Row6-Col2 | Row6-Col3 "
LIST ADD, L1, " Row7-Col1 | Row7-Col2 | Row7-Col3 "
LIST ADD, L1, " Row8-Col1 | Row8-Col2 | Row8-Col3 "
LIST ADD, L1, " Row9-Col1 | Row9-Col2 | Row9-Col3 "
:EVLOOP
WAIT EVENT
goto @event()
:L1CLICK
PARSE "%a;%b;%c", @item(L1)
%%left = @winpos(@winexists(~L1), L)
if @greater(@sum(%%left, 96), @mousepos(X))
%%item = %a
else
if @greater(@sum(%%left, 192), @mousepos(X))
%%item = %b
else
%%item = %c
end
end
DIALOG SET, Stat, Selected Item= %%item List left= %%left MouseX= @mousepos(X)
goto EVLOOP
:CLOSE
EXIT
|
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 |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Sep 23, 2002 10:45 pm Post subject: |
|
|
Hey Mac!
I tried something like that, just tab-separated, but it did not work out well with data strings that weren't fixed-width
I still cannot imagine why VDS does not have such a common and useable element as a multi-column list
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Sep 23, 2002 10:57 pm Post subject: |
|
|
Yeah, it'd be pretty handy to have columnized lists.
The example I posted could be modified to use a
loop that auto adjusts new entries (trim/pad), but
it does require a "same width" font. And those just
don't usually look as good...
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 |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Sep 23, 2002 11:03 pm Post subject: |
|
|
Well, actually your example looks fine as long as everything is aligned nicely. Didn't think of the possibility of formating the list on
the fly. That could work out just fine.
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Sep 24, 2002 2:50 am Post subject: |
|
|
Wouldn't make a difference if VDS had that or not, Mac is destined to use
VDS 3 for the next 10 years.. The rest of us will be using like VDS 8 and
Mac will still be posting VDS 3 code!
-Garrett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Sep 24, 2002 3:09 am Post subject: |
|
|
8O
ROFL...
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 |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Tue Sep 24, 2002 5:26 am Post subject: |
|
|
| Nothing wrong with sticking with what you think is more towards what you need. I've fluctuated between VDS 3 and 4 for some time now and don't know which one I'll eventually choose to use exclusively. |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Sep 24, 2002 8:14 am Post subject: |
|
|
Well, I've stuck with VDS3 as well as v. 4 just didn't offer much that made an upgrade worthwhile.
But I did upgrade my Win95 box! (notch .. notch, Mac! )
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Sep 24, 2002 8:22 am Post subject: |
|
|
Sheesh Dread, ya have any idea how long it took
me to figure out Windows 95? 8O
Lol, this must be "pick on Mac" night...
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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Sep 24, 2002 3:42 pm Post subject: |
|
|
Weeeeeeell........ It was a poke fun at Mac post, but I didn't think it would
carry on like this now! Hehehehehee And you do know that most
third world countries have upgraded to at least Win98..... BTW, I've
got an old 386 SX/25 Laptop here with Windows 3.1 on it, you interested
in upgrading to it Mac? Oh!!!!!! There I go again! I'm sorry Mac, I'll stop
teasing.
-Garrett
[ Poke fun at Mac Mode OFF ] |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Sep 24, 2002 8:22 pm Post subject: |
|
|
Hey, I still gotta Tandy that works...
Lol, for some strange reason this reminds me of
what an elderly friend told his grandkids once:
The little ones were laughing at grandpa 'cause
he had no teeth. He got real sober and said....
"Ya'll shouldn't make fun of me like that, I was born
without any teeth...". And then the kids started feelin'
real sorry for him.
Well.... I was born without Windows 98...
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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Sep 24, 2002 10:43 pm Post subject: |
|
|
Yeah, well I wasn't born with Win98 either, but I'll be damned if I'm going
to use Dos 3.3 and Windows 3.0!!! LOL!!! Well ok, I did like Windows
3.0 and 3.1, and Dos was fun back then too. My other favorite during that
time was the GeoWorks Ensemble OS. Ran ontop of dos like Windows
does.
-Garrett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Sep 24, 2002 11:07 pm Post subject: |
|
|
Well seriously Garrett (if that's possible ...), I'm
happy with Win95. I'm familiar with it, and have
it configured so that it's incredibly stable. Mine just
practically doesn't give any problems (last format
and install was about 3 yrs ago I think).
If it does what ya want and ain't broke, why fix it?
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 |
|
 |
Que Valued Newbie

Joined: 25 Aug 2001 Posts: 38 Location: Newaygo, MICH
|
Posted: Wed Sep 25, 2002 12:46 pm Post subject: |
|
|
I own copies of 95, 98 and ME. I'm considering taking my ME box back to 98... I'd go back to 95 except I've got at least 6 USB devices (off the top of my head) that I would no longer be able to connect to. If anyone knows a way to get USB ports to work on 95... please let me know.  _________________ Que |
|
| Back to top |
|
 |
|
|
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
|
|