LiveOnTheFly Posted March 27, 2009 Share Posted March 27, 2009 (edited) 1. Is there anyway to not have the whole font of the Edit change when Ii change the font? 2. When I update my edit using guisetdata() It's flickering(lots of guisetdata one every 53 ms) here my code: expandcollapse popup#include <GUIConstants.au3> ;~ #include <EditConstants.au3> #include <guiedit.au3> #include <ScrollBarConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 447, 193, 125) $Edit1 = GUICtrlCreateEdit("", 0, 0, 633, 447,0x0080+0x0040+0x0004+0x0800) ;~ GUICtrlSetState($Edit1,$GUI_DISABLE) GUICtrlSetColor($Edit1,0xFFFFFF) GUICtrlSetBkColor($Edit1,0x000000) GUICtrlSetData(-1, "Edit1") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ###) $mission = "mission1";hardcoded for now untill everything is done. Mission selector will we added last $mission = FileRead($mission & ".txt") $mission = StringSplit($mission,@crlf,1) dim $oldtxt ConsoleWrite(@crlf) $n = 1 $max = $mission[0] while 1 $toparse = $mission[$n] ConsoleWrite($toparse) $toparse = StringSplit($toparse,"|") if $toparse[0] > 0 then if $toparse[1] = "Say" Then Say($toparse[2]) ElseIf $toparse[1] = "Sayncrlf" Then Sayncrlf($toparse[2]) elseif $toparse[1] = "Sayi" Then Sayi($toparse[2]) elseif $toparse[1] = "Sayincrlf" Then Sayincrlf($toparse[2]) EndIf EndIf $n+= 1 if $n > $max Then MsgBox(0,"","Mission Complete!") Exit;make this go back to mission select and do various save game things EndIf _GUICtrlEdit_Scroll($Edit1,$SB_SCROLLCARET) WEnd func say($txt = "") for $i = 1 to StringLen($txt) $oldtxt&= StringMid($txt,$i,1) GUICtrlSetData($Edit1,$oldtxt) sleep(53) Next $oldtxt &= @crlf GUICtrlSetData($Edit1,$oldtxt) EndFunc func sayncrlf($txt = "") for $i = 1 to StringLen($txt) $oldtxt&= StringMid($txt,$i,1) GUICtrlSetData($Edit1,$oldtxt) sleep(53) Next ;~ $oldtxt &= @crlf GUICtrlSetData($Edit1,$oldtxt) EndFunc func sayi($txt = "") GUICtrlSetFont($Edit1,Default,400,2) for $i = 1 to StringLen($txt) $oldtxt&= StringMid($txt,$i,1) GUICtrlSetData($Edit1,$oldtxt) sleep(53) Next GUICtrlSetFont($Edit1,Default,400,0) $oldtxt &= @crlf GUICtrlSetData($Edit1,$oldtxt) EndFunc func sayincrlf($txt = "") GUICtrlSetFont($Edit1,"8.5",400,2) for $i = 1 to StringLen($txt) $oldtxt&= StringMid($txt,$i,1) GUICtrlSetData($Edit1,$oldtxt) sleep(53) Next GUICtrlSetFont($Edit1,"8.5",400,0) $oldtxt &= @crlf GUICtrlSetData($Edit1,$oldtxt) EndFunc and here is mission1.txt Say|December 15, 1966 Say| Say|You've just setup both of your computers' connections to this new internet thing. Sayncrlf|Yay! It's time to finally learn how to use this thing! Sayi|You get out the instruction Sayincrlf|manual to the internet and flip to page 122. Say|It says to type in "telnet 192.168.1.122" Say|into the console to connect to your other computer Edited March 27, 2009 by LiveOnTheFly Link to comment Share on other sites More sharing options...
BrettF Posted March 27, 2009 Share Posted March 27, 2009 Try with a richedit? The flickering will happen when you updated it... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 27, 2009 Share Posted March 27, 2009 1. richedit 2. There is usually less flickering with the Control* funcs, try those (ControlSetText??). Or update it less often, that would surely decrease the flickering. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
LiveOnTheFly Posted March 27, 2009 Author Share Posted March 27, 2009 Thanks for suggesting the richedit guys. There's no flickering with it either! 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