mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:39:44 +02:00
LCL/(Shell)TreeView: Add property PathDelimiter to TCustomTreeView to allow OS path delimiter in ShellTreeView.
This commit is contained in:
parent
94a92b78f2
commit
9cce03ac94
@ -3418,6 +3418,7 @@ type
|
|||||||
FOnNodeChanged: TTVNodeChangedEvent;
|
FOnNodeChanged: TTVNodeChangedEvent;
|
||||||
FOnSelectionChanged: TNotifyEvent;
|
FOnSelectionChanged: TNotifyEvent;
|
||||||
FOptions: TTreeViewOptions;
|
FOptions: TTreeViewOptions;
|
||||||
|
FPathDelimiter: String;
|
||||||
FRClickNode: TTreeNode;
|
FRClickNode: TTreeNode;
|
||||||
FSaveItems: TStringList;
|
FSaveItems: TStringList;
|
||||||
FScrollBars: TScrollStyle;
|
FScrollBars: TScrollStyle;
|
||||||
@ -3667,6 +3668,7 @@ type
|
|||||||
property OnNodeChanged: TTVNodeChangedEvent read FOnNodeChanged write FOnNodeChanged;
|
property OnNodeChanged: TTVNodeChangedEvent read FOnNodeChanged write FOnNodeChanged;
|
||||||
property OnSelectionChanged: TNotifyEvent
|
property OnSelectionChanged: TNotifyEvent
|
||||||
read FOnSelectionChanged write FOnSelectionChanged;
|
read FOnSelectionChanged write FOnSelectionChanged;
|
||||||
|
property PathDelimiter: String read FPathDelimiter write FPathDelimiter;
|
||||||
property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False;
|
property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False;
|
||||||
property RightClickSelect: Boolean
|
property RightClickSelect: Boolean
|
||||||
read GetRightClickSelect write SetRightClickSelect default False;
|
read GetRightClickSelect write SetRightClickSelect default False;
|
||||||
|
@ -1419,7 +1419,7 @@ begin
|
|||||||
while Assigned(Node) do
|
while Assigned(Node) do
|
||||||
begin
|
begin
|
||||||
if Result <> '' then
|
if Result <> '' then
|
||||||
Result := '/' + Result;
|
Result := FOwner.FOwner.FPathDelimiter + Result;
|
||||||
Result := Node.Text + Result;
|
Result := Node.Text + Result;
|
||||||
Node := Node.Parent;
|
Node := Node.Parent;
|
||||||
end;
|
end;
|
||||||
@ -2660,10 +2660,10 @@ var
|
|||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
repeat
|
repeat
|
||||||
p:=System.Pos('/',TextPath);
|
p:=System.Pos(FOwner.FPathDelimiter,TextPath);
|
||||||
if p>0 then begin
|
if p>0 then begin
|
||||||
CurText:=LeftStr(TextPath,p-1);
|
CurText:=LeftStr(TextPath,p-1);
|
||||||
System.Delete(TextPath,1,p);
|
System.Delete(TextPath,1,p-1+Length(FOwner.FPathDelimiter));
|
||||||
end else begin
|
end else begin
|
||||||
CurText:=TextPath;
|
CurText:=TextPath;
|
||||||
TextPath:='';
|
TextPath:='';
|
||||||
@ -3483,6 +3483,7 @@ begin
|
|||||||
FExpandSignColor := clWindowFrame;
|
FExpandSignColor := clWindowFrame;
|
||||||
FHotTrackColor := clNone;
|
FHotTrackColor := clNone;
|
||||||
FDisabledFontColor := clGrayText;
|
FDisabledFontColor := clGrayText;
|
||||||
|
FPathDelimiter := '/';
|
||||||
// Accessibility
|
// Accessibility
|
||||||
AccessibleDescription := rsTTreeViewAccessibilityDescription;
|
AccessibleDescription := rsTTreeViewAccessibilityDescription;
|
||||||
AccessibleRole := larTreeView;
|
AccessibleRole := larTreeView;
|
||||||
|
@ -638,6 +638,7 @@ begin
|
|||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FInitialRoot := '';
|
FInitialRoot := '';
|
||||||
FUseBuiltinIcons := true;
|
FUseBuiltinIcons := true;
|
||||||
|
PathDelimiter := SysUtils.PathDelim;
|
||||||
|
|
||||||
// Initial property values
|
// Initial property values
|
||||||
FObjectTypes:= [otFolders];
|
FObjectTypes:= [otFolders];
|
||||||
|
Loading…
Reference in New Issue
Block a user