1. HOW???
- Posted by Wayne Overman <euman at BELLSOUTH.NET> Jul 19, 2000
- 430 views
------=_NextPart_000_000E_01BFF198.BED4BFC0 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, In the below example I am trying to overlay Listviews in the same spot = in the same window. 1. The problem is when I flip between the Listviews I'm essentially = createing a new List (which I dont want to do.) 2. What method can I use to return to the original List if I have = selected the same list twice. (the answer to the first question should take care of this...) 3. Also, the first Listview item button sends me back to the very first = Listview I created. (which I dont want to do either.) (I Think) that [sendMessage] should clear these two problems up however, = I'm not completely understanding the methods used. I write this after many attempts, and am = in total need of help. Thanks in advance! euman at bellsouth.net procedure Which_List(integer Butt_No) sequence lView lView =3D {"Mechanical","Electrical","Hydraulic","Pneumatic","Misc"} LV =3D create( ListView, { lView[Butt_No], "Part No", "Supplier" }, ChildWin_work_class,200,50,495,370, or_all({LVS_REPORT, LVS_SHOWSELALWAYS})) end procedure =20 Which_List(1) procedure Mech_Butt() Which_List(1) end procedure =20 procedure Elec_Butt() Which_List(2) end procedure procedure Hydr_Butt() Which_List(3) end procedure onClick[btnMech] =3D routine_id( "Mech_Butt" ) onClick[btnElec] =3D routine_id( "Elec_Butt" ) onClick[btnHydr] =3D routine_id( "Hydr_Butt" ) WinMain(MainWin,Maximize) ------=_NextPart_000_000E_01BFF198.BED4BFC0 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>In the below example I am trying to = overlay=20 Listviews in the same spot in the same window.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>1. The problem is when I flip between = the Listviews=20 I'm essentially createing a new List<BR> (which I dont want = to=20 do.)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>2. What method can I use to return to = the original=20 List if I have selected the same list twice.<BR> (the answer = to the=20 first question should take care of this...)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>3. Also, the first Listview item button = sends me=20 back to the very first Listview I created.<BR> (which I dont = want to=20 do either.)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>(I Think) that [sendMessage] should = clear these two=20 problems up however, I'm not completely<BR>understanding the methods = used. I=20 write this after many attempts, and am in total need of = help.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Thanks in advance!</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2><A=20 <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>procedure Which_List(integer = Butt_No)<BR>sequence=20 lView</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>lView =3D=20 <DIV> </DIV> <DIV><FONT face=3DArial size=3D2> LV = =3D create(=20 =20 { lView[Butt_No], "Part No", "Supplier"=20 ; =20 or_all({LVS_REPORT, LVS_SHOWSELALWAYS}))</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>end=20 procedure<BR> <BR>Which_List(1)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>procedure = Mech_Butt()<BR>Which_List(1)<BR>end=20 procedure<BR> <BR>procedure Elec_Butt()<BR>Which_List(2)<BR>end=20 procedure</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>procedure = Hydr_Butt()<BR>Which_List(3)<BR>end=20 procedure</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>onClick[btnMech] =3D routine_id( = "Mech_Butt" =20 )<BR>onClick[btnElec] =3D routine_id( "Elec_Butt" = )<BR>onClick[btnHydr] =3D=20 routine_id( "Hydr_Butt" )</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial=20 ------=_NextPart_000_000E_01BFF198.BED4BFC0--
2. Re: HOW???
- Posted by Brian Broker <bkb at CNW.COM> Jul 19, 2000
- 415 views
On Wed, 19 Jul 2000 15:48:12 -0400, Wayne Overman wrote: >Hello, > >In the below example I am trying to overlay Listviews in the same spot in the same window. You should only 'create' the lists once. When you click on the buttons, you could hide all lists except for the one you wish to view (using setVisible). Another approach you could take is to use TabControls. See EX21.EXW (included with Win32Lib) for a demo... -- Brian
3. Re: HOW???
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Jul 20, 2000
- 414 views
-----Original Message----- From: Wayne Overman >Hello, >In the below example I am trying to overlay Listviews in the same spot in the same window. >1. The problem is when I flip between the Listviews I'm essentially createing a new List > (which I dont want to do.) I think you're coming at this from the wrong perspective. Rather than have multiple lists, all you really need to do is change the contents of each list. I'm partly at fault, since there's no easy way (right now) to change columns. There's another solution to this one (and it's basically what I did in my demo). First, keep a variable to track which list is currently being displayed. Then, when a button is clicked, you can check to see if the same list is already being displayed. Use deleteItem( LV, -1 ) to clear all the items from the list. >2. What method can I use to return to the original List if I have selected the same list twice. > (the answer to the first question should take care of this...) Yup. >3. Also, the first Listview item button sends me back to the very first Listview I created. > (which I dont want to do either.) I don't think I follow you here. >(I Think) that [sendMessage] should clear these two problems up however, I'm not completely >understanding the methods used. I write this after many attempts, and am in total need of help. I haven't wrapped this yet, but you can put this procedure into your code (or into win32lib) to allow you to change the column headers: -- Begin code global procedure setColumn( integer id, integer column, sequence text ) atom LV_COLUMN, ok LV_COLUMN = struct_LVCOLUMN( LVCF_TEXT, 0, 0, text, 0) ok = sendMessage( LV, LVM_SETCOLUMN, column - 1 , LV_COLUMN ) -- Note: wParam (0 above) is the column number (it's a zero-based index) -- lParam is the pointer to the listview column structure free(LV_COLUMN) free_strings() end procedure -- End code Then, in Which_List(), you'd need to add this: setColumn( LV, 1, lView[Butt_No]) to change the column header. procedure Which_List(integer Butt_No) sequence lView lView = {"Mechanical","Electrical","Hydraulic","Pneumatic","Misc"} LV = create( ListView, { lView[Butt_No], "Part No", "Supplier" }, ChildWin_work_class,200,50,495,370, or_all({LVS_REPORT, LVS_SHOWSELALWAYS})) end procedure Which_List(1) procedure Mech_Butt() Which_List(1) end procedure procedure Elec_Butt() Which_List(2) end procedure procedure Hydr_Butt() Which_List(3) end procedure onClick[btnMech] = routine_id( "Mech_Butt" ) onClick[btnElec] = routine_id( "Elec_Butt" ) onClick[btnHydr] = routine_id( "Hydr_Butt" ) WinMain(MainWin,Maximize)
4. Re: HOW???
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Jul 20, 2000
- 432 views
For those of you playing along at home, I need to add a couple of little details to my (originally untested) code.... First, LVM_SETCOLUMN isn't defined in win32lib. The value (which should be added amongst the other LVM_ constants) should be: LVM_SETCOLUMN = 4122 and... > ok = sendMessage( LV, LVM_SETCOLUMN, column - 1 , LV_COLUMN ) should be: ok = sendMessage( id, LVM_SETCOLUMN, column - 1 , LV_COLUMN ) Matt Lewis