diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index e6a09004bc..31795d7bce 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -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); diff --git a/lcl/include/listitem.inc b/lcl/include/listitem.inc index dd6f1c9658..072b92af51 100644 --- a/lcl/include/listitem.inc +++ b/lcl/include/listitem.inc @@ -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 } {------------------------------------------------------------------------------} diff --git a/lcl/include/listitems.inc b/lcl/include/listitems.inc index b4626dc9af..504eb0bb64 100644 --- a/lcl/include/listitems.inc +++ b/lcl/include/listitems.inc @@ -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; {------------------------------------------------------------------------------}