Autoseek

How to make text GUI with scroll bar for progress logging?

4 posts in this topic

#1 ·  Posted

Hi everyone,

I assume that this has already been solved, but my search for "GUI log(ging) window" did not return useful results. So, if available, a simple pointer to an exisiting solution is perfectly fine.

I am an "old school" guy of progress logging, i.e., I am using tons of "ConsoleWrite" statements to indicate the current state, e.g., "Copying ABC to DEF...". Obviously, when I run the executable stand-alone, the output goes nowhere. Therefore, I would like to create a text GUI with scroll bar into which I can fire off the strings that are now contained in the "ConsoleWrite" statements. Perhaps worded differently, I would like to have the functionality of the SciTE-editor in a GUI, without having to put major efforts into just programming this functionality. I assume I am not the first one who needs this :D

Thank you for any suggestions.

Cheers

Autoseek

Share this post


Link to post
Share on other sites



#2 ·  Posted

You can use

$hLog = _GUICtrlEdit_Create($mainGui,'',8, 5, 467, 314, BitOR($WS_HSCROLL, $WS_VSCROLL,  $ES_MULTILINE, $ES_WANTRETURN, $ES_READONLY))

as Control showing the loglines and

Func _report($sMsg, $hLog = 0, $iDebug = 0)
    ;===============================================================================
    ; Autor(s):         AutoBert (www.autoit.de)
    ;
    ; modified:         durch/Grund hier anfügen
    ;===============================================================================
    If $hLog <> 0 Then _GUICtrlEdit_AppendText($hLog, $sMsg & @CRLF)
    If $iDebug Then ConsoleWrite($sMsg & @CRLF)
    ;If $G__hFileLog > 0 Then _FileWriteLog($G__hFileLog, $sMsg & @CRLF)
EndFunc   ;==>_report

to append a line.

1 person likes this

Share this post


Link to post
Share on other sites

#3 ·  Posted

Thank you so much. That's exactly what I was looking for. Already implemented, running like a champ B)

Cheers

Autoseek

Share this post


Link to post
Share on other sites

#4 ·  Posted

Glad i could help :)

Share this post


Link to post
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