Modify

Opened 13 years ago

Closed 11 years ago

#1954 closed Bug (Fixed)

ListViewItem returns 0 (failure) even though it populates the ListView

Reported by: anonymous Owned by: Jon
Milestone: 3.3.9.21 Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

When more sub-items are specified in the “text” parameter of function GUICtrlCreateListViewItem, the list view is populated with the sub-items that fit the ListView, but the control ID returned is 0.

The following script demonstrates this anomaly. In particular, $item2 is assigned 0 because it has one too many sub-items. The ID’s of each ListViewItem are shown in the input box.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Local $listview, $item1, $item2, $item3, $input1, $msg
GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)

$listview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$item1 = GUICtrlCreateListViewItem("1a|1b|1c", $listview)
$item2 = GUICtrlCreateListViewItem("2a|2b|2c|2d", $listview)
$item3 = GUICtrlCreateListViewItem("3a|3b|3c", $listview)
$input1 = GUICtrlCreateInput("$item1 = " & $item1 & ",   $item2 = " & $item2 & ",   $item3 = " & $item3, 10, 200, 200, 15)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Attachments (0)

Change History (5)

comment:1 Changed 13 years ago by Jpm

The $item2 is really invalid as it try to defined more field than the list number of columns can have.
The bug is it should not be displayed. Bad internal error handling.

comment:2 Changed 13 years ago by Zedna

Here is another modification

;~ $item2 = GUICtrlCreateListViewItem("2a|2b|2c|2d", $listview)
$item2 = GUICtrlCreateListViewItem("2a|2b", $listview)

In this case: less (only two) columns given it sucessfully create listview item and also corect nonzero control ID is returned.

So there is question if in case of more columns given shouldn't be returned correct nonzero control ID if Autoit can display it correctly (cut thrid unnecessary column internally)?

comment:3 Changed 11 years ago by Jon

  • Resolution set to Rejected
  • Status changed from new to closed

comment:4 Changed 11 years ago by Jpm

  • Resolution Rejected deleted
  • Status changed from closed to reopened

comment:5 Changed 11 years ago by Jon

  • Milestone set to 3.3.9.21
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from reopened to closed

Fixed by revision [8992] in version: 3.3.9.21

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 owner will remain Jon.
Author


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

 
Note: See TracTickets for help on using tickets.