[Lazarus] OI Checkboxes

Vojtěch Čihák vojtech.cihak at atlas.cz
Tue Nov 25 11:45:42 CET 2014


This is not Linux-Qt related, this is Oxygen related. Other themes work OK. Hardcoding 1 or 2 pixels is IMO not good idea, it may cause troubles elsewhere.
I tested ThemeServices.GetDetailSize and it gives the same output for tbCheckBoxCheckedDisabled, tbCheckBoxCheckedNormal and tbCheckBoxCheckedHot (or ..Unchecked... variants).

This code:

procedure TForm1.Button1Click(Sender: TObject);
var aDetail: TThemedElementDetails;
 aRect: TRect;
 aSize: TSize;
begin
 aDetail:=ThemeServices.GetElementDetails(tbCheckBoxUncheckedNormal);
 aSize:=ThemeServices.GetDetailSize(aDetail);
 aRect:=Rect(5, 5, 5+aSize.cx, 5+aSize.cy);
 writeln('Inactive ', aSize.cy);
 ThemeServices.DrawElement(Image1.Canvas.Handle, aDetail, aRect);
 aDetail:=ThemeServices.GetElementDetails(tbCheckBoxCheckedHot);
 aSize:=ThemeServices.GetDetailSize(aDetail);
 aRect:=Rect(25, 5, 25+aSize.cx, 5+aSize.cy);
 writeln('Focused ', aSize.cy);
 ThemeServices.DrawElement(Image1.Canvas.Handle, aDetail, aRect);
end; 

gives output

Inactive 21
Focused 21

and paint checkboxes (see attachment).

However, I didn't see code of OICheckBoxes, so I cannot say where is problem.

Vojtěch
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141125/68f69a37/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oxygen-chb.png
Type: image/png
Size: 1594 bytes
Desc: oxygen-chb.png
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141125/68f69a37/attachment-0003.png>


More information about the Lazarus mailing list