Modify

Opened 17 years ago

Closed 17 years ago

#965 closed Bug (No Bug)

ListViewItem not responding to SetOnEvent

Reported by: andybiochem Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

If the number of delimited items in the "text" of a ListViewItem is greater than the number of columns in the ListView control itself, the ListViewItem will not respond to a SetOnEvent declaration.

Reproducer:

Opt("GUIOnEventMode", 1)

GUICreate("", 220, 150)

;----- NOT WORKING -----
$ListView1 = GUICtrlCreateListView("Col1|Col2|Col3", 10, 10, 190, 50)
GUICtrlCreateListViewItem("first|second|third|fourth",$ListView1)
GUICtrlSetOnEvent(-1,"_Selected")

;----- WORKING OK -----
$ListView2 = GUICtrlCreateListView("Col1|Col2|Col3|Col4", 10, 70, 190, 50)
GUICtrlCreateListViewItem("first|second|third|fourth",$ListView2)
GUICtrlSetOnEvent(-1,"_Selected")

GUISetState(@SW_SHOW)

While 1
    Sleep(100)
WEnd

Func _Selected()
    ConsoleWrite(@GUI_CtrlId & @CRLF)
EndFunc

... clicking on the top ListViewItem does not call the function set by 'GUICtrlSetOnEvent'.

The second ListViewItem works as it should.

Attachments (0)

Change History (2)

comment:1 by andybiochem, 17 years ago

Just discovered here that the problem is due to GUICtrlCreateListViewItem not returning a control ID upon creation. If the control creation fails, so be it, but the ListViewItem IS actually created in this case, and appears in the ListView control.

comment:2 by J-Paul Mesnage, 17 years ago

Resolution: No Bug
Status: newclosed

Just read the doc the control can fail and you are in the case

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.