LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI tree control possible w/out a mouse, using SW

Solved!
Go to solution

I have been given a CVI application that includes a panel with a tree control section. The task I have at hand is to try and automate the current software application to exclude manual mouse use. Is there anyway to interface to a 'tree' using a soft approach and not using the mouse?

0 Kudos
Message 1 of 6
(3,688 Views)

I am not sure what you mean by automating a tree control, but... you can operate a tree control with the keyboard (there is a help section called Operating Tree Controls) and via software, i.e. programmatically, have a look at the functions SetCtrlVal and SetCtrlAttribute

0 Kudos
Message 2 of 6
(3,685 Views)

Generally this application is controlled manually using a mouse. I am looking to control it without mouse/keyboard entry and mainly be software. I was looking for

a way to take a folder in a tree control and expand it to reveal the contents of that folder and then I need to select a script file within that folder. The only info I

have is the constant name assigned to the 'Tree Control'.

0 Kudos
Message 3 of 6
(3,670 Views)
Solution
Accepted by topic author ciao_bullet

If you want to operate on the tree control programmatically you can use functions included in this page; to expand or collapse a tree branch for example you can:

 

  • Locate the tree item to operate on with GetTreeItemFromTag (panelHandle, PANEL_TREE, "thetag", &idx);
  • Set its state with SetTreeItemAttribute (panelHandle, PANEL_TREE, idx, ATTR_COLLAPSED, 1);

 

But I have an impression that your concept of automating the program is the ability to operate on the program from another application acting as if it were the user. If this is true, I'm afraid there is no possibility to do so, as CVI control are not standard windows controls (e.g. you cannot obtain their system handle).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(3,663 Views)

Thanks for your input. I am operating on the tree from a newly created module in the application, trying to leave the existing application software in tact. I will

look over the page 'Programing with Tree Controls' as pointed out.Unfortunate for me, I have not had the course for CVI and am basically finding my way through

by trial and error.

0 Kudos
Message 5 of 6
(3,656 Views)

In this case, going through the examples CVI provides on tree controls can be a good source of ideas and programming tips. You can find several of them in samples\userint folder: I suggest you look at tree search that shows how to locate tree items; the other examples are very specific for features you probably don't need at this moment, but indeed can be worth viewed.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(3,648 Views)