AlanR Posted June 20, 2006 Share Posted June 20, 2006 (edited) Hi All I'm new to the forum and have been using AutoIt for almost a full day now! The (hopefully) attached code shows how I'm trying to simulate smooth-scrolling text. (Forget about the messy way I read in a text file - I've since found FileReadLine() and StringSplit() ) This method works in principle - quite well in fact if the label occupies the full window height. But what I'm trying to do is confine the scrolling area by using other controls. I've tried constraining the label in a Group frame (no joy) and (in this case) "blocking things off" with another empty label that I'm trying to maintain as opaque to the text. I'd appreciate any better techniques that anyone might know of. thanks, and glad to be invited in Alan #include <GuiConstants.au3> $file = FileOpen("C:\test.txt", 0) $text = "" ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 line at a time until the EOF is reached for $i = 1 to 120 $line = FileReadLine($file) If @error = -1 Then ExitLoop $text = $text & $line & @LF Next $len = StringLen($text) $GUI_Handle = GuiCreate("MyGUI", 400, 400,(@DesktopWidth-400)/2, (@DesktopHeight-400)/2) $Label_1 = GuiCtrlCreateLabel($text, 90, 110, 2300, 1700) $Label_2 = GuiCtrlCreateLabel("", 0, 0, 1700, 109) GuiSetState() ; Simulate smooth scrolling by slowly repositioning $Label_1 While 1 For $i = 0 to $len GUICtrlSetPos($Label_1, 9, 110 - $i) GUICtrlSetPos($Label_2, 0, 0) Sleep(100) Next WEnd FileClose($file) Edited June 20, 2006 by AlanR Link to comment Share on other sites More sharing options...
GaryFrost Posted June 20, 2006 Share Posted June 20, 2006 think you might want to look at http://www.autoitscript.com/forum/index.ph...opic=14409&st=0 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
AlanR Posted June 20, 2006 Author Share Posted June 20, 2006 think you might want to look at http://www.autoitscript.com/forum/index.ph...opic=14409&st=0Thanks for the ultraquick reply. I have downloaded text_effects_1.9.3.zip from your files area, but I'm guessing I'll need to install a newer beta of AutoIt - I'm running v3.1.1 at the moment.Alan 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