Multiple lines per row in a CListCtrl
Marc Temanson -- met@indy.net
Wednesday, January 22, 1997
Environment: VC++ 4.2b, Win 95/NT 4.0 using MFC
Has anyone seen or written a ListCtrl type class that support multiple
lines per row? For example, instead of using ellipsis to truncate text,
use word breaks to wrap the text to another line that would still be part
of a single list ITEM. The solution would be possible if I could specify a
rectangle size unique to each row in a list control and could receive this
rectangle as the update rect in the DrawItem function in my owner draw list
control. Any examples or leads would be appreciated (even examples in
straight Win32 would be fine).
Thank you,
Marc Temanson
Jim Murphy -- jim.murphy@aspentech.com
Friday, January 24, 1997
[Mini-digest: 2 responses]
Marc,
Stingray...$795, nuff sed...pays yer monies and writes yer softwares.
>
>Environment: VC++ 4.2b, Win 95/NT 4.0 using MFC
>
>Has anyone seen or written a ListCtrl type class that support multiple
>lines per row? For example, instead of using ellipsis to truncate text,
>use word breaks to wrap the text to another line that would still be part
>of a single list ITEM. The solution would be possible if I could specify a
>rectangle size unique to each row in a list control and could receive this
>rectangle as the update rect in the DrawItem function in my owner draw list
>control. Any examples or leads would be appreciated (even examples in
>straight Win32 would be fine).
>
>Thank you,
>
>Marc Temanson
>
>
>
**************************************************************************
||
|||||| Jim Murphy
|||||||||| Senior Engineer
||||||||||||||
|||||||||||||| Advanced Control & Optimization Div.
|||||||||||||| Aspen Technology Inc.
|||||||||| Houston, TX
|| T(713) 313-1171 F(713) 313-1380
||
**************************************************************************
-----From: hou@tfn.com (Bing Hou)
Marc,
The CListCtrl class doesn't support variable hight style. If you are just
displaying rows of text, you may consider using CListBox control with
LBS_OWNERDRAWVARIABLE style and handle overriding MeasureItem and DrawItem
virtual functions.
If you have to use CListCtrl class. The way I see it may spelled out like this.
Since you're drawing all items yourself, you're in complete control. Then you
can use two rows to draw one item's text. Say if item number 2 needs word wrap,
you draw the first part of item no.2's text in no.2's place, then you draw the
reminding text in item number 3's place. Then of course you need to handle
selection, highlighting stuff etc. yourself.
Bing Hou
hou@tfn.com
===========================================
Jambalaya Baby!!! -- Let the game begin.
===========================================
______________________________ Reply Separator _________________________________
Subject: Multiple lines per row in a CListCtrl
Author: "Marc Temanson" at Internet
Date: 1/22/97 3:01 PM
Environment: VC++ 4.2b, Win 95/NT 4.0 using MFC
Has anyone seen or written a ListCtrl type class that support multiple
lines per row? For example, instead of using ellipsis to truncate text,
use word breaks to wrap the text to another line that would still be part
of a single list ITEM. The solution would be possible if I could specify a
rectangle size unique to each row in a list control and could receive this
rectangle as the update rect in the DrawItem function in my owner draw list
control. Any examples or leads would be appreciated (even examples in
straight Win32 would be fine).
Thank you,
Marc Temanson
David Cunningham -- davec@dundas.com
Monday, January 27, 1997
Marc,
What you are describing should not be too difficult to put together
using an ownerdrawn cell, and generating the cell contents manually
using the Win32 sdk call DrawText().
I don't have any code for this, mostly due to the fact that we sell a
MFC class extension called Ultimate Grid that provides high end grid
function including the multiline cell type you describe Check it
out, it might help. http://www.dundas.com
Dave Cunningham
Dundas
> Environment: VC++ 4.2b, Win 95/NT 4.0 using MFC
>
> Has anyone seen or written a ListCtrl type class that support multiple
> lines per row? For example, instead of using ellipsis to truncate text,
> use word breaks to wrap the text to another line that would still be part
> of a single list ITEM. The solution would be possible if I could specify a
> rectangle size unique to each row in a list control and could receive this
> rectangle as the update rect in the DrawItem function in my owner draw list
> control. Any examples or leads would be appreciated (even examples in
> straight Win32 would be fine).
>
> Thank you,
>
> Marc Temanson
>
>
>
===================================================
DUNDAS SOFTWARE LTD.
===================================================
Internet: sales@dundas.com Compuserve: 76060,101
Sales: (800) 463-1492 or (416) 239-7472
Fax: (416) 239-2183
WWW: www.dundas.com FTP: ftp.dundas.com
===================================================
David Cunningham -- davec@dundas.com
Monday, January 27, 1997
Marc,
What you are describing should not be too difficult to put together
using an ownerdrawn cell, and generating the cell contents manually
using the Win32 sdk call DrawText().
I don't have any code for this, mostly due to the fact that we sell a
MFC class extension called Ultimate Grid that provides high end grid
function including the multiline cell type you describe Check it
out, it might help. http://www.dundas.com
Dave Cunningham
Dundas
> Environment: VC++ 4.2b, Win 95/NT 4.0 using MFC
>
> Has anyone seen or written a ListCtrl type class that support multiple
> lines per row? For example, instead of using ellipsis to truncate text,
> use word breaks to wrap the text to another line that would still be part
> of a single list ITEM. The solution would be possible if I could specify a
> rectangle size unique to each row in a list control and could receive this
> rectangle as the update rect in the DrawItem function in my owner draw list
> control. Any examples or leads would be appreciated (even examples in
> straight Win32 would be fine).
>
> Thank you,
>
> Marc Temanson
>
>
>
===================================================
DUNDAS SOFTWARE LTD.
===================================================
Internet: sales@dundas.com Compuserve: 76060,101
Sales: (800) 463-1492 or (416) 239-7472
Fax: (416) 239-2183
WWW: www.dundas.com FTP: ftp.dundas.com
===================================================
| Вернуться в корень Архива
|