Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Listview Item - bolding/colour text

24 views
Skip to first unread message

Adrian Scott

unread,
Feb 23, 2001, 5:09:17 AM2/23/01
to
Hi all

Is it possible to have listviewitems with differing text properties ?

I.e. like unread emails within outlook etc. Bold when unread then normal
when read.

If this is possible, is it also possible to change the colour of a listview
item line ?

Adrian

adr...@compan.net


Adrian Scott

unread,
Feb 23, 2001, 6:11:54 AM2/23/01
to
Which copy of SDT was that ?

I've lost one and it would be just my luck that thats the one.

Thanks for your help Geoff

Regards

Adrian

Geoff Schaller <geof...@bigpond.net.au> wrote in message
news:_drl6.42214$o85.2...@news-server.bigpond.net.au...
> Adrian,
>
> Here is some stuff I got out of KnowVO. The short answer is "Yes" but the
> process is a little more complex than usual.Also, if you SDT, Ivo Wessels
> ran a series of articles on how to do this.
>
> Geoff
>
>
> "Adrian Scott" <adr...@compan.net> wrote in message
> news:982923320.10183.0...@news.demon.co.uk...

Erik Visser

unread,
Feb 23, 2001, 6:33:21 AM2/23/01
to
This is how i do it.

Regards, Erik Visser


METHOD Postinit CLASS JuryExplorer
aFonts := {;
Font{,10,"MS Sans Serif"},;
Font{,10,"MS Sans Serif"},;
Font{,10,"MS Sans Serif"},;
Font{,10,"MS Sans Serif"},;
}

aFonts[2]:bold := TRUE
aFonts[3]:underline := TRUE
aFonts[4]:bold := TRUE
aFonts[4]:underline := TRUE


METHOD ControlNotify( oControlNotifyEvent ) CLASS JuryExplorer

LOCAL oEvent AS ControlNotifyEvent
LOCAL strucNMLV AS _winNM_Listview
LOCAL strucLVCD AS _winNMLVCustomDraw
LOCAL oLVI AS ListviewItem
LOCAL sText AS STRING
LOCAL wVal AS WORD

oEvent := oControlNotifyEvent

DO CASE
CASE oEvent:umsg == WM_NOTIFY
strucNMLV := PTR( _CAST, oEvent:lParam )

DO CASE
CASE strucNMLV.hdr._COde != NM_CUSTOMDRAW
//do nothing

CASE IsInstanceOf( oEvent:control, #LISTVIEW )
strucLVCD := PTR(_CAST, oEvent:lParam )

DO CASE
CASE strucLVCD.nmcd.dwDrawStage == CDDS_PREPAINT
RETURN SELF:EventReturnValue := CDRF_NOTIFYITEMDRAW

CASE strucLVCD.nmcd.dwDrawStage == CDDS_ITEMPREPAINT
oLVI := oEvent:Control:GetItemAttributes(
strucLVCD.nmcd.dwItemSpec + 1 )

wVal := 1
IF oLVI:GetText(#ISBOLD) = ".T."
wVal+=1
ENDIF
IF oLVI:GetText(#ISUNDERLIN) = ".T."
wVal+=2
ENDIF

SelectObject( strucLVCD.nmcd.hdc, aFonts[wVal]:handle() )

RETURN SELF:EventReturnValue := CDRF_NOTIFYITEMDRAW
ENDCASE
ENDCASE
ENDCASE

RETURN SUPER:ControlNotify( oControlNotifyEvent )


"Adrian Scott" <adr...@compan.net> schreef in bericht
news:982923320.10183.0...@news.demon.co.uk...

Stephen Quinn

unread,
Feb 23, 2001, 9:07:55 AM2/23/01
to
Adrian

SDT - 04/1999 & 01/2000 & 02/2000

--
HTH
Steve Quinn
Accept than some days you're the pigeon, and some days you're the statue.
There is no right way to do the wrong thing.
To invent, you need a good imagination and a pile of junk.
-- Thomas Edison


Roger Lawton

unread,
Feb 23, 2001, 9:32:03 AM2/23/01
to
Adrian:

There is a very good paper from the CA-World 99 CD by Michael Ferber about
custom draw techniques ("OwnerDraw and CustomDraw Techniques in Windows").
This explains how to use the custom draw features quite well. I have used
it to highlight items in treeviews and list views in different colors and
fonts.


Adrian Scott <adr...@compan.net> wrote in message
news:982923320.10183.0...@news.demon.co.uk...

John Martens

unread,
Feb 23, 2001, 7:52:15 AM2/23/01
to
Erik,

I tried this before but I couldn't get it working under VO 2.0 on a
data-window.
Somehow the ControlNotify() isnt' called.

Is there a simple solution to this ???

John Martens

Erik Visser <evi...@wilg.nl> schreef in berichtnieuws
975hpu$67h$1...@porthos.nl.uu.net...

> file://do nothing

Paul Piko

unread,
Feb 23, 2001, 7:55:38 PM2/23/01
to
John,

> I tried this before but I couldn't get it working under VO 2.0 on a
> data-window.
> Somehow the ControlNotify() isnt' called.
>
> Is there a simple solution to this ???

Go to http://ourworld.compuserve.com/homepages/FerberMichael/ and read
the paper "OwnerDraw and CustomDraw Techniques in Windows". It shows how
to get the ControlNotify working for DataWindows.

--
Paul
----
Paul Piko
Piko Computing Consultants
Phone: +61 3 9432 1222 Fax: +61 3 9432 1255
Email: pa...@piko.com.au Web: http://www.piko.com.au

John Martens

unread,
Feb 24, 2001, 8:08:25 AM2/24/01
to
I (re)tried to look at the web-site and found an essential hint in the text
of the web-site which wasn't in the demo-AEF:
There should be the followinf method for VO 2.0

METHOD ControlNotify(oEvent) CLASS __FormDialogWindow
oParent:Owner:Dispatch(oEvent)
RETURN SELF

The demo AEF in itself doesn't work in Michaels case without the method.

Thanks for getting my attention to this.

John

Paul Piko <pa...@piko.com.au> schreef in berichtnieuws
eEDl6.43001$o85.2...@news-server.bigpond.net.au...

Adrian Scott

unread,
Feb 26, 2001, 6:40:23 AM2/26/01
to
Thanks to everyone for your help.

I've got the listview looking like I want now.

Cheers

Adrian


Roger Lawton <ro...@somax.com> wrote in message
news:975rok$llc$1...@slb3.atl.mindspring.net...

0 new messages