Jump to content

Recommended Posts

Posted

I just upgraded from an old version of AutoIt from mid-2006 to the latest version 1.71 Nov 25 2007 and my script with GUICtrlCreateListViewItem is behaving differently now.

I already modified the code to work around the change in behavior, but was wondering if this is expected behavior or if it is a bug.

The problem can be reproduced by running the sample code from the help file for GUICtrlCreateListViewItem.

CODE
#include <GUIConstants.au3>

GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES)

GUISetBkColor (0x00E0FFFF) ; will change background color

$listview = GuiCtrlCreateListView ("col1 |col2|col3 ",10,10,200,150);,$LVS_SORTDESCENDING)

$button = GuiCtrlCreateButton ("Value?",75,170,70,20)

$item1=GuiCtrlCreateListViewItem("item2|col22|col23",$listview)

$item2=GuiCtrlCreateListViewItem("............item1|col12|col13",$listview)

$item3=GuiCtrlCreateListViewItem("item3|col32|col33",$listview)

$input1=GuiCtrlCreateInput("",20,200, 150)

GuiCtrlSetState(-1,$GUI_DROPACCEPTED) ; to allow drag and dropping

GuiSetState()

GUICtrlSetData($item2,"|ITEM1")

GUICtrlSetData($item3,"||COL33")

GUICtrlDelete($item1)

Do

$msg = GuiGetMsg ()

Select

Case $msg = $button

MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2)

Case $msg = $listview

MsgBox(0,"listview", "clicked="& GuiCtrlGetState($listview),2)

EndSelect

Until $msg = $GUI_EVENT_CLOSE

If you run that code and either drag & drop a list item to the textbox, or select a list item then click the button, you'll see a pipe | be appended to the end. The old version of autoit that I was running did not behave like this.

This is my first post to this forum so I hope I provided enough detail and posted in the right place. Thanks for the great free software.

Posted

Thanks for the tip. That has the behavior I'm used to.

I have the latest version and the gettextstring doesn't show the extra pipe on the end :-/. But post in bug reports with a detailed explanation and example script and so on

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
×
×
  • Create New...