kiboost Posted October 15, 2010 Share Posted October 15, 2010 (edited) Hi, I'm trying to open a window with some text, and can't find how to put a simple label with vertical scrollbar inside my script, I create another window : $logGUI = GUICreate("RFR full log", 400, 500, 1000, 60) $LabelLog = GUICtrlCreateEdit ($file, 10, 10, 380, 300) GUISetState(@SW_SHOW) I tried GUICreate("RFR full log", 400, 500, 1000, 60, $WS_VSCROLL) but then the scroll doesn't work at all. I tried puting $WS_VSCROLL on the label, same thing When I do a GUICtrlCreateEdit, it has working scrollbars ! (but I don't want text to be edtiable) Also, I can't find how to close the second window. Hitting the system red cross call the good function but doesn't close the windows I've tried : GUISetOnEvent($GUI_EVENT_CLOSE, "LogGUIClose", $logGUI) Func LogGUIClose() WinClose("RFR full log") EndFunc Doesn't do anything. putting an "exit" in the function indeed exit the script itself (both windows then). So the function work, but how to close this second window ? Any help would be appreciated Kib I've searched on the forum, seems there is some UDF for that but seems rather complex for just a bunch of text with a scroll bar. Edited October 15, 2010 by kiboost Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 15, 2010 Moderators Share Posted October 15, 2010 kiboost,If you use the Scrollbars and StringSize UDFs in my sig, you can do it easily: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <GUIScrollBars_Ex.au3> #include <StringSize.au3> $sText = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." $aText_Info = _StringSize($sText, Default, Default, Default, "", 90) $hGUI = GUICreate("Test", 500, 500) GUISetState() $hScroller = GUICreate("Scroller", 100, 200, 10, 10, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $hGUI) $hLabel = GUICtrlCreateLabel($aText_Info[0], 0, 0, 183, $aText_Info[3]) GUISetState() _GUIScrollbars_Generate ($hScroller, 0, $aText_Info[3]) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
kiboost Posted October 15, 2010 Author Share Posted October 15, 2010 (edited) Ok, thanks, got it to work like this : Func showlog() $logfile = "\RFRlog.txt" $file = FileRead($logfile, FileGetSize($logfile)) FileClose($logfile) $aText_Info = _StringSize($file, Default, Default, Default, "", 380) $logGUI = GUICreate("RFR full log", 400, 500, 1000, 60) GUISetOnEvent($GUI_EVENT_CLOSE, "LogGUIClose", $logGUI) $hLabel = GUICtrlCreateLabel($file, 0, 0, 380, $aText_Info[3]) GUISetState() _GUIScrollbars_Generate ($logGUI, 0, $aText_Info[3]) EndFunc Func LogGUIClose() WinClose($logGUI EndFunc But still can't close this popup ! pressing red cross (top right from windows) doesn't do anything ! It works on the main window, not on the second one. Edited October 15, 2010 by kiboost Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 15, 2010 Moderators Share Posted October 15, 2010 kiboost,As you created the GUI, try using GUIDelete rather than WinClose - and make sure $logGUI has Global scope. If that does not work, please post the whole code. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
kiboost Posted October 15, 2010 Author Share Posted October 15, 2010 Melba, let me tell you, you are a bit irritating !! GUIDelete indeed works perfectly ! I would need a permanent mental connection with you, seems you are autoit god :-)) Many thanks, once again ! Kib Win7 pro x64. scripts compiled to x64. - Autoit v3.3.6.1 | Scite 1.79 Link to comment Share on other sites More sharing options...
Ourumov94 Posted May 23, 2018 Share Posted May 23, 2018 Hi Melba, thanks a lot for your precious help, Best regards 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