3ggerhappy Posted July 16, 2010 Share Posted July 16, 2010 Hi Guys I need some ideas how to create my own console in my gui. where in i can print messages like a visual log. Im thinking of using a list view for the logging but i dont know how to append messages in itso that it reatins prevoiusly written message. hope you got what i mean thanks Link to comment Share on other sites More sharing options...
taietel Posted July 16, 2010 Share Posted July 16, 2010 (edited) 3ggerhappy, take this as a start: expandcollapse popup#include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinApi.au3> Global $hGUI = GUICreate("GUI Log", 320, 320) WinSetTrans($hGUI,"",200) Global $Edit = GUICtrlCreateEdit("", 10, 10, 300, 300, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL), 0) ;set the initial data GUICtrlSetData(-1, "########################################" & @CRLF & _ "#" & @TAB & @TAB & " Operation so far:" & @TAB & @TAB & " #" & _ @CRLF & "########################################" & @CRLF) GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) ;put your variable (optional) e.g. _Logging($var) For $i = 1 To 30 _Logging(@TAB & "#> " & "This is line no." & $i) Next ;set the finish message (optional) _Logging( @CRLF & @CRLF & "########################################" & @CRLF & _ "#" & @TAB & @TAB & " No errors found!" & @TAB & @TAB & " #" & _ @CRLF & "########################################" & @CRLF) _Logging("Bye!") Sleep(3000) Exit While 1 Sleep(10) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Logging($text) _GUICtrlEdit_AppendText($Edit,$text & @CRLF) Sleep(150) EndFunc Edited July 17, 2010 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
3ggerhappy Posted July 17, 2010 Author Share Posted July 17, 2010 Wow thank you very for this i tried the code in my script and it wotked. ill just need a little tweaking thanks much taitel Link to comment Share on other sites More sharing options...
taietel Posted July 17, 2010 Share Posted July 17, 2010 You're welcome! Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
3ggerhappy Posted July 17, 2010 Author Share Posted July 17, 2010 Hi Im getting an error in the _Logging Function _GUICtrlEdit_AppendText($Edit,$text & @CRLF) undefined function Link to comment Share on other sites More sharing options...
GEOSoft Posted July 17, 2010 Share Posted July 17, 2010 Did you remember to #include<GuiEdit.au3> at the top of the script? George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
3ggerhappy Posted July 17, 2010 Author Share Posted July 17, 2010 uh forgot about that. thanks taitel and geosoft 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