RE: listview items colors

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

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C2159B.771DEFC0
 charset=iso-8859-1

Thanks Tone.

There is a bug. It is in the defineUserProperty routine. Replace the
lines...

    -- If not, then add it a new property.
    if lPropIdx = 0 then
        window_tag[pControl][tagPropId] =
append(window_tag[pControl][tagPropId], pPropId)
        window_tag[pControl][tagPropInit] =
append(window_tag[pControl][tagPropId], pData) -- BUG
        window_tag[pControl][tagPropData] =
append(window_tag[pControl][tagPropId], pData) -- BUG

with...

    -- If not, then add it a new property.
    if lPropIdx = 0 then
        window_tag[pControl][tagPropId] =
append(window_tag[pControl][tagPropId], pPropId)
        window_tag[pControl][tagPropInit] =
append(window_tag[pControl][tagPropInit], pData)
        window_tag[pControl][tagPropData] =
append(window_tag[pControl][tagPropData], pData)

My mistake was caused by copying a line of code twice and only changing one
element reference in each of the two copied lines. This is a common mistake
with using append() etc... 
----------
Derek.

> -----Original Message-----
> From: tone.skoda at gmx.net [mailto:tone.skoda at gmx.net]
> Sent: Monday, 17 June 2002 8:36
> To: EUforum
> Subject: Re: listview items colors
> 
> 
> 
> Attached is a library for Win32Lib v0.57.7 with demo to 
> create colored list
> view and tree view items.
> 
> global routines are:
> 
> set_tv_item_text_color
> set_tv_item_bk_color
> set_lv_item_text_color
> set_lv_item_bk_color
> 
> For listviews you are able to set same color for the whole 
> row, not every
> item in row with different color.
> I didn't know of setUserProperty() functions. With them it is 
> much easier to
> create libraries for win32lib.
> I'm not sure if they're fast? And are you able to use ids of 
> items for first
> parameter, or are only ids of windows valid?
> Also, I think they have some bugs, that's why background 
> color of one item
> in treeview will be black which is not right.
> Here it goes:
> 
> First of, why does this display 1 and not 10:
> 
> defineUserProperty (Win, 1, 10)
> ?getUserProperty (Win, 1)
> 
> Secondly, here must be bug:
> 
> defineUserProperty (Win, 1, 10)
> setUserProperty (Win, 1, 10)
> ?getUserProperty (Win, 1)
> defineUserProperty (Win, 2, 20)
> ?getUserProperty (Win, 1)
> setUserProperty (Win, 2, 20)
> ?getUserProperty (Win, 1)
> 
> It outputs this:
> {10}
> {1}
> {1}
> 
> instead of this:
> {10}
> {10}
> {10}
> 
> 
> 
> 

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
==================================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.


==================================================================

------_=_NextPart_000_01C2159B.771DEFC0
Content-Type: application/ms-tnef

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

Search



Quick Links

User menu

Not signed in.

Misc Menu