Re: Win32Lib ListView + setUserProperty query

new topic     » goto parent     » topic index » view thread      » older message » newer message

Dave Probert wrote:

[snip]

> Sorry but the full code is waaaay to big to post here, but 
> here's the lines that fill the listview:
> 
> -- loclv is the ListView
> -- data is a sequence of values for a row
> -- ids is a matching sequence containing the DB row id's
> 
> 	eraseItems(loclv)
> 	tmph = 0
> 	for i=length(data) to 1 by -1 do
> 		id = addLVItem(loclv,tmph,data[i])	-- add row at a time
> 		if i<= length(ids) then
> 			setUserProperty(id,"identifier",ids[i])
> 		end if
> 	end for
> 

The 'id' in the setUserProperty() call is meant to be a CONTROL and not the
value returned by addLVItem(). It is designed to add a property to a control.
Another method you might like to look at instead is ...

eraseItems(loclv)
 	tmph = 0
 	for i=length(data) to 1 by -1 do
 		id = addLVItem(loclv,tmph,data[i])	-- add row at a time
 		if i<= length(ids) then                  
 			setUserProperty(loclv,id&"identifier",ids[i])
 		end if
 	end for


And then to retrieve the hidden data for a particular id ...

sequence temp
    sequence hidden
    temp = getUserProperty(loclv, id&"identifier")
    if length(temp) > 0 then
        hidden = temp[1]
    else 
         hidden = {}
    end if


> 
> PS. Derek - looking forward to the next win32lib :)

Me too.

-- 
Derek Parnell
Melbourne, Australia
irc://irc.sorcery.net:9000/euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu