15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


CListCtrl Sub-items as graphics

Brett Comstock -- brettc@techint.com
Wednesday, November 27, 1996

Environment: Win 95, VC++ 4.1

I am using/designing a CListCtrl-derived class which holds the results
of a SQL query; the desired query is passed to the control with a member
function and all of the data access details are handled by the list
control.  I would like to be able to display boolean data with a
graphic, such as a checked/unchecked box a la MS Access, or a green/red
circle, etc.  My understanding of the CImageList functionality is that
the image can be placed in front of the first column or left out, but,
since the boolean data I'm concerned with may appear in any number of
columns, that's inadequate.  

How could I go about making a column display graphical data?  

Thanks for any help,
Brett Comstock  8^)
>




James Durie -- james@apiltd.demon.co.uk
Monday, December 02, 1996

Brett Comstock wrote:
> 
> Environment: Win 95, VC++ 4.1
> 
> I am using/designing a CListCtrl-derived class which holds the results
> of a SQL query; the desired query is passed to the control with a member
> function and all of the data access details are handled by the list
> control.  I would like to be able to display boolean data with a
> graphic, such as a checked/unchecked box a la MS Access, or a green/red
> circle, etc.  My understanding of the CImageList functionality is that
> the image can be placed in front of the first column or left out, but,
> since the boolean data I'm concerned with may appear in any number of
> columns, that's inadequate.
> 
> How could I go about making a column display graphical data?
> 
> Thanks for any help,
> Brett Comstock  8^)
> >

I thought this as well but have recently discovered that it is untrue. 
You can specify an entry in the imagelist for sub-items also.  I have
seen this it does work, though admittedly i was doing callbacks for all
the data.

What i did if anyone is interested is define a CArrayListCtrl
templatised class which binds a CArray with a CListCtrl so that all the
data comes directly from the CArray.

-- 
James Durie                   | Atlas Products International Ltd,
(james@apiltd.demon.co.uk)    | Quay West, Trafford Wharf Road,
"Smile, It's Tate & Lyle"     | Manchester, M17 1HH, England.
             - Gary Rhodes    | +44 161 872 2022, Fax +44 161 872 2024
Disclaimer: The views represented here are mine and not those of Atlas
Products International Ltd.




| Вернуться в корень Архива |