[Lazarus] Colourful Themes
Vojtěch Čihák
vojtech.cihak at atlas.cz
Mon May 12 11:41:22 CEST 2014
I tried:
var aNewColor, aOldColor: TColorRef;
begin
aNewColor:=ColorToRGB(clRed);
aOldColor:=LCLIntf.SetBkColor(Canvas.Handle, aNewColor);
ThemeServices.DrawElement(Canvas.Handle, ThemeServices.GetElementDetails(caThemedItems[AItemState]), ARect, nil);
writeln(ColorToString(LCLIntf.SetBkColor(Canvas.Handle, AOldColor)));
Now the output is now clRed, which means that clRed was set during DrawElement but painted element (tbPushButtonNormal) is still default.
Vojtěch
______________________________________________________________
> Od: zeljko <zeljko at holobit.net>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 12.05.2014 11:23
> Předmět: Re: [Lazarus] Colourful Themes
>
On 05/12/2014 10:54 AM, Vojtěch Čihák wrote:
> Thanks,
>
> I tried LCLIntf.SetBkColor(Canvas.Handle, clRed); and no visual change.
> And if I try writeln(ColorToString(LCLIntf.SetBkColor(HANDLE, $00FF0000))); it never returns the color that I set (Qt4, GTK2), so it seems widgetsets doesn't support it.
1.SetBkColor as param uses TColorRef, not TColor
2.When setting new color with SetBkColor, old TColorRef is returned as
result.
var
AOldColor, ANewColorRef: TColorRef;
begin
ANewColorRef := ColorToRGB(clRed);
AOldColor := LCLIntf.SetBkColor(Canvas.Handle, ANewColorRef);
...do something
LCLIntf.SetBkColor(Canvas.Handle, AOldColor);
end;
zeljko
More information about the Lazarus
mailing list