malu05 Posted March 6, 2008 Share Posted March 6, 2008 Is there a easy way to get the sliders from GUIctrlcreateList to follow (go downwards) when new data is added like CMD? [center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center] Link to comment Share on other sites More sharing options...
smashly Posted March 6, 2008 Share Posted March 6, 2008 (edited) When you add an item just set focus to the new item..#include <GUIListBox.au3> $GUI = GUICreate(":-)", 200, 300) $List = GUICtrlCreateList("", 2, 2, 196, 266) For $i = 1 To 100 GUICtrlSetData(-1, StringFormat("%03d", $i) & ": List Item") Next $Input = GUICtrlCreateInput("101: New List Item", 2, 273, 126, 20, $ES_READONLY) $Button = GUICtrlCreateButton("Add Item", 133, 273, 63, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $Button Local $Cnt = _GUICtrlListBox_GetCount($List) GUICtrlSetData($List, GUICtrlRead($Input)) GUICtrlSetData($Input, StringFormat("%03d", $Cnt + 2) & ": New List Item") _GUICtrlListBox_SetCurSel($List, $Cnt) _GUICtrlListBox_SetCurSel($List, -1) EndSwitch WEnd Cheers Edited March 6, 2008 by smashly Link to comment Share on other sites More sharing options...
malu05 Posted March 6, 2008 Author Share Posted March 6, 2008 (edited) When you add an item just set focus to the new item..#include <GUIListBox.au3> $GUI = GUICreate(":-)", 200, 300) $List = GUICtrlCreateList("", 2, 2, 196, 266) For $i = 1 To 100 GUICtrlSetData(-1, StringFormat("%03d", $i) & ": List Item") Next $Input = GUICtrlCreateInput("101: New List Item", 2, 273, 126, 20, $ES_READONLY) $Button = GUICtrlCreateButton("Add Item", 133, 273, 63, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $Button Local $Cnt = _GUICtrlListBox_GetCount($List) GUICtrlSetData($List, GUICtrlRead($Input)) GUICtrlSetData($Input, StringFormat("%03d", $Cnt + 2) & ": New List Item") _GUICtrlListBox_SetCurSel($List, $Cnt) _GUICtrlListBox_SetCurSel($List, -1) EndSwitch WEnd Cheers Collers.. thanks Is it possible to add the same value 2 times? Im making a "console" and need to be able to add the same data multiple times. Like here; My _report function splits up the data input if it is too long but as you can see this is not unique (no ID and No Time) so if the same text comes up again, then it won't print. Edited March 6, 2008 by malu05 [center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center] Link to comment Share on other sites More sharing options...
smashly Posted March 6, 2008 Share Posted March 6, 2008 (edited) Hi, yep you can#include <GUIListBox.au3> $GUI = GUICreate(":-)", 200, 300) $List = GUICtrlCreateList("", 2, 2, 196, 266) For $i = 1 To 100 GUICtrlSetData(-1, "List Item|") Next $Input = GUICtrlCreateInput("New List Item", 2, 273, 126, 20, $ES_READONLY) $Button = GUICtrlCreateButton("Add Item", 133, 273, 63, 20) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $Button GUICtrlSetData($List, GUICtrlRead($Input) & "|") _GUICtrlListBox_SetCurSel($List, _GUICtrlListBox_GetCount($List)-1) _GUICtrlListBox_SetCurSel($List, -1) EndSwitch WEnd Cheers Edited March 6, 2008 by smashly Link to comment Share on other sites More sharing options...
malu05 Posted March 6, 2008 Author Share Posted March 6, 2008 Thanks. Works perfectly. [center][u]WoW Machinima Tool[/u] (Tool for Machinima Artists) [/center] 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