lokatylokacz Posted November 26, 2018 Share Posted November 26, 2018 Hello! How to create something like GUI script log. I made GUICtrlCreateEdit (read only) and I wanna add there new msg depending on that was is going on with the script. My problem is that if I use GUICtrlSetData it cleans msg that was there b4 so I can just see last change in log. How to deal with it ? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 27, 2018 Moderators Share Posted November 27, 2018 @lokatylokacz there are several ways to do it (as with most things in AutoIt). In essence, you need to read in what text is in the edit control and add that to your GUICtrlSetData. Something like this perhaps: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $hGUI = GUICreate("Test", 300, 300) Local $hEdit = GUICtrlCreateEdit("", 10, 10, 280, 200) Local $btnGo = GUICtrlCreateButton("Go", 250, 250, 40, 40) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btnGo GUICtrlSetData($hEdit, @TAB & "========Initializing Program========" & @CRLF) For $a = 1 To 10 GUICtrlSetData($hEdit, GUICtrlRead($hEdit) & "===Executing Line " & $a & " of Program===" & @CRLF) Next GUICtrlSetData($hEdit, GUICtrlRead($hEdit) & @TAB & "========Program Complete========") EndSwitch WEnd "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 27, 2018 Share Posted November 27, 2018 @JLogan3o13 Couldn't he just use the default parameter of GUICtrlSetData() set as non-empty value to append data to the Edit control instead of reading and concatenating each time the new data? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
lokatylokacz Posted November 27, 2018 Author Share Posted November 27, 2018 @FrancescoDiMuro Can you show me how it should look pls ? Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 27, 2018 Share Posted November 27, 2018 @lokatylokacz GUICtrlSetData($youreditcontrol, "Line 1" & @CRLF, -1) GUICtrlSetData($youreditcontrol, "Line 2" & @CRLF, -1) lokatylokacz 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
lokatylokacz Posted November 27, 2018 Author Share Posted November 27, 2018 (edited) @JLogan3o13 Thx for the answer.@FrancescoDiMuro This is what I was looking for I think. "-1" ... why I can't read F1 help like I should... THX again Yep This is it Thx! Edited November 27, 2018 by lokatylokacz Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 27, 2018 Share Posted November 27, 2018 @lokatylokacz Happy to have helped Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 27, 2018 Moderators Share Posted November 27, 2018 (edited) @FrancescoDiMuro you are 100% correct, I made something of a Rube Goldberg machine there Edited November 27, 2018 by JLogan3o13 FrancescoDiMuro 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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