[Lazarus] OI Checkboxes

Sandro Cumerlato sandro.cumerlato at gmail.com
Sat Nov 29 23:43:05 CET 2014


Thank you Vojtěch for the TCheckBoxThemed component.

I tested it under Windows 8.1 and found a small difference in Caption
vertical position.

Please compare attached images checkboxthemed1.png (before patch) vs
checkboxthemed2.png (after patch) and review attached diff file.

Please apply if OK under QT/GTK2.

Sandro




On 29 November 2014 at 21:32, Vojtěch Čihák <vojtech.cihak at atlas.cz> wrote:

> I'll try it next week.
>
>
>
> Vojtěch
>
> ______________________________________________________________
> > Od: Juha Manninen <juha.manninen62 at gmail.com>
> > Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> > Datum: 29.11.2014 21:07
> > Předmět: Re: [Lazarus] OI Checkboxes
> >
>
>
>
> On Friday, November 28, 2014, Vojtěch Čihák <vojtech.cihak at atlas.cz>
> wrote:
>
>  TCheckBoxThemed is done:
>>
> I added it to LazControls package. Thanks.
> Would you like to implement the Boolean editor using your component?
> Otherwise it will take time as I have other duties in near future.
> It should be selectable with an IFDEF, UseCheckboxThemed or similar.
> Object Inspector is in IDEIntf package which already has LazControls as a
> dependency.
> Juha
>
>
>
> ----------
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141129/72ee1b2c/attachment-0003.html>
-------------- next part --------------
Index: components/lazcontrols/checkboxthemed.pas
===================================================================
--- components/lazcontrols/checkboxthemed.pas	(revisione 47031)
+++ components/lazcontrols/checkboxthemed.pas	(copia locale)
@@ -360,7 +360,7 @@
     if ARightToLeft then inc(aFlags, DT_RTLREADING);
     with ThemeServices.GetTextExtent(ACanvas.Handle, aDetails, ACaption, aFlags, nil) do begin
       aTextSize.cx := Right;
-      aTextSize.cy := Bottom + 2 * cFocusBorder;
+      aTextSize.cy := Bottom;
     end;
     aCaptionPoint.Y := (ARect.Bottom - aTextSize.cy) div 2;
     aCheckBoxPoint.Y := (ARect.Bottom - CheckBoxSize.cy) div 2;
@@ -399,6 +399,8 @@
     { Paint FocusRect around Caption }
     if AFocused then begin
       dec(aHelpRect.Left, cFocusBorder);
+      dec(aHelpRect.Top, cFocusBorder);
+      inc(aHelpRect.Bottom, cFocusBorder);
       inc(aHelpRect.Right, cFocusBorder);
       LCLIntf.SetBkColor(ACanvas.Handle, ColorToRGB(clBtnFace));
       LCLIntf.DrawFocusRect(ACanvas.Handle, aHelpRect);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkboxthemed1.png
Type: image/png
Size: 2446 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141129/72ee1b2c/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkboxthemed2.png
Type: image/png
Size: 2451 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141129/72ee1b2c/attachment-0007.png>


More information about the Lazarus mailing list