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

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


Variable height owner-draw list control???

Peter Drayton -- peter@ten.net
Tuesday, November 12, 1996

Environment: VC++ 4.2b, Win95

I need to create an owner-draw list control that has variable-height rows.
Some items in the list will have multiple lines of text, and some items
have only one. I want it to treat the multiple lines of text in a subitem
as a single row for selection, highlighting, etc. I am currently using a
CListCtrl-derived class that implements OnDrawItem for a Windows list ctrl
with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
LBS_OWNERDRAWVARIABLE style for Windows list ctrl??

Regards
Peter




Moti Lichi -- Moti@pos.co.il
Sunday, December 01, 1996

Hi Peter
I just have the same problem - using list box with ability to set font
and fields in one line item -  If you have any recommended OCX for this
mission - I would be grateful
Thank you 
Moti

>----------
>From: 	Peter Drayton[SMTP:peter@ten.net]
>Sent: 	юйен щмйщй, ребобш 12, 1996ю 11:20
>To: 	MFC Mailing List
>Subject: 	Variable height owner-draw list control???
>
>Environment: VC++ 4.2b, Win95
>
>I need to create an owner-draw list control that has variable-height rows.
>Some items in the list will have multiple lines of text, and some items
>have only one. I want it to treat the multiple lines of text in a subitem
>as a single row for selection, highlighting, etc. I am currently using a
>CListCtrl-derived class that implements OnDrawItem for a Windows list ctrl
>with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
>LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
>
>Regards
>Peter
>
>



Renato Padovani Tognolo -- padovani@ahand.unicamp.br
Monday, December 02, 1996

> 
> >----------
> >From: 	Peter Drayton[SMTP:peter@ten.net]
> >Subject: 	Variable height owner-draw list control???
> >
> >Environment: VC++ 4.2b, Win95
> >
> >I need to create an owner-draw list control that has variable-height rows.
> >Some items in the list will have multiple lines of text, and some items
> >have only one. I want it to treat the multiple lines of text in a subitem
> >as a single row for selection, highlighting, etc. I am currently using a
> >CListCtrl-derived class that implements OnDrawItem for a Windows list ctrl
> >with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
> >LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
> >
> >Regards
> >Peter
> >
> >
> 

	In fact, there IS a LBS_OWNERDRAWVARIABLE style for the CListBox
control. At least in the 16-bit version that I still use (VC++ 1.52). I think
the implementation of the feature you want must be quite similar to the imple-
mentation you already have done for fixed height items.

							Padovani




Gerald Alter -- jalter@alt-ego.com
Monday, December 02, 1996

Actually, you'll probably have to override the OnDraw function of the lis=
t
itself, so that it finds the rect for each item and then draws it on the
screen.  I messed with this a few years ago, and it is a prety complex ta=
sk
as The OnPaint function of the listbox control is not the only function t=
o
be overridden.  Dig into the CListBox control, sorry I don't have more in=
fo
for you, but I would recommend starting with the OnPaint function and wor=
k
your way from there.

----------
> From: Moti Lichi 
> To: 'mfc-l@netcom.com'
> Subject: RE: Variable height owner-draw list control???
> Date: Sunday, December 01, 1996 3:25 AM
>=20
> Hi Peter
> I just have the same problem - using list box with ability to set font
> and fields in one line item -  If you have any recommended OCX for this
> mission - I would be grateful
> Thank you=20
> Moti
>=20
> >----------
> >From: 	Peter Drayton[SMTP:peter@ten.net]
> >Sent: 	=FE=E9=E5=ED =F9=EC=E9=F9=E9, =F0=E5=E1=EE=E1=F8 12, 1996=FE 11=
:20
> >To: 	MFC Mailing List
> >Subject: 	Variable height owner-draw list control???
> >
> >Environment: VC++ 4.2b, Win95
> >
> >I need to create an owner-draw list control that has variable-height
rows.
> >Some items in the list will have multiple lines of text, and some item=
s
> >have only one. I want it to treat the multiple lines of text in a
subitem
> >as a single row for selection, highlighting, etc. I am currently using=
 a
