Opened on Jun 6, 2009 at 12:04:53 AM
Closed on Jun 6, 2009 at 12:31:17 AM
Last modified on Jun 6, 2009 at 5:39:53 AM
#1011 closed Bug (No Bug)
GUICtrlSetOnEvent registeres also on Listviewitems created with _GUICtrlListView_AddItem and lparam
| Reported by: | Qsek | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.0.0 | Severity: | None |
| Keywords: | Cc: |
Description
When using OnEventMode, GUICtrlSetOnEvent seems to also fire when you click on Listviewitems created with _GUICtrlListView_AddItem
If the $iParam is the same as a controlID of an control on which GUICtrlSetOnEvent is bounded, a click on this Listviewitem will run the associated OnEvent function, as if you would have clicked the control.
See attached example 2.au3
click on item 4 and 5
Qsek
Attachments (1)
Change History (5)
comment:1 by , on Jun 6, 2009 at 12:31:17 AM
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
Not a bug, Application defined data is just that, you need to make sure that if you use lparam to start at a number higher than any control already created to not have the same application defined data value.
follow-up: 3 comment:2 by , on Jun 6, 2009 at 12:32:46 AM
see the example2 for _GUICtrlListView_RegisterSortCallBack in the help file
follow-up: 4 comment:3 by , on Jun 6, 2009 at 4:55:32 AM
hmm ok so as i understand lparam sets the controlID of the LVitem?
This should be mentioned somewhere in the help.
I can be a really annoying bug if you work with LV's and lparam.
But do you think it is good that it is possible to create a control(LVitem) that has the same ControlID as another control?
and why is it only affecting GUISetOnEvent? Normally you should be able to use GUICtrlSetData and the other control functions if you set the lparam.
comment:4 by , on Jun 6, 2009 at 5:39:53 AM
Replying to anonymous:
hmm ok so as i understand lparam sets the controlID of the LVitem?
Not quite. Due to poor design in AutoIt, the LPARAM is internally used to store the control ID that AutoIt returns. That means it's not possible to use the LPARAM of built-in ListViewItems without breaking AutoIt's handling. Likewise it makes it so that even users who are not using the built-in control and are instead using the Windows API directly can't effectively use the LPARAM without clashing.
You should never mix built-in and UDF controls. Use one or the other, not both.

Attachment to Ticket #1011