listview: update listitem state

git-svn-id: trunk@13802 -
This commit is contained in:
paul 2008-01-19 17:31:38 +00:00
parent 37a80ea14c
commit b5adcbda29
3 changed files with 23 additions and 0 deletions

View File

@ -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);

View File

@ -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 }
{------------------------------------------------------------------------------}

View File

@ -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;
{------------------------------------------------------------------------------}