IDEIntf: ObjectInspector: fixed FInSelection in recursive calls

git-svn-id: trunk@49954 -
This commit is contained in:
mattias 2015-10-06 10:13:00 +00:00
parent d962160e3f
commit 67a9e199e1

View File

@ -33,10 +33,10 @@ uses
SysUtils, Types, Classes, TypInfo, FPCanvas, SysUtils, Types, Classes, TypInfo, FPCanvas,
// LCL // LCL
{$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF} {$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF}
InterfaceBase, Forms, Buttons, Graphics, GraphType, LCLProc, StdCtrls, InterfaceBase, Forms, Buttons, Graphics, GraphType, StdCtrls, LCLType,
LCLType, LCLIntf, Controls, ComCtrls, ExtCtrls, LMessages, LCLIntf, Controls, ComCtrls, ExtCtrls, LMessages, LazConfigStorage,
LazConfigStorage, Menus, Dialogs, Themes, TreeFilterEdit, ObjInspStrConsts, LazLoggerBase, Menus, Dialogs, Themes, LCLProc, TreeFilterEdit,
PropEdits, ListViewPropEdit, ImageListEditor, ObjInspStrConsts, PropEdits, ListViewPropEdit, ImageListEditor,
ComponentTreeView, ComponentEditors, IDEImagesIntf, IDEHelpIntf, ComponentTreeView, ComponentEditors, IDEImagesIntf, IDEHelpIntf,
OIFavoriteProperties, PropEditUtils; OIFavoriteProperties, PropEditUtils;
@ -4325,6 +4325,8 @@ begin
end; end;
procedure TObjectInspectorDlg.SetSelection(const ASelection: TPersistentSelectionList); procedure TObjectInspectorDlg.SetSelection(const ASelection: TPersistentSelectionList);
var
OldInSelection: Boolean;
begin begin
if ASelection<>nil then begin if ASelection<>nil then begin
if FSelection.IsEqual(ASelection) then if FSelection.IsEqual(ASelection) then
@ -4338,6 +4340,7 @@ begin
end else begin end else begin
if FSelection.Count=0 then exit; if FSelection.Count=0 then exit;
end; end;
OldInSelection := FInSelection;
FInSelection := True; FInSelection := True;
try try
// ToDo: Clear filter only if a selected node is hidden (Visible=False) // ToDo: Clear filter only if a selected node is hidden (Visible=False)
@ -4351,7 +4354,7 @@ begin
if Assigned(FOnSelectPersistentsInOI) then if Assigned(FOnSelectPersistentsInOI) then
FOnSelectPersistentsInOI(Self); FOnSelectPersistentsInOI(Self);
finally finally
FInSelection := False; FInSelection := OldInSelection;
end; end;
end; end;
@ -4367,7 +4370,7 @@ begin
WidgetSetsRestrictedBox.Invalidate; WidgetSetsRestrictedBox.Invalidate;
ComponentRestrictedBox.Invalidate; ComponentRestrictedBox.Invalidate;
end; end;
for Page := Low(TObjectInspectorPage) to High(TObjectInspectorPage) do for Page := Low(TObjectInspectorPage) to High(TObjectInspectorPage) do
if GridControl[Page] <> nil then if GridControl[Page] <> nil then
GridControl[Page].Selection := FSelection; GridControl[Page].Selection := FSelection;
@ -4505,7 +4508,7 @@ procedure TObjectInspectorDlg.ComponentTreeSelectionChanged(Sender: TObject);
begin begin
if (PropertyEditorHook=nil) or (PropertyEditorHook.LookupRoot=nil) then exit; if (PropertyEditorHook=nil) or (PropertyEditorHook.LookupRoot=nil) then exit;
if FSelection.IsEqual(ComponentTree.Selection) then exit; if FSelection.IsEqual(ComponentTree.Selection) then exit;
Fselection.Assign(ComponentTree.Selection); FSelection.Assign(ComponentTree.Selection);
RefreshSelection; RefreshSelection;
if Assigned(FOnSelectPersistentsInOI) then if Assigned(FOnSelectPersistentsInOI) then
FOnSelectPersistentsInOI(Self); FOnSelectPersistentsInOI(Self);
@ -5099,7 +5102,6 @@ begin
Result := nil; Result := nil;
end; end;
// --- Boolean settings ---
procedure TObjectInspectorDlg.OnShowComponentTreePopupMenuItemClick(Sender: TObject); procedure TObjectInspectorDlg.OnShowComponentTreePopupMenuItemClick(Sender: TObject);
begin begin
ShowComponentTree:=not ShowComponentTree; ShowComponentTree:=not ShowComponentTree;