> >CListCtrl-derived class that implements OnDrawItem for a Windows list
ctrl
> >with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
> >LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
> >
> >Regards
> >Peter
> >
> >



Kanir Pandya -- kpandya@harbinger.net
Wednesday, December 04, 1996

[Mini-digest: 6 responses]

Make sure you set the height of the item.  Override MeasureItem and 
specify the height of the object in LPMEASUREITEMSTRUCT struct.

Kanir

----------
From: 	Renato Padovani Tognolo
Sent: 	Monday, December 02, 1996 1:12 PM
To: 	mfc-l@netcom.com
Subject: 	Re: Variable height owner-draw list control???

> 
> >----------
> >From: 	Peter Drayton[SMTP:peter@ten.net]
> >Subject: 	Variable height owner-draw list control???
> >
> >Environment: VC++ 4.2b, Win95
> >
> >I need to create an owner-draw list control that has variable-height rows.
> >Some items in the list will have multiple lines of text, and some items
> >have only one. I want it to treat the multiple lines of text in a subitem
> >as a single row for selection, highlighting, etc. I am currently using a
> >CListCtrl-derived class that implements OnDrawItem for a Windows list ctrl
> >with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
> >LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
> >
> >Regards
> >Peter
> >
> >
> 

	In fact, there IS a LBS_OWNERDRAWVARIABLE style for the CListBox
control. At least in the 16-bit version that I still use (VC++ 1.52). I think
the implementation of the feature you want must be quite similar to the imple-
mentation you already have done for fixed height items.

							Padovani

-----From: Mark.Woolley@software.rockwell.com (Woolley, Mark)


Peter is asking about a LBS_OWNERDRAWVARIABLE style for CListCtrl not   
CListBox.  I don't have an answer for Peter because I'm also looking for   
the same functionality Peter is.

Mark.

>
> > In fact, there IS a LBS_OWNERDRAWVARIABLE style for the CListBox
> >control. At least in the 16-bit version that I still use (VC++ 1.52).   
I think
> >the implementation of the feature you want must be quite similar to   
the imple-
> >mentation you already have done for fixed height items.
> >
> >       Padovani
> >
>
> >----------
> >From:  Peter Drayton[SMTP:peter@ten.net]
> >Subject:  Variable height owner-draw list control???
> >
> >Environment: VC++ 4.2b, Win95
> >
> >I need to create an owner-draw list control that has variable-height   
rows.
> >Some items in the list will have multiple lines of text, and some   
items
> >have only one. I want it to treat the multiple lines of text in a   
subitem
> >as a single row for selection, highlighting, etc. I am currently using   
a
> >CListCtrl-derived class that implements OnDrawItem for a Windows list   
ctrl
> >with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
> >LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
> >
> >Regards
> >Peter
> >
> >
>


-----From: Moti Lichi 


Hi Peter
I just have the same problem - using list box with ability to set font
and fields in one line item -  If you have any recommended OCX for this
mission - I would be grateful
Thank you
Moti


>----------
>From: 	Peter Drayton[SMTP:peter@ten.net]
>Sent: 	юйен щмйщй, ребобш 12, 1996ю 11:20
>To: 	MFC Mailing List
>Subject: 	Variable height owner-draw list control???
>
>Environment: VC++ 4.2b, Win95
>
>I need to create an owner-draw list control that has variable-height rows.
>Some items in the list will have multiple lines of text, and some items
>have only one. I want it to treat the multiple lines of text in a subitem
>as a single row for selection, highlighting, etc. I am currently using a
>CListCtrl-derived class that implements OnDrawItem for a Windows list ctrl
>with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
>LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
>
>Regards
>Peter
>
>
-----From: Mark.Woolley@software.rockwell.com (Woolley, Mark)


I think Peter is asking about a LBS_OWNERDRAWVARIABLE style for CListCtrl   
not CListBox.  I don't have an answer for Peter because I'm also looking   
for the same functionality Peter is.

Mark.

>
> > In fact, there IS a LBS_OWNERDRAWVARIABLE style for the CListBox
> >control. At least in the 16-bit version that I still use (VC++ 1.52).   
I think
> >the implementation of the feature you want must be quite similar to   
the imple-
> >mentation you already have done for fixed height items.
> >
> >       Padovani
> >
>
> >----------
> >From:  Peter Drayton[SMTP:peter@ten.net]
> >Subject:  Variable height owner-draw list control???
> >
> >Environment: VC++ 4.2b, Win95
> >
> >I need to create an owner-draw list control that has variable-height   
rows.
> >Some items in the list will have multiple lines of text, and some   
items
> >have only one. I want it to treat the multiple lines of text in a   
subitem
> >as a single row for selection, highlighting, etc. I am currently using   
a
> >CListCtrl-derived class that implements OnDrawItem for a Windows list   
ctrl
> >with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
> >LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
> >
> >Regards
> >Peter
> >
> >
>



-----From: Mark.Woolley@software.rockwell.com (Woolley, Mark)



I think Peter is asking about a LBS_OWNERDRAWVARIABLE style for CListCtrl   
not CListBox.  I don't have an answer for Peter because I'm also looking   
for the same functionality Peter is.

Mark.

>
> > In fact, there IS a LBS_OWNERDRAWVARIABLE style for the CListBox
> >control. At least in the 16-bit version that I still use (VC++ 1.52).   
I think
> >the implementation of the feature you want must be quite similar to   
the imple-
> >mentation you already have done for fixed height items.
> >
> >       Padovani
> >
>
> >----------
> >From:  Peter Drayton[SMTP:peter@ten.net]
> >Subject:  Variable height owner-draw list control???
> >
> >Environment: VC++ 4.2b, Win95
> >
> >I need to create an owner-draw list control that has variable-height   
rows.
> >Some items in the list will have multiple lines of text, and some   
items
> >have only one. I want it to treat the multiple lines of text in a   
subitem
> >as a single row for selection, highlighting, etc. I am currently using   
a
> >CListCtrl-derived class that implements OnDrawItem for a Windows list   
ctrl
> >with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
> >LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
> >
> >Regards
> >Peter
> >
> >
>




-----From: Burt.Stampfl@software.rockwell.com (Stampfl, Burt)


Hi Padovani,
 In response to Peter's question (attached) you replied :

> In fact, there IS a LBS_OWNERDRAWVARIABLE style for the CListBox
> control. At least in the 16-bit version that I still use (VC++ 1.52). I   
think
> the implementation of the feature you want must be quite similar to the   
imple-
> mentation you already have done for fixed height items.
> 
> Padovani

 Actually, I think Peter is looking for a method to change the ITEM   
heights
in a CListCtrl (not a CListBox control).  I am also interested in a   
method/technique
to do so.  Any help or pointers from the list members would be and is   
greatly
appreciated.  Thanks.


> >----------
> >From:  Peter Drayton[SMTP:peter@ten.net]
> >Subject:  Variable height owner-draw list control???
> >
> >Environment: VC++ 4.2b, Win95
> >
> >I need to create an owner-draw list control that has variable-height   
rows.
> >Some items in the list will have multiple lines of text, and some   
items
> >have only one. I want it to treat the multiple lines of text in a   
subitem
> >as a single row for selection, highlighting, etc. I am currently using   
a
> >CListCtrl-derived class that implements OnDrawItem for a Windows list   
ctrl
> >with the LVS_OWNERDRAWFIXED style. Is there anything similar to the
> >LBS_OWNERDRAWVARIABLE style for Windows list ctrl??
> >
> >Regards
> >Peter
> >
> >


   

Burt Stampfl
internal ext. 32398
outside line (414)328-2398
burt.stampfl@software.rockwell.com
bstampfl@nconnect.net  





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