1. ListView Question
- Posted by don cole <doncole at pacbell.net> Feb 11, 2005
- 526 views
What's the difference between, ok=sendMessage( ListView1, LVM_SETCOLUMNWIDTH, 1,124) and setColumn(ListView1,1 124 ) Don Cole SF
2. ListView Question
- Posted by don cole <doncole at pacbell.net> Mar 14, 2007
- 515 views
- Last edited Mar 15, 2007
Hello everybody, I have 2 small questions here. if I go: for x=1 to 10 do VOID &=addLVItem(LV,0,sprintf("%d",x)) end for I get in Listview column 1: 10 9 8 7 6 5 4 3 2 1 1.) Is there a way to reverse the order (1 at the top; 10 at the bottom) without having to hit the headings tab? 2.) Is there a way to put just the number in without using sprintf? VOID &=addLVItem(LV,0,x))? TIA Don Cole
3. Re: ListView Question
- Posted by c.k.lester <euphoric at cklester.com> Mar 14, 2007
- 488 views
- Last edited Mar 15, 2007
don cole wrote: > > if I go: > > for x=1 to 10 do > VOID &=addLVItem(LV,0,sprintf("%d",x)) > end for > > 1.) Is there a way to reverse the order (1 at the top; 10 at the bottom) > without > having to hit the headings tab? for x=10 to 1 by -1 do > 2.) Is there a way to put just the number in without using sprintf? > > VOID &=addLVItem(LV,0,x))? probably not.
4. Re: ListView Question
- Posted by don cole <doncole at pacbell.net> Mar 14, 2007
- 498 views
- Last edited Mar 15, 2007
c.k.lester wrote: > > don cole wrote: > > > > if I go: > > > > for x=1 to 10 do > > VOID &=addLVItem(LV,0,sprintf("%d",x)) > > end for > > > > 1.) Is there a way to reverse the order (1 at the top; 10 at the bottom) > > without > > having to hit the headings tab? > > for x=10 to 1 by -1 do > > > 2.) Is there a way to put just the number in without using sprintf? > > > > VOID &=addLVItem(LV,0,x))? > > probably not. Thank you c.k.lester, 1.) I thought of that but thought I might mess other things up. I suppose not. 2.) addLVItem must use text (I guess). Thanks, Don Cole
5. Re: ListView Question
- Posted by Judith Evans <camping at ccewb.net> Mar 14, 2007
- 495 views
- Last edited Mar 15, 2007
don cole wrote: > > Hello everybody, > > I have 2 small questions here. > > if I go: > > for x=1 to 10 do > VOID &=addLVItem(LV,0,sprintf("%d",x)) > end for > > I get in Listview column 1: > > 10 > 9 > 8 > 7 > 6 > 5 > 4 > 3 > 2 > 1 > > 1.) Is there a way to reverse the order (1 at the top; 10 at the bottom) > without > having to hit the headings tab? > From Win32lib docs: [func] setLVInsert (integer pFlag ) Sets the default position for ListView inserts. Returns: The flag setting before this change. Category: ListView Control If pFLag is zero, addLVItem() adds new items to the top of the list, else new items are added at the end. The default is to add items to the top of lists. Example: integer lvInsert -- Make listviews add to end of lists. lvInsert = setLVInsert( 1 ) > 2.) Is there a way to put just the number in without using sprintf? > > VOID &=addLVItem(LV,0,x))? > > TIA > > Don Cole
6. Re: ListView Question
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 14, 2007
- 516 views
- Last edited Mar 15, 2007
don cole wrote: > 1.) Is there a way to reverse the order (1 at the top; 10 at the bottom) > without > having to hit the headings tab? Yes. There are two ways. The first is to call ... atom OldVal OldVal = setLVInsert(1) Then from now on, all addLVItem calls will add to the end of the list. The second is to call addLVItem like this ... VOID &= adLVItem( {LV, -1}, 0, x) The -1 here means add to end of list. You can have other positive numbers here to add at other positions too. > 2.) Is there a way to put just the number in without using sprintf? > > VOID &=addLVItem(LV,0,x))? There is a bug in the code. It is meant to be able to do this but the signature is wrong. > Replace ... global function addLVItem(object id, atom iIcon, sequence text ) > With ... global function addLVItem(object id, atom iIcon, object text ) And then you can say things like for x = 1 to 10 do VOID &= addLVItem({LV,-1},0,x)) end for -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
7. Re: ListView Question
- Posted by don cole <doncole at pacbell.net> Mar 15, 2007
- 507 views
Thanks Judith and Derek, That's exactly what I was looking for on both counts. Both meaning, Judith and Dereck. And both meaning, Derek's explination of two different problems. Just one more question. In my code I only have one listView and Judith's code works perfectly on that. But supposen' I had multiple listViews how would lvInsert = setLVInsert( 1 ) know which listView to apply itself to? Don Cole
8. Re: ListView Question
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 15, 2007
- 505 views
don cole wrote: > In my code I only have one listView. But supposen' I had multiple listViews > how would > > > lvInsert = setLVInsert( 1 ) > > know which listView to apply itself to? It has a global effect. It effects all listviews. That is why you can use the syntax addLVItem( { lv, -1}, ... ) Also, one could code ... -- Set effect on temp = setLVInsert( 1 ) addLVItem ( ... ) -- Revert to previous setting. temp = setLVInsert( temp ) -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
9. Re: ListView Question
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Mar 15, 2007
- 498 views
Derek Parnell wrote: > > don cole wrote: > > In my code I only have one listView. But supposen' I had multiple listViews > > how > would</font></i> > > > > > > lvInsert = setLVInsert( 1 ) > > > > know which listView to apply itself to? > > It has a global effect. It effects all listviews. That is why you can use the > syntax > > addLVItem( { lv, -1}, ... ) > > Also, one could code ... > > -- Set effect on > temp = setLVInsert( 1 ) > addLVItem ( ... ) > -- Revert to previous setting. > temp = setLVInsert( temp ) > > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell In the various mods I made and submitted to Derek, setLVinsert() can act locally (ie each ListView has its own flag, and you can act on either the local or global one). Perhaps this will make it to the next official lib. CChris