[lazarus] LCL: WMPaint

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Jun 29 16:02:43 EDT 2003


On Sun, 29 Jun 2003 17:34:40 +0200
"Micha Nelissen" <mdvpost at hotmail.com> wrote:

> Micha Nelissen wrote:
> > Hi,
> >
> > 2) The WM_ERASEBKGND really needs to be implemented, otherwise it
> > will be black on windows. Delphi has:
> >
> >   if not FDoubleBuffered or
> >     (TMessage(Message).wParam = TMessage(Message).lParam) then
> >     FillRect(Message.DC, ClientRect, FBrush.Handle);
> >   Message.Result := 1;
> 
> I have attached a patch that works on windows. These last two patches fix
> the TPromptDialog bug I mentioned earlier. In addition to the erase
> background implementation I also added color convertion routines for the
> font selection. I am unsure whether the interface will accept the special
> clBlack and such, a real RGB value is better.

The ColorToRGB calls were deleted with reason. System colors are theme
dependent. For example clBackground can be anything (simple color, image,
gradient fill, ...) and it changes, when the user changes the theme. So, the
clWindowText must be sent to the interface, not the current color. It is up
to the interface to convert it.


Mattias






More information about the Lazarus mailing list