How to draw Controls on canvas at linux? Or other ways to draw check box on VST lazarus / 39-Graphics ---------------------------------------------------------------------- Pixelmak · 2020-10-08 13:41 Usually at the Windows i am using UxTheme library. Like this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TxpLoginRegisterForm.GridAfterCellPaint(Sender: TBaseVirtualTree;  TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;  const CellRect: TRect);var  r: TRect;  size: TSize;  h: HTHEME;   data: PGridData;const  PADDING = 4;begin  if Column = IsWebColumn then  begin    r := CellRect;     data := Grid.GetNodeData(Node);    size.cx := GetSystemMetrics(SM_CXMENUCHECK);    size.cy := GetSystemMetrics(SM_CYMENUCHECK);     h := OpenThemeData(Sender.Handle, 'BUTTON');     GetThemePartSize(h, TargetCanvas.Handle, BP_CHECKBOX, CBS_CHECKEDNORMAL, nil, TS_DRAW, size);    r.Top    := CellRect.Top + (CellRect.Bottom - CellRect.Top - size.cy) div 2;    r.Bottom := r.Top + size.cy;    r.Left   := r.Left + PADDING;    r.Right  := r.Left + size.cx;     if data^.IsWeb=1 then      DrawThemeBackground(h, TargetCanvas.Handle, BP_CHECKBOX, CBS_CHECKEDNORMAL, r, nil)    else      DrawThemeBackground(h, TargetCanvas.Handle, BP_CHECKBOX, CBS_UNCHECKEDNORMAL, r, nil);     CloseThemeData(h);  end;end;  Is there a way to do the same for Linux? Or other ways to draw a checkbox? ---------------------------------------------------------------------- wp · 2020-10-08 14:03 Checkbox theme drawing should be active in VTV by default (CheckImageKind = dkSystemDefault), AFIK there is no need to draw checkbox manually for this purpose. In general, theme support is handled in the LCL in a cross-platform way by the unit "themes" and the ThemeServices methods. ---------------------------------------------------------------------- Pixelmak · 2020-10-08 14:45 Quote from: wp on October 08, 2020, 04:03:23 pmCheckbox theme drawing should be active in VTV by default (CheckImageKind = dkSystemDefault), AFIK there is no need to draw checkbox manually for this purpose. I am using TVirtualStringTree where I have many columns, in each of which I need to draw a checkbox. But "CheckImageKind" adds a checkbox only to the root column. Quote from: wp on October 08, 2020, 04:03:23 pmIn general, theme support is handled in the LCL in a cross-platform way by the unit "themes" and the ThemeServices methods. Excellent! That's what I was looking for! Thank you so much! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TxpLoginRegisterForm.GridAfterCellPaint(Sender: TBaseVirtualTree;  TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;  const CellRect: TRect);var  r: TRect;  size: TSize;  data: PGridData;   Details: TThemedElementDetails;const  PADDING = 4;begin  if Column = IsWebColumn then  begin    r := CellRect;     data := Grid.GetNodeData(Node);    size.cx := GetSystemMetrics(SM_CXMENUCHECK);    size.cy := GetSystemMetrics(SM_CYMENUCHECK);     r.Top    := CellRect.Top + (CellRect.Bottom - CellRect.Top - size.cy) div 2;    r.Bottom := r.Top + size.cy;    r.Left   := r.Left + PADDING;    r.Right  := r.Left + size.cx;     if data^.IsWeb=1 then      Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal)    else      Details := ThemeServices.GetElementDetails(tbCheckBoxUncheckedNormal);     ThemeServices.DrawElement(TargetCanvas.Handle, Details, r, nil);     CloseThemeData(h);  end;end;