[Lazarus] Colourful Themes
zeljko
zeljko at holobit.net
Mon May 12 12:09:15 CEST 2014
On 05/12/2014 11:41 AM, Vojtěch Čihák wrote:
> 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.
if you doing that in Qt, then you should set palette brush from current
painter (in DrawElement) brush. That's not implemented, I've just said
that it's maybe possible to implement it in that way.
zeljko
>
> 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
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
More information about the Lazarus
mailing list