[Lazarus] Qt - Checkbox state images

Gabor Boros gaborboros at yahoo.com
Wed Aug 13 10:22:39 CEST 2014


Hi,

I am playing with Qt for gain experience.
If query checkbox images from ThemeServices the images order different 
with KDE than others. Is it a KDE or Qt or Lazarus bug or what?

Qt4 is a good choice usually or GTK2 is better from Lazarus POV?


uses Themes, Types;

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);

  procedure DrawThemedButton(in_ThemedButton:TThemedButton;in_Pos:Integer);
  var
    Details:TThemedElementDetails;
    R:TRect;
    S:TSize;

  begin
    Details:=ThemeServices.GetElementDetails(in_ThemedButton);

    S:=ThemeServices.GetDetailSize(Details);

    R.Left:=in_Pos;
    R.Right:=R.Left+S.cx;
    R.Top:=0;
    R.Bottom:=S.cy;

    ThemeServices.DrawElement(Image1.Canvas.Handle,Details,R);
  end;

var
   i:TThemedButton;
   tmpPos:Integer;

begin
   Image1.Canvas.FillRect(Image1.ClientRect);

   tmpPos:=0;
   for i:=tbCheckBoxUncheckedNormal to tbCheckBoxMixedDisabled do
    begin
      DrawThemedButton(i,tmpPos);
      Inc(tmpPos,25);
    end;
end;


Gabor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Check_Qt_GNOME.png
Type: image/png
Size: 2032 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140813/2ecd25d3/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Check_Qt_KDE.png
Type: image/png
Size: 3866 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140813/2ecd25d3/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Check_Qt_XP.png
Type: image/png
Size: 1740 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140813/2ecd25d3/attachment-0008.png>


More information about the Lazarus mailing list