From: <ah...@us...> - 2011-05-17 13:15:35
|
Revision: 13028 http://jvcl.svn.sourceforge.net/jvcl/?rev=13028&view=rev Author: ahuser Date: 2011-05-17 13:15:29 +0000 (Tue, 17 May 2011) Log Message: ----------- OnAddition/OnDeletion was called when the handle was recreated Modified Paths: -------------- trunk/jvcl/run/JvComCtrls.pas Modified: trunk/jvcl/run/JvComCtrls.pas =================================================================== --- trunk/jvcl/run/JvComCtrls.pas 2011-05-16 20:49:35 UTC (rev 13027) +++ trunk/jvcl/run/JvComCtrls.pas 2011-05-17 13:15:29 UTC (rev 13028) @@ -572,6 +572,10 @@ procedure KeyDown(var Key: Word; Shift: TShiftState); override; procedure KeyPress(var Key: Char); override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer); override; + {$IFNDEF COMPILER15_UP} // Delphi XE fixed the OnAddition/OnDeletion bug + procedure Added(Node: TTreeNode); override; + procedure Delete(Node: TTreeNode); override; + {$ENDIF ~COMPILER15_UP} property ScrollDirection: Integer read FScrollDirection write SetScrollDirection; procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure DblClick; override; @@ -2977,6 +2981,50 @@ Result := clDefault; end; +{$IFNDEF COMPILER15_UP} // Delphi XE fixed the OnAddition/OnDeletion bug +procedure TJvTreeView.Added(Node: TTreeNode); +var + OrgOnAddition: TTVExpandedEvent; +begin + OrgOnAddition := OnAddition; + if CreateWndRestores and + {$IFDEF COMPILER170_UP} + (csRecreating in ControlState) + {$ELSE} + not (csDestroying in ComponentState) + {$ENDIF} + then + OnAddition := nil; + try + inherited Added(Node); + finally + if Assigned(OrgOnAddition) then + OnAddition := OrgOnAddition; + end; +end; + +procedure TJvTreeView.Delete(Node: TTreeNode); +var + OrgOnDeletion: TTVExpandedEvent; +begin + OrgOnDeletion := OnDeletion; + if CreateWndRestores and + {$IFDEF COMPILER10_UP} + (csRecreating in ControlState) + {$ELSE} + not (csDestroying in ComponentState) + {$ENDIF} + then + OnDeletion := nil; + try + inherited Delete(Node); + finally + if Assigned(OrgOnDeletion) then + OnDeletion := OrgOnDeletion; + end; +end; +{$ENDIF ~COMPILER15_UP} + procedure TJvTreeView.Select(Node: TTreeNode; ShiftState: TShiftState); var WasSelected: Boolean; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |