TsPathDialog does not show directory from Path upon execute

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36762
    HeDiBo
    Participant

    Executing TsPathDialog with a path already set fails to scroll to that path in the directory structure.

    The flaw is in this piece of code:

    Code:
    try
    PathDialogForm.sShellTreeView1.BoundLabel.Caption := Caption;
    PathDialogForm.sShellTreeView1.Root := FRoot;
    if (s = '') then begin
    if PathDialogForm.sShellTreeView1.Items.Count > 0 then
    PathDialogForm.sShellTreeView1.Items[0].Selected := True;
    end
    else begin
    PathDialogForm.sShellTreeView1.Path := s;
    —>> There should be some statements like
    CurItem := {item corresponding to path}
    PathDialogForm.sShellTreeView1.Items[CurItem].Selected := True;
    PathDialogForm.sShellTreeView1.{Scroll to selected item}
    end;
    —>>
    if PathDialogForm.ShowModal = mrOk then begin

    I know the code is not correct, but I'm only giving an idea of what changes are possibly required.

    PS. Can somebody explain to me why indenting correctly is totally impossible in code snippets? 🙁

    #54387
    Support
    Keymaster

    Do you mean that TreeView is not scrolled to the predefined directory (path property) automatically?

    #54393
    HeDiBo
    Participant
    'Support' wrote:

    Do you mean that TreeView is not scrolled to the predefined directory (path property) automatically?

    That would be TsShellTreeView actually.

    But yes, that's what I mean.

    #54413
    Support
    Keymaster

    I will try to improve it in the v10.22

    #54557
    HeDiBo
    Participant
    'Support' wrote:

    I will try to improve it in the v10.22

    Fixed :a3:

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.