mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-24 03:59:29 +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;
|
||||
FOnSelectionChanged: TNotifyEvent;
|
||||
FOptions: TTreeViewOptions;
|
||||
FPathDelimiter: String;
|
||||
FRClickNode: TTreeNode;
|
||||
FSaveItems: TStringList;
|
||||
FScrollBars: TScrollStyle;
|
||||
@ -3667,6 +3668,7 @@ type
|
||||
property OnNodeChanged: TTVNodeChangedEvent read FOnNodeChanged write FOnNodeChanged;
|
||||
property OnSelectionChanged: TNotifyEvent
|
||||
read FOnSelectionChanged write FOnSelectionChanged;
|
||||
property PathDelimiter: String read FPathDelimiter write FPathDelimiter;
|
||||
property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False;
|
||||
property RightClickSelect: Boolean
|
||||
read GetRightClickSelect write SetRightClickSelect default False;
|
||||
|
@ -1419,7 +1419,7 @@ begin
|
||||
while Assigned(Node) do
|
||||
begin
|
||||
if Result <> '' then
|
||||
Result := '/' + Result;
|
||||
Result := FOwner.FOwner.FPathDelimiter + Result;
|
||||
Result := Node.Text + Result;
|
||||
Node := Node.Parent;
|
||||
end;
|
||||
@ -2660,10 +2660,10 @@ var
|
||||
begin
|
||||
Result:=nil;
|
||||
repeat
|
||||
p:=System.Pos('/',TextPath);
|
||||
p:=System.Pos(FOwner.FPathDelimiter,TextPath);
|
||||
if p>0 then begin
|
||||
CurText:=LeftStr(TextPath,p-1);
|
||||
System.Delete(TextPath,1,p);
|
||||
System.Delete(TextPath,1,p-1+Length(FOwner.FPathDelimiter));
|
||||
end else begin
|
||||
CurText:=TextPath;
|
||||
TextPath:='';
|
||||
@ -3483,6 +3483,7 @@ begin
|
||||
FExpandSignColor := clWindowFrame;
|
||||
FHotTrackColor := clNone;
|
||||
FDisabledFontColor := clGrayText;
|
||||
FPathDelimiter := '/';
|
||||
// Accessibility
|
||||
AccessibleDescription := rsTTreeViewAccessibilityDescription;
|
||||
AccessibleRole := larTreeView;
|
||||
|
@ -638,6 +638,7 @@ begin
|
||||
inherited Create(AOwner);
|
||||
FInitialRoot := '';
|
||||
FUseBuiltinIcons := true;
|
||||
PathDelimiter := SysUtils.PathDelim;
|
||||
|
||||
// Initial property values
|
||||
FObjectTypes:= [otFolders];
|
||||
|
Loading…
Reference in New Issue
Block a user