開発向け情報です。
パス設定を以下のような感じに修正するとよさそうです。
この場合、依然の動作とは非互換となるため、取り込んだリリースの際には、
注意書きがあったほうがよさそうです。
---- unit_tree_list.pasの、THiTreeViewのSetSelectPath
procedure THiTreeView.SetSelectPath(path: string);
var
n, ok: TTreeNode;
sl: TStringList;
name: string;
k: Integer;
function findChildNode(n:TTreeNode;i:Integer):TTreeNode;
var
c, ok: TTreeNode;
j: Integer;
name: String;
begin
if (i >= sl.Count) or (sl.Strings[i] = '') then
begin
// 見つけた。
Result := n;
Exit;
end;
name := sl.Strings[i];
for j := 0 to n.Count - 1 do
begin
c := n.Item[j];
if c.Text = name then
begin
ok := findChildNode(c,i+1);
if ok <> nil then
begin
Result := ok;
Exit;
end;
end;
end;
Result := nil;
end;
begin
sl := SplitChar('\', path);
try
ok := Self.TopItem;
if (sl.Count > 0) and (sl.Strings[0]<>'') then
begin
name := sl.Strings[0];
ok := nil;
for k := 0 to Self.Items.Count -1 do
begin
n := Self.Items.Item[k];
if (n.Parent = nil) and (n.Text = name) then
begin
ok := findChildNode(n,1);
if ok <> nil then Break;
end;
end;
if ok = nil then Exit;// 一致なし
end;
ok.Selected := True;
finally
sl.Free;
end;
end;