mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 10:20:19 +02:00
listview: update listitem state
git-svn-id: trunk@13802 -
This commit is contained in:
parent
37a80ea14c
commit
b5adcbda29
@ -635,6 +635,7 @@ type
|
||||
procedure WSUpdateText;
|
||||
procedure WSUpdateImages;
|
||||
procedure WSUpdateChecked;
|
||||
procedure WSUpdateState;
|
||||
|
||||
procedure SetChecked(AValue: Boolean);
|
||||
procedure SetState(const ALisOrd: Integer; const AIsSet: Boolean);
|
||||
|
@ -438,6 +438,26 @@ begin
|
||||
TWSCustomListViewClass(LV.WidgetSetClass).ItemSetChecked(LV, idx, Self, FChecked);
|
||||
end;
|
||||
|
||||
procedure TListItem.WSUpdateState;
|
||||
var
|
||||
AState: TListItemState;
|
||||
AIsSet: Boolean;
|
||||
LV: TCustomListView;
|
||||
idx: Integer;
|
||||
begin
|
||||
LV := FOwner.FOwner;
|
||||
idx := GetIndex;
|
||||
FStates := [];
|
||||
for AState := Low(TListItemState) to High(TListItemState) do
|
||||
begin
|
||||
if TWSCustomListViewClass(LV.WidgetSetClass).ItemGetState(LV, idx, Self, AState, AIsSet) then
|
||||
begin
|
||||
if AIsSet then
|
||||
include(FStates, AState);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
{ TListItem IntfUpdateAllowed }
|
||||
{------------------------------------------------------------------------------}
|
||||
|
@ -75,6 +75,7 @@ begin
|
||||
AValue.WSUpdateText;
|
||||
AValue.WSUpdateImages;
|
||||
AValue.WSUpdateChecked;
|
||||
AValue.WSUpdateState;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -130,6 +131,7 @@ begin
|
||||
FCacheItem.WSUpdateText;
|
||||
FCacheItem.WSUpdateImages;
|
||||
FCacheItem.WSUpdateChecked;
|
||||
FCacheItem.WSUpdateState;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
|
Loading…
Reference in New Issue
Block a user