mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 07:30:22 +02:00
lcl: setting items state on listview handle creation
git-svn-id: trunk@23724 -
This commit is contained in:
parent
1f6c52fe1a
commit
11f880e78a
@ -720,6 +720,7 @@ type
|
||||
procedure WSUpdateText;
|
||||
procedure WSUpdateImages;
|
||||
procedure WSUpdateChecked;
|
||||
procedure WSSetState;
|
||||
procedure WSUpdateState;
|
||||
|
||||
procedure SetChecked(AValue: Boolean);
|
||||
|
@ -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
|
||||
|
@ -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 }
|
||||
{------------------------------------------------------------------------------}
|
||||
|
@ -185,6 +185,8 @@ begin
|
||||
FCacheItem.WSUpdateText;
|
||||
FCacheItem.WSUpdateImages;
|
||||
FCacheItem.WSUpdateChecked;
|
||||
if not (lisfWSItemsCreated in FFlags) then
|
||||
FCacheItem.WSSetState;
|
||||
FCacheItem.WSUpdateState;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user