I found this:
https://forum.lazarus.freepascal.org/index.php?topic=42397.0 Which led me to define this:
procedure TBasePanel.BoldOS(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState);
begin
with (Control as TCheckListBox).Canvas do
begin
if MyDrives.isOS((Control as TCheckListBox).Items[Index]) then Font.Style:= [fsBold];
TextOut(ARect.Left, ARect.Top,(Control as TCheckListBox).Items[Index]);
end;
end;
With the relevant TCheckListBox:
Box2.Style:= lbOwnerDrawFixed;
Box2.OnDrawItem:= @BoldOS;
MyDrives.isOS checks to see if a partition has an operating system on it and if true, sets the font bold for the relevant TCheckListBox item.
The niggles are that relative to an unmodified TCheckListBox (boxd screenshot), the text in the modified TCheckListBox (boxp screenshot) is placed closer to the checkbox and the text is aligned top instead of centre.
Posted in the linux subforum just in case it is GTK dependent.
Is there any way to get the alignment and spacing with lbOwnerDrawFixed the same as an unmodified TCheckListBox?