Sign in to follow this  
Followers 0
QA Stooge

Distinguishing Selected Controls

5 posts in this topic

See my attached screenshot.

Notice that there are 3 ListView controls.

Notice that 2 are populated with LVItem controls.

Notice that for each LV control there is a LVItem selected.

Notice that there is one LVItem which was last clicked (hilighted blue one on the right) and one which was selected sometime previously.

Now for the question.

How does AutoIt know which one was last clicked?

... a computer user (you and I) can just tell visually. But the computer has a different method of reliable distinction. Anyone know how to get the equivalent of something like a "GUICtrlGetLastSelected()" function?

Share this post


Link to post
Share on other sites



Hi,

Well, I think you should use some array_variable like :

array_item1[$number] as an array-variable used for the first listview

array_item3[$number] as an array-variable used for the third listview

$selected_indice = _GUICtrlListViewGetSelectedIndices() let you identify which item is selected through its indice of insertion in the listview

$selected_text = _GUICtrlListViewGetItemText() let you retrieves some or all of a list-view item.

Share this post


Link to post
Share on other sites

Yeah... what Shao said. But since you just want the last one, you can put it in a single variable. Every ListViewItem will have an ID and that ID will go into your variable every time it is pressed.

Share this post


Link to post
Share on other sites

Hi,

Well, I think you should use some array_variable like :

array_item1[$number] as an array-variable used for the first listview

array_item3[$number] as an array-variable used for the third listview

$selected_indice = _GUICtrlListViewGetSelectedIndices() let you identify which item is selected through its indice of insertion in the listview

$selected_text = _GUICtrlListViewGetItemText() let you retrieves some or all of a list-view item.

Actually, I didn't use your method, but what you said just triggered an epiphany that worked beautifully...

- set up an array of size equal to the number of ListViews.

- each element in the array has the CtrlID of the LVI selected in each ListView.

- if an element changes, update ths info display window.

Even if I didn't use your method, just your train of thought helped me a bundle. Thanks!

Share this post


Link to post
Share on other sites

Well, I'm happy to have helpt you in a way.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0