mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:56:12 +02:00
LCL: treeview: protect Change as well, not only OnChange
git-svn-id: trunk@58279 -
This commit is contained in:
parent
a689b3bf84
commit
93a2ed86cc
@ -3300,7 +3300,7 @@ type
|
||||
private
|
||||
FAccessibilityOn: Boolean;
|
||||
FBottomItem: TTreeNode;
|
||||
FCallingOnChange: Boolean;
|
||||
FCallingChange: Boolean;
|
||||
FEditingItem: TTreeNode;
|
||||
FExpandSignType: TTreeViewExpandSignType;
|
||||
FExpandSignSize: integer;
|
||||
|
@ -4275,7 +4275,12 @@ procedure TCustomTreeView.OnChangeTimer(Sender: TObject);
|
||||
begin
|
||||
FChangeTimer.Enabled := False;
|
||||
//debugln('TCustomTreeView.OnChangeTimer');
|
||||
Change(FSelectedNode);
|
||||
FCallingChange := True;
|
||||
try
|
||||
Change(FSelectedNode);
|
||||
finally
|
||||
FCallingChange := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomTreeView.UpdateScrollbars;
|
||||
@ -5405,14 +5410,8 @@ end;
|
||||
|
||||
procedure TCustomTreeView.Change(Node: TTreeNode);
|
||||
begin
|
||||
if Assigned(FOnChange) then begin
|
||||
FCallingOnChange := True;
|
||||
try
|
||||
FOnChange(Self, Node);
|
||||
finally
|
||||
FCallingOnChange := False;
|
||||
end;
|
||||
end;
|
||||
if Assigned(FOnChange) then
|
||||
FOnChange(Self, Node);
|
||||
end;
|
||||
|
||||
procedure TCustomTreeView.Delete(Node: TTreeNode);
|
||||
@ -6044,7 +6043,7 @@ begin
|
||||
Exclude(FStates, tvsSelectionChanged);
|
||||
DoSelectionChanged;
|
||||
FChangeTimer.Enabled := False;
|
||||
if not FCallingOnChange then // Prevent recursive loop from OnChange handler.
|
||||
if not FCallingChange then // Prevent recursive loop from OnChange handler.
|
||||
FChangeTimer.Enabled := True;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user