Starky Posted October 4, 2005 Share Posted October 4, 2005 (edited) I seem to be having a bit of trouble creating multiple list views. When I try to read selected data from the second list view, it reads a completely different controlID. I have posted an example below. Select item 1 in the child list and hit enter to see what I mean. I am working on a workaround for now. expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ENTER}", "ShowInfo") Func ShowInfo() $x = GUICtrlRead($ParentList) $y = GUICtrlRead($x) $x2 = GUICtrlRead($ChildList) $y2 = GUICtrlRead($x2) MsgBox(0, "List", "Parent List: " & $x & " ~ " & $y & @CRLF & "Child List: " & $x2 & " ~ " & $y2) $x3 = $ParentListItem1 $y3 = GUICtrlRead($ParentListItem1) $x4 = $ChildListItem1 $y4 = GUICtrlRead($ChildListItem1) MsgBox(0, "Item", "Parent: " & $x3 & " ~ " & $y3 & @CRLF & "Child List: " & $x4 & " ~ " & $y4) EndFunc $GUIWidth = 250 $GUIHeight = 250 $ParentWin = GUICreate("Parent GUI", $GUIWidth, $GUIHeight) $ParentList = GUICtrlCreateListView("1|2|3|4|5", 15, 15, 200, 200, $LVS_NOSORTHEADER) $ParentListItem1 = GUICtrlCreateListViewItem("P-1-1|P-1-2|P-1-3|P-1-4|P-1-5", $ParentList) $ParentListItem2 = GUICtrlCreateListViewItem("P-2-1|P-2-2|P-2-3|P-2-4|P-2-5", $ParentList) GUISetState() ;$ChildWin = GUICreate("Child GUI", $GUIWidth, $GUIHeight) $ParentWin_Pos = WinGetPos($ParentWin, "") $ChildWin = GUICreate("Child GUI", $GUIWidth, $GUIHeight, $ParentWin_Pos[0] + 100, $ParentWin_Pos[1] + 100, -1, -1, $ParentWin) $ChildList = GUICtrlCreateListView("1|2|3|4|5", 15, 15, 200, 200, $LVS_NOSORTHEADER) $ChildListItem1 = GUICtrlCreateListViewItem("C-1-1|C-1-2|C-1-3|C-1-4|C-1-5", $ChildList) $ChildListItem2 = GUICtrlCreateListViewItem("C-2-1|C-2-2|C-2-3|C-2-4|C-2-5", $ChildList) $ChildListItem3 = GUICtrlCreateListViewItem("C-3-1|C-3-2|C-3-3|C-3-4|C-3-5", $ChildList) GUISetState() While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $GUI_EVENT_CLOSE If $msg[1] = $ChildWin Then GUISwitch($ChildWin) GUIDelete() ElseIf $msg[1] = $ParentWin Then GUISwitch($ParentWin) GUIDelete() Exit EndIf EndSelect WEnd Edited October 4, 2005 by Starky Link to comment Share on other sites More sharing options...
Starky Posted October 5, 2005 Author Share Posted October 5, 2005 Any ideas? Link to comment Share on other sites More sharing options...
Starky Posted October 6, 2005 Author Share Posted October 6, 2005 Sigh.. Link to comment Share on other sites More sharing options...
jpm Posted October 6, 2005 Share Posted October 6, 2005 I don't understand your completly different ControlID. The Script is working as expected. ControlID are unique in AutoIT and not in sequence. Link to comment Share on other sites More sharing options...
Starky Posted October 6, 2005 Author Share Posted October 6, 2005 (edited) In the first message box, the data selected in the child list view ($ChildList) is not correct data shown with GUICtrlRead(GUICtrlRead($ChildList)).. The second message box shows what I am suppose to get. Here is a screen shot of the first message box and then the second. In the parent list view I have the first item selected. In the child list view I also have the first item selected. Look at the outcomes. The child list view is reading what is in the parent list view. And if you select others in the child list view, it reads not what it is suppose to. I hope this clears up my problem.http://starky.dnsalias.net/msgbox1.jpghttp://starky.dnsalias.net/msgbox2.jpg Edited October 6, 2005 by Starky Link to comment Share on other sites More sharing options...
jpm Posted October 7, 2005 Share Posted October 7, 2005 In the first message box, the data selected in the child list view ($ChildList) is not correct data shown with GUICtrlRead(GUICtrlRead($ChildList)).. The second message box shows what I am suppose to get. Here is a screen shot of the first message box and then the second. In the parent list view I have the first item selected. In the child list view I also have the first item selected. Look at the outcomes. The child list view is reading what is in the parent list view. And if you select others in the child list view, it reads not what it is suppose to. I hope this clears up my problem.http://starky.dnsalias.net/msgbox1.jpghttp://starky.dnsalias.net/msgbox2.jpgI was hard to find out that the problem has been corrected in the beta. Your problem occurs with the Official release it has been fix with the March 10 beta Link to comment Share on other sites More sharing options...
Starky Posted October 7, 2005 Author Share Posted October 7, 2005 Ahh awesome. When will it be released or is it available to the public now? Link to comment Share on other sites More sharing options...
jpm Posted October 7, 2005 Share Posted October 7, 2005 Ahh awesome. When will it be released or is it available to the public now?The Beta is stable. For the official release I cannot answer, JON is the only one which decide. Link to comment Share on other sites More sharing options...
Starky Posted October 7, 2005 Author Share Posted October 7, 2005 I will leave the second list out for now. Thanks for all your help, jpm. Link to comment Share on other sites More sharing options...
seandisanti Posted October 7, 2005 Share Posted October 7, 2005 I will leave the second list out for now. Thanks for all your help, jpm.why not just switch to the beta? the beta is stable (and any bugs that ARE found are very quickly fixed), and offers alot of functionality that was/is not available in the "stable" release. then you could have your solution exactly the way that you want it, rather than having to re-work it waiting on an official release. Link to comment Share on other sites More sharing options...
Starky Posted October 8, 2005 Author Share Posted October 8, 2005 I never really liked getting beta programs all too much, but I suppose I could give it a look. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now