Show quoted text 36 lines
On Sun, 23 Nov 2003 11:43:01 +0100
Mattias Gaertner wrote:
> On Sun, 23 Nov 2003 12:16:54 +0100 (CET)
> wrote:
>
> > Hi,
> >
> > There are (at least) 2 bugs which have crept in lately. They seem
> > related, because the symptoms are the same.
> >
> > - Configure 'Build lazarus' dialog: The grid with descriptions
> > (or whatever component it is) is completely black (but
> > build/skip/install icons are shown) and only the current
> > selection is shown in white letters.
> >
> > - 'Find in files' search result: everything is black in the
> > memo/whatever,
> >
> > only the current selection is printed in white letters.
> >
> > This is from todays CVS update, compiled with a 1.0.10 version of
> > FPC.
>
> Both are TListBox and both are drawing the background with clWindow.
> Let's see ..
>
>
> Mattias
FYI, this is the same as bug 153. Please also take a look at what Tony
and Andrew were discussing in the "Black clBtnFace fix? was Patch for
searchresults dialog" thread.
I wanted to try Andrew's suggestion, but couldn't find the exact
place to put the code.
Each system color is a special case. clBtnFace needs a different trick than clWindow.
In this case the problem is the following:
TListBox.OnDrawItem paints with clWindow to paint in the background color of the inner area. A TListBox is in the gtk a gtk_list with a list of gtk_list_item. The paint DC is that of the item, while the background is hardcoded in the gtk as the base[Normal_State] of the gtk_list.
This technique is common in the gtk. The best solution would be to retrieve the current background of the gdkwindow of the gtk_list_item, so we don't have to bother about the specific widget class. But I'm still searching for such function.
If I don't find it, I will add a gtk_list_item specific solution.
Mattias