mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 10:19:22 +02:00
ShellTreeView: refresh the tree when ObjectTypes is changed. Based upon a patch by theo.
git-svn-id: trunk@47743 -
This commit is contained in:
parent
2dce61002c
commit
d54f5572fa
@ -57,6 +57,7 @@ type
|
|||||||
{ Setters and getters }
|
{ Setters and getters }
|
||||||
function GetPath: string;
|
function GetPath: string;
|
||||||
procedure SetFileSortType(const AValue: TFileSortType);
|
procedure SetFileSortType(const AValue: TFileSortType);
|
||||||
|
procedure SetObjectTypes(AValue: TObjectTypes);
|
||||||
procedure SetPath(AValue: string);
|
procedure SetPath(AValue: string);
|
||||||
procedure SetRoot(const AValue: string);
|
procedure SetRoot(const AValue: string);
|
||||||
procedure SetShellListView(const Value: TCustomShellListView);
|
procedure SetShellListView(const Value: TCustomShellListView);
|
||||||
@ -84,7 +85,7 @@ type
|
|||||||
procedure Refresh(ANode: TTreeNode); overload;
|
procedure Refresh(ANode: TTreeNode); overload;
|
||||||
|
|
||||||
{ Properties }
|
{ Properties }
|
||||||
property ObjectTypes: TObjectTypes read FObjectTypes write FObjectTypes;
|
property ObjectTypes: TObjectTypes read FObjectTypes write SetObjectTypes;
|
||||||
property ShellListView: TCustomShellListView read FShellListView write SetShellListView;
|
property ShellListView: TCustomShellListView read FShellListView write SetShellListView;
|
||||||
property FileSortType: TFileSortType read FFileSortType write SetFileSortType;
|
property FileSortType: TFileSortType read FFileSortType write SetFileSortType;
|
||||||
property Root: string read FRoot write SetRoot;
|
property Root: string read FRoot write SetRoot;
|
||||||
@ -457,6 +458,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomShellTreeView.SetObjectTypes(AValue: TObjectTypes);
|
||||||
|
var
|
||||||
|
CurrPath: String;
|
||||||
|
begin
|
||||||
|
if FObjectTypes = AValue then Exit;
|
||||||
|
FObjectTypes := AValue;
|
||||||
|
if (csLoading in ComponentState) then Exit;
|
||||||
|
CurrPath := GetPath;
|
||||||
|
try
|
||||||
|
BeginUpdate;
|
||||||
|
Refresh(nil);
|
||||||
|
try
|
||||||
|
SetPath(CurrPath);
|
||||||
|
except
|
||||||
|
// CurrPath may have been removed in the mean time by another process, just ignore
|
||||||
|
on E: EInvalidPath do ;//
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomShellTreeView.CanExpand(Node: TTreeNode): Boolean;
|
function TCustomShellTreeView.CanExpand(Node: TTreeNode): Boolean;
|
||||||
var
|
var
|
||||||
OldAutoExpand: Boolean;
|
OldAutoExpand: Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user