Cocoa: Style setting supported in TListBox/TCheckListBox

This commit is contained in:
rich2014 2024-08-30 21:17:15 +08:00
parent 62c26af930
commit a851bf46fa
2 changed files with 11 additions and 2 deletions

View File

@ -61,6 +61,7 @@ type
class function GetState(const ACheckListBox: TCustomCheckListBox; const AIndex: integer): TCheckBoxState; override;
class procedure SetState(const ACheckListBox: TCustomCheckListBox; const AIndex: integer; const AState: TCheckBoxState); override;
class function GetCheckWidth(const ACheckListBox: TCustomCheckListBox): integer; override;
class procedure SetStyle(const ACustomListBox: TCustomListBox); override;
end;
implementation
@ -158,6 +159,8 @@ begin
//list.AllowMixedState := TCustomCheckListBox(AWinControl).AllowGrayed;
list.isOwnerDraw := lclCheckListBox.Style in [lbOwnerDrawFixed, lbOwnerDrawVariable];
ListBoxSetStyle(list, TCustomListBox(AWinControl).Style);
scroll := EmbedInScrollView(list);
if not Assigned(scroll) then
begin
@ -237,4 +240,10 @@ begin
Result:= Round( CocoaConfigListView.vsList.item.checkBoxOccupiedWidth );
end;
class procedure TCocoaWSCustomCheckListBox.SetStyle(
const ACustomListBox: TCustomListBox);
begin
TCocoaWSCustomListBox.SetStyle( ACustomListBox );
end;
end.

View File

@ -2726,8 +2726,8 @@ var
view: TCocoaTableListView;
begin
view := getTableViewFromLCLListBox(ACustomListBox);
ListBoxSetStyle(view, TCustomListBox(ACustomListBox).Style);
view.setNeedsDisplay_(true);
ListBoxSetStyle(view, ACustomListBox.Style);
view.reloadData;
end;
class procedure TCocoaWSCustomListBox.SetTopIndex(const ACustomListBox: TCustomListBox; const NewTopIndex: integer);