Jump to content
Sign in to follow this  
XinLu

a BUG of Listview or what?

Recommended Posts

XinLu

let me make it simple, so I wish you can understand what I am talking about.

I created a few buttons, for example, they have Control IDs from 1 to 5

(hint: these control IDs could be retrieved by using GUIGetCursorInfo, the $Array[4] holds the IDs)

The same GUI, I also created a Listview. I added some line items (more than 5). Now, items' indices are 0, 1, 2, 3, 4, 5, ......

Now, the problem is:

When I click (highlight) on the item with index 1, button A with control ID 1 is activated, meaning it is clicked as well.

Same as button B, C, D... Each of these button has a control ID, and this ID matches with a listview index.

As long I select the item in the listview, if the index matches with one Control ID, the button will be activated (clicked)

I've seen this problem since I started to use listview. Three of my programs got the exactly same problems. My temporary solution for this is to use GUIGetCursoInfo for a double check (if curson is not on top of the button, don't execute functions...)

Hope you guys understand what I am saying. Is this a bug or what? How am I going to fix it besides using GUIGetCursoInfo for a double check?

Thanks a lot!!

Share this post


Link to post
Share on other sites
weaponx

When you click a listviewitem, GuiGetMsg() should return the control id of your entire list, then in your GuiGetMsg() loop you use GUICtrlRead(GUICtrlRead($listview)) to get the contents.

Maybe you can post a reproducer script for further diagnosis.

Share this post


Link to post
Share on other sites
XinLu

Thank you for your quick reply. The beta works! It is a bug.

However, the beta brought me a new problem. $BS_MULTILINE for GUI Buttons becomes UNKOWN variable. Has this been removed in beta?

To weaponx, thank you as well. But I am not trying to read the content in listview, I just want to select something without activating other buttons.

The beta fixed the bug.

Thank you all.

Share this post


Link to post
Share on other sites
AdmiralAlkex

Thank you for your quick reply. The beta works! It is a bug.

However, the beta brought me a new problem. $BS_MULTILINE for GUI Buttons becomes UNKOWN variable. Has this been removed in beta?

In the future (the beta) GUIConstants.au3 has changed to not include all the other constants like previous versions. To use $BS_MULTILINE you must include ButtonConstants.au3

Share this post


Link to post
Share on other sites
XinLu

In the future (the beta) GUIConstants.au3 has changed to not include all the other constants like previous versions. To use $BS_MULTILINE you must include ButtonConstants.au3

Thanks a lot!

I am learning the change logs for beta. Hope it won't cause me a lot of trouble. :)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.