lcl: setting items state on listview handle creation

git-svn-id: trunk@23724 -
This commit is contained in:
dmitry 2010-02-17 06:51:12 +00:00
parent 1f6c52fe1a
commit 11f880e78a
4 changed files with 16 additions and 0 deletions

View File

@ -720,6 +720,7 @@ type
procedure WSUpdateText;
procedure WSUpdateImages;
procedure WSUpdateChecked;
procedure WSSetState;
procedure WSUpdateState;
procedure SetChecked(AValue: Boolean);

View File

@ -230,6 +230,7 @@ begin
end;
LVN_ITEMCHANGED: begin
Item := Items[nm^.iItem];
if not (lisfWSItemsCreated in FListItems.Flags) then Exit;
//DebugLn('TCustomListView.CNNotify Count=',dbgs(Items.Count),' nm^.iItem=',dbgs(nm^.iItem),' destroying=',dbgs(lifDestroying in Item.FFlags));
if (Item <> nil) and (not OwnerData) and (lifDestroying in Item.FFlags) then begin
if Item=FFocused then

View File

@ -458,6 +458,18 @@ begin
end;
end;
procedure TListItem.WSSetState;
var
AState: TListItemState;
LV: TCustomListView;
idx: Integer;
begin
LV := FOwner.FOwner;
idx := GetIndex;
for AState := Low(TListItemState) to High(TListItemState) do
TWSCustomListViewClass(LV.WidgetSetClass).ItemSetState(LV, idx, Self, AState, AState in FStates);
end;
{------------------------------------------------------------------------------}
{ TListItem IntfUpdateAllowed }
{------------------------------------------------------------------------------}

View File

@ -185,6 +185,8 @@ begin
FCacheItem.WSUpdateText;
FCacheItem.WSUpdateImages;
FCacheItem.WSUpdateChecked;
if not (lisfWSItemsCreated in FFlags) then
FCacheItem.WSSetState;
FCacheItem.WSUpdateState;
end;