Jump to content

Erratic TreeView in 3.1.1.43


Recommended Posts

Hello !

TreeView in 3.1.1.43 is behaving strangely, just by going up and down in the list with arrows are generating an event for each line, this must be wrong.

Regards

Sven

#include <GUIConstants.au3>

Opt("GUIOnEventMode",1)

GUICreate("test")

$treeview = GUICtrlCreateTreeView (6,6,300,434,BitOr($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP,$TVS_SHOWSELALWAYS,$TVS_CHECKBOXES,$TVS_TRACKSELECT ),$WS_EX_CLIENTEDGE )

$item1 = GUICtrlCreateTreeViewItem("Item1",$treeview)

GUICtrlSetOnEvent(-1,"ItemSelection")

$item2 = GUICtrlCreateTreeViewItem("Item2",$treeview)

GUICtrlSetOnEvent(-1,"ItemSelection")

$item3 = GUICtrlCreateTreeViewItem("Item3",$treeview)

GUICtrlSetOnEvent(-1,"ItemSelection")

$item4 = GUICtrlCreateTreeViewItem("Item4",$treeview)

GUICtrlSetOnEvent(-1,"ItemSelection")

$subitem1 = GUICtrlCreateTreeViewItem("SubItem1",$item1)

GUICtrlSetOnEvent(-1,"ItemSelection")

$subitem2 = GUICtrlCreateTreeViewItem("SubItem2",$item1)

GUICtrlSetOnEvent(-1,"ItemSelection")

$status = GUICtrlCreateLabel("0",350,10,50,20)

GUISetOnEvent($GUI_EVENT_CLOSE,"ExitGUI")

GUISetState()

While 1

Sleep(10)

WEnd

Exit

Func ItemSelection()

GUICtrlSetData($status,@GUI_CtrlId)

Msgbox(0,"Event",@GUI_CtrlId,1)

EndFunc

Func ExitGUI()

Exit

EndFunc

testa.au3

Link to comment
Share on other sites

That's the way Holger want the treeview to react.

When an entry is select an event is fired whatever you change the state.

Perhaps it would have been better to fire the event only when the state is changed;

What do you think Holger?

Link to comment
Share on other sites

About a TreeView look please have a look at the features of this :

http://www.obout.com/t2/edraganddrop.aspx

They sypply a free dll to get a treeview working (including drag and drop functionality).

Is there anyone who can investigate if we can use the dllCall function to access the fucntionality ?

Or maybe using COM migt be succesful as well.

To be continued ...

Link to comment
Share on other sites

The event-coming is normal, so please take a look into your explorer and move the key up and down.

Do you see a change in your explorer listview?

If not then I think you a problem :(

So a change of the item-focus can only reported by fireing an event.

Regards

Holger

Link to comment
Share on other sites

The script I use lists a number of testcases from a directory and present them in a TreeView

The way I use it, is to select a number of testcases, by clicking on the TreeViewItem and have them Checkmarked if the testcases should be tested, otherwise the checkbox is blank, I use an array to keep track of the slected testcases. The normal way to select is to use the mouse or by using space bar, I can't use Space bar in AutoIt not in 3.1.1 or in this Beta.

Regards

Sven

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...