mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 15:37:50 +02:00
IDE In search results window, do not expand nodes when switching tabs. Issue #41259.
This commit is contained in:
parent
e1aff780f0
commit
d326f3e9e7
@ -82,8 +82,8 @@ type
|
|||||||
fFirstPassedNode: TTreeNode;
|
fFirstPassedNode: TTreeNode;
|
||||||
fOnGetImageIndex: TImageIndexEvent;
|
fOnGetImageIndex: TImageIndexEvent;
|
||||||
fOnFilterNode: TFilterNodeEvent;
|
fOnFilterNode: TFilterNodeEvent;
|
||||||
procedure SetFilteredTreeview(const AValue: TCustomTreeview);
|
procedure SetFilteredTreeview(AValue: TCustomTreeview);
|
||||||
procedure SetShowDirHierarchy(const AValue: Boolean);
|
procedure SetShowDirHierarchy(AValue: Boolean);
|
||||||
function FilterTree(Node: TTreeNode): Boolean;
|
function FilterTree(Node: TTreeNode): Boolean;
|
||||||
procedure OnBeforeTreeDestroy(Sender: TObject);
|
procedure OnBeforeTreeDestroy(Sender: TObject);
|
||||||
protected
|
protected
|
||||||
@ -102,6 +102,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure SetTreeFilterSilently(ATree: TCustomTreeview; AFilter: string);
|
||||||
procedure StoreSelection; override;
|
procedure StoreSelection; override;
|
||||||
procedure RestoreSelection; override;
|
procedure RestoreSelection; override;
|
||||||
function GetExistingBranch(ARootNode: TTreeNode): TTreeFilterBranch;
|
function GetExistingBranch(ARootNode: TTreeNode): TTreeFilterBranch;
|
||||||
@ -446,7 +447,7 @@ begin
|
|||||||
FreeAndNil(fBranches);
|
FreeAndNil(fBranches);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTreeFilterEdit.SetFilteredTreeview(const AValue: TCustomTreeview);
|
procedure TTreeFilterEdit.SetFilteredTreeview(AValue: TCustomTreeview);
|
||||||
begin
|
begin
|
||||||
if fFilteredTreeview = AValue then Exit;
|
if fFilteredTreeview = AValue then Exit;
|
||||||
if fFilteredTreeview <> nil then
|
if fFilteredTreeview <> nil then
|
||||||
@ -463,7 +464,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTreeFilterEdit.SetShowDirHierarchy(const AValue: Boolean);
|
procedure TTreeFilterEdit.SetTreeFilterSilently(ATree: TCustomTreeview; AFilter: string);
|
||||||
|
begin // The tree is already filtered, the same FilterEdit is used for many.
|
||||||
|
fAlreadyFiltered:=True;
|
||||||
|
SetFilteredTreeview(ATree);
|
||||||
|
InternalSetFilter(AFilter);
|
||||||
|
fAlreadyFiltered:=False;
|
||||||
|
Text:=AFilter; // This will trigger filtering if Text differs from AFilter.
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TTreeFilterEdit.SetShowDirHierarchy(AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if fShowDirHierarchy=AValue then exit;
|
if fShowDirHierarchy=AValue then exit;
|
||||||
if not Assigned(fFilteredTreeview) then
|
if not Assigned(fFilteredTreeview) then
|
||||||
|
@ -10,9 +10,9 @@ object SearchResultsView: TSearchResultsView
|
|||||||
Constraints.MinHeight = 100
|
Constraints.MinHeight = 100
|
||||||
Constraints.MinWidth = 400
|
Constraints.MinWidth = 400
|
||||||
KeyPreview = True
|
KeyPreview = True
|
||||||
|
LCLVersion = '4.99.0.0'
|
||||||
OnCreate = Form1Create
|
OnCreate = Form1Create
|
||||||
OnKeyDown = FormKeyDown
|
OnKeyDown = FormKeyDown
|
||||||
LCLVersion = '2.3.0.0'
|
|
||||||
object ControlBar1: TPanel
|
object ControlBar1: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 26
|
Height = 26
|
||||||
|
@ -798,8 +798,7 @@ begin
|
|||||||
lTree := GetCurrentTree;
|
lTree := GetCurrentTree;
|
||||||
if assigned(lTree) and not (csDestroying in lTree.ComponentState) then
|
if assigned(lTree) and not (csDestroying in lTree.ComponentState) then
|
||||||
begin
|
begin
|
||||||
SearchInListEdit.FilteredTreeview := lTree;
|
SearchInListEdit.SetTreeFilterSilently(lTree, lTree.SearchInListPhrases);
|
||||||
SearchInListEdit.Filter := lTree.SearchInListPhrases;
|
|
||||||
if FFocusTreeViewInOnChange then
|
if FFocusTreeViewInOnChange then
|
||||||
ActivateControl(lTree);
|
ActivateControl(lTree);
|
||||||
end;
|
end;
|
||||||
|
@ -241,8 +241,9 @@ type
|
|||||||
procedure OnAsync(Data: PtrInt);
|
procedure OnAsync(Data: PtrInt);
|
||||||
function IsTextHintStored: Boolean;
|
function IsTextHintStored: Boolean;
|
||||||
protected
|
protected
|
||||||
fNeedUpdate: Boolean;
|
fAlreadyFiltered: Boolean;
|
||||||
fIsFirstUpdate: Boolean;
|
fIsFirstUpdate: Boolean;
|
||||||
|
fNeedUpdate: Boolean;
|
||||||
fSelectedPart: TObject; // Select this node on next update
|
fSelectedPart: TObject; // Select this node on next update
|
||||||
fOnFilterItem: TFilterItemEvent;
|
fOnFilterItem: TFilterItemEvent;
|
||||||
fOnFilterItemEx: TFilterItemExEvent;
|
fOnFilterItemEx: TFilterItemExEvent;
|
||||||
@ -1348,6 +1349,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomControlFilterEdit.InvalidateFilter;
|
procedure TCustomControlFilterEdit.InvalidateFilter;
|
||||||
begin
|
begin
|
||||||
|
if fAlreadyFiltered then Exit;
|
||||||
fNeedUpdate:=true;
|
fNeedUpdate:=true;
|
||||||
IdleConnected:=true;
|
IdleConnected:=true;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user