On Tue, 6 Feb 2007 13:51:23 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:
> On 2/6/07, Mattias Gaertner <[EMAIL PROTECTED]> wrote:
> > > I looked at the changes you made to see what I did wrong. I see
> > > you use the TreeView's OnAdvancedCustomDraw instead of
> > > OnCustomDraw.
> >
> > OnCustomDrawItem
> > ^^^^
>
> Ah yes, sorry. I meant the XXXXDrawItem events.
>
> >
> > Do you want to know, how TCustomTreeView.DoPaintNode works, or why
> > it works this way?
> > The font color is overriden by DoPaintNode in both cases.
>
> Umm, ok so the problem was actually (kind of) in the TTreeview control
> and not in the msgview.pp unit.
>
> > I think, that the OnCustomDrawItem is not very useful at the
> > moment, because it has to paint the whole line, with tree lines,
> > icons
>
> Still doesn't make sense why it got overriden. Could it possible be
> because of this strange code in TCustomTreeView.DoPaintNode (it
> doesn't look right to me).
Can you be more specific?
> In TCustomTreeView.DoPaintNode() on line 4125 and on line 4201it fires
> off the OnCustomDrawItem event! Why twice in the same method
> (DoPaintNode)? Shouldn't this occur only once?
It calls CustomDrawItem, which calls the appropriate draw event.
> And in both cases, if CustomDrawItem event handle returns True, it
> will exit the DoPaintNode, which should prevent painting being
> overriden. Just a thought. ;-)
Yes, but as I said: then you have paint everything yourself.
Mattia
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives