mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 06:08:17 +02:00
LCL: Implemented TCustomCheckListBox.CheckAll (Delphi2010 compat). Starts to works when bug #19979 is fixed
git-svn-id: trunk@31974 -
This commit is contained in:
parent
3338aa1034
commit
278845f007
@ -70,6 +70,7 @@ type
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure MeasureItem(Index: Integer; var TheHeight: Integer); override;
|
||||
procedure Toggle(AIndex: Integer);
|
||||
procedure CheckAll(AState: TCheckBoxState; AllowGrayed: Boolean = True; AllowDisabled: Boolean = True);
|
||||
|
||||
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default False;
|
||||
property Checked[AIndex: Integer]: Boolean read GetChecked write SetChecked;
|
||||
@ -214,6 +215,17 @@ begin
|
||||
State[AIndex] := NextStateMap[State[AIndex]][AllowGrayed];
|
||||
end;
|
||||
|
||||
procedure TCustomCheckListBox.CheckAll(AState: TCheckBoxState;
|
||||
AllowGrayed: Boolean; AllowDisabled: Boolean);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to Items.Count - 1 do begin
|
||||
if (AllowGrayed or (State[i] <> cbGrayed)) and (AllowDisabled or ItemEnabled[i]) then
|
||||
State[i] := AState;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomCheckListBox.DoChange(var Msg: TLMessage);
|
||||
begin
|
||||
//DebugLn(['TCustomCheckListBox.DoChange ',DbgSName(Self),' ',Msg.WParam]);
|
||||
|
Loading…
Reference in New Issue
Block a user