LCL: New procedure Exchange for TCheckListBox. Issue #34793, patch from AlexeyT.

git-svn-id: trunk@59972 -
This commit is contained in:
juha 2019-01-02 15:30:45 +00:00
parent 6bedb95bcd
commit e3f4661f92

View File

@ -68,7 +68,8 @@ type
procedure MeasureItem(Index: Integer; var TheHeight: Integer); override;
procedure Toggle(AIndex: Integer);
procedure CheckAll(AState: TCheckBoxState; aAllowGrayed: Boolean = True; aAllowDisabled: Boolean = True);
procedure Exchange(AIndex1, AIndex2: Integer);
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed default False;
property Checked[AIndex: Integer]: Boolean read GetChecked write SetChecked;
property Header[AIndex: Integer]: Boolean read GetHeader write SetHeader;
@ -243,6 +244,16 @@ begin
end;
end;
procedure TCustomCheckListBox.Exchange(AIndex1, AIndex2: Integer);
var
Value: TCheckBoxState;
begin
Value := State[AIndex1];
State[AIndex1] := State[AIndex2];
State[AIndex2] := Value;
Items.Exchange(AIndex1, AIndex2);
end;
procedure TCustomCheckListBox.DoChange(var Msg: TLMessage);
begin
//DebugLn(['TCustomCheckListBox.DoChange ',DbgSName(Self),' ',Msg.WParam]);