Note sure whether this should be in the linux or LCL area?
I have a TCheckListBox with a custom OnDrawItem, relevant definition for the TCheckListBox:
Box2.Style:= lbOwnerDrawFixed;
Box2.OnDrawItem:= @BoldOS;
With BoldOS as
procedure TBasePanel.BoldOS(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState);
const
AdjustL = 5;
AdjustT = 3;
begin
with (Control as TCheckListBox) do
begin
if MyDrives.isOS(Items[Index]) then Canvas.Font.Bold:= true;
Canvas.TextOut(ARect.Left + AdjustL,ARect.Top + AdjustT,Items[Index]);
end;
end;
When an operating system is detected on a partition it displays the text in
bold. It works. But...
- Enabled.png is the mainform enabled, display as wanted.
- Disabled.png is the mainform disabled (which I need to do when child forms are displayed).
When the main form is disabled I want Box2 to look the same as Box1 (which has no custom OnDrawItem defined - uses the defaults), i.e. grey background with greyed text and I've not been able to find out how to do it.
First issue was detecting that the main form has been disabled,
if not MainFm.Enabled seems clumsy given that it is automatically detected in Box1. Then there is what colours to use, given that I don't want to use specific colours, I want the theme defaults?