Ranorex

Navigation in Tree View

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexCore
View previous topic :: View next topic  
Author Message
Nik



Joined: 29 Sep 2006
Posts: 18

PostPosted: Tue Oct 31, 2006 3:05 am    Post subject: Navigation in Tree View
I want to select a file in tree view. The file is in embedded folder.
I tried using RxTreeViewSelectPath but this is not working.
Can you suggest some way of implementing this.
For e.g. I want to navigate to C:\Folder1\Folder2\ABC.txt.

I am using VC6.0 on WinXP.

-Nikhil
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 05 Jul 2006
Posts: 351

PostPosted: Wed Nov 01, 2006 1:32 pm    Post subject:
We cannot reproduce the bug with the windows explorer.
Do you use forward slashes "/" between the folder names?

Code: click into code to enlarge
RxTreeViewSelectPath(hTreeView, "Work (D:)/Ranorex/Samples/RanorexCppSample2");
...

But you can easily implement the functionality with elements:

Code: click into code to enlarge
// Selecting the path "Work (D:)\Ranorex\Bin"
ElementStruct element;
if ( RxControlGetElement(hTreeView, &element) == TRUE)
{
  ElementStruct treeItem1;
  if ( RxElementFindChild(&element, ROLE_SYSTEM_OUTLINEITEM, "Work (D:)", NULL, &treeItem1)==TRUE)
  {
    RxElementSelect(&treeItem1, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
    ElementStruct treeItem2;
    if( RxElementFindChild(&treeItem1, ROLE_SYSTEM_OUTLINEITEM, "Ranorex", NULL, &treeItem2)==TRUE)
    {
      RxElementSelect(&treeItem2, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
      ElementStruct treeItem3;
      if( RxElementFindChild(&treeItem2, ROLE_SYSTEM_OUTLINEITEM, "Bin", NULL, &treeItem3)==TRUE)
        RxElementSelect(&treeItem3, SELFLAG_TAKEFOCUS | SELFLAG_TAKESELECTION);
    }
  }
}

Jenö Herget
Ranorex Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexCore All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum