Modify

Opened 16 years ago

Closed 16 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 Changed 16 years ago by andybiochem

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 Changed 16 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.