jvanegmond Posted June 15, 2006 Share Posted June 15, 2006 (edited) Very useful for creating those multiline messageboxes! #include <GUIConstants.au3> ; == GUI generated with Koda == GUICreate("Convert Au3/Txt", 519, 379, 192, 125) $Box = GUICtrlCreateEdit("", 0, 0, 433, 373, -1,$WS_EX_CLIENTEDGE) $ConvertTxt = GUICtrlCreateButton("Convert" & @LF & "Txt > Au3", 440, 0, 75, 73,$BS_MULTILINE) $ConvertAu3 = GUICtrlCreateButton("Convert" & @LF & "Au3 > Txt", 440, 80, 75, 73,$BS_MULTILINE) $Option = GUICtrlCreateCheckbox("Single-Line", 440, 160, 75, 73) $Exit = GUICtrlCreateButton("Exit", 440, 348, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case ($msg = $GUI_EVENT_CLOSE) OR ($msg = $Exit) Exit Case $msg = $ConvertTxt If GUICtrlRead($Option) = $GUI_CHECKED Then GUICtrlSetData($Box, '"' & StringReplace(GUICtrlRead($Box),@CRLF, '" & @CRLF & "') & '"') Else GUICtrlSetData($Box, '"' & StringReplace(GUICtrlRead($Box),@CRLF, '" & @CRLF & _' & @CRLF & '"') & '"') EndIf Case $msg = $ConvertAu3 If GUICtrlRead($Option) = $GUI_CHECKED Then GUICtrlSetData($Box, StringTrimRight(StringTrimLeft(StringReplace(GUICtrlRead($Box),'" & @CRLF & "', @CRLF ),1),1)) Else GUICtrlSetData($Box, StringTrimRight(StringTrimLeft(StringReplace(GUICtrlRead($Box),'" & @CRLF & _' & @CRLF & '"', @CRLF ),1),1)) EndIf EndSelect WEnd [Edit] Now with multi-line/Single-line option! Thanks goes to heibel for the idea ( Groeten terug ! ) Edited June 15, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 15, 2006 Moderators Share Posted June 15, 2006 Ha, I'd never thought of simplifing it before, nice one, I'm sure it will come in handy. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
heibel Posted June 15, 2006 Share Posted June 15, 2006 Hi, maybe an extra option to make the text>au3 results in one single line? groetjes! Link to comment Share on other sites More sharing options...
jvanegmond Posted June 15, 2006 Author Share Posted June 15, 2006 Great idea, heibel! I just implemented this new feature. Just tick the checkbox for a single-line conversion! github.com/jvanegmond Link to comment Share on other sites More sharing options...
heibel Posted June 15, 2006 Share Posted June 15, 2006 Great idea, heibel! I just implemented this new feature.Just tick the checkbox for a single-line conversion!Okay, works!Last (?)request: some restore or save button (in clipboard) to be able to get the 'original text' back again...Thanks anyway. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 15, 2006 Moderators Share Posted June 15, 2006 (edited) Okay, works!Last (?)request: some restore or save button (in clipboard) to be able to get the 'original text' back again...Thanks anyway. Why not just use the au3 to text to get it back?Edit:Oops, you said clipboard, I totally missed that Edited June 15, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
heibel Posted June 15, 2006 Share Posted June 15, 2006 Why not just use the au3 to text to get it back?Ah, your are right, that works.Must say:missed it since the poor brains was expecting some undo-botton. (just worked on something else and therefore....)Greatings (groeten) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 15, 2006 Moderators Share Posted June 15, 2006 Here, since I made the mistake:#include <GUIConstants.au3> ; == GUI generated with Koda == GUICreate("Convert Au3/Txt", 519, 379, 192, 125) $Box = GUICtrlCreateEdit("", 0, 0, 433, 373, -1,$WS_EX_CLIENTEDGE) $ConvertTxt = GUICtrlCreateButton("Convert" & @LF & "Txt > Au3", 440, 0, 75, 73,$BS_MULTILINE) $ConvertAu3 = GUICtrlCreateButton("Convert" & @LF & "Au3 > Txt", 440, 80, 75, 73,$BS_MULTILINE) $CopyToClip = GUICtrlCreateButton('Copy' & @LF & 'Clipboard', 440, 160, 75, 73, $BS_MULTILINE) $Option = GUICtrlCreateCheckbox("Single-Line", 440, 240, 75, 73) $Exit = GUICtrlCreateButton("Exit", 440, 348, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case ($msg = $GUI_EVENT_CLOSE) OR ($msg = $Exit) Exit Case $msg = $ConvertTxt If GUICtrlRead($Option) = $GUI_CHECKED Then GUICtrlSetData($Box, '"' & StringReplace(GUICtrlRead($Box),@CRLF, '" & @CRLF & "') & '"') Else GUICtrlSetData($Box, '"' & StringReplace(GUICtrlRead($Box),@CRLF, '" & @CRLF & _' & @CRLF & '"') & '"') EndIf Case $msg = $ConvertAu3 If GUICtrlRead($Option) = $GUI_CHECKED Then GUICtrlSetData($Box, StringTrimRight(StringTrimLeft(StringReplace(GUICtrlRead($Box),'" & @CRLF & "', @CRLF ),1),1)) Else GUICtrlSetData($Box, StringTrimRight(StringTrimLeft(StringReplace(GUICtrlRead($Box),'" & @CRLF & _' & @CRLF & '"', @CRLF ),1),1)) EndIf Case $msg = $CopyToClip ClipPut(GUICtrlRead($Box)) EndSelect WEnd Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
heibel Posted June 15, 2006 Share Posted June 15, 2006 (edited) Okay, perhaps even better to: - before first action: copy to clipoard as the save - one button with restore (from clipboard) ? or at least: - the copy to clipboard (as now) - also the paste from clipboard... HTH (hopes this helpes) Edited June 15, 2006 by heibel Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 15, 2006 Moderators Share Posted June 15, 2006 Okay, perhaps even better to:- before first action: copy to clipoard as the save- one button with restore (from clipboard)?or at least:- the copy to clipboard (as now)- also the paste from clipboard...HTH (hopes this helpes)Your right mouse button broke? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted June 15, 2006 Share Posted June 15, 2006 (edited) why not just use codewizard? (comes with the SciTE)you can also get it here Edited June 15, 2006 by gafrost 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...
heibel Posted June 15, 2006 Share Posted June 15, 2006 why not just use codewizard? (comes with the SciTE)you can also get it hereAh, since we Dutch drink too much and always forget about all those possability's....hihi Link to comment Share on other sites More sharing options...
jvanegmond Posted June 15, 2006 Author Share Posted June 15, 2006 (edited) Ah, since we Dutch drink too much and always forget about all those possability's.... hihi I can't help myself, i just heard i graduated high school and with the european soccer championship and all.. [edit] Oranje !! Edited June 15, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
heibel Posted June 15, 2006 Share Posted June 15, 2006 I can't help myself, i just heard i graduated high school and with the european soccer championship and all.. [edit] Oranje !! Link to comment Share on other sites More sharing options...
RazerM Posted June 15, 2006 Share Posted June 15, 2006 Never would have thought of this. Good for long strings. My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop. Link to comment Share on other sites More sharing options...
slightly_abnormal Posted June 15, 2006 Share Posted June 15, 2006 this is useful.. Link to comment Share on other sites More sharing options...
erifash Posted June 15, 2006 Share Posted June 15, 2006 (edited) I made something kind of similar a while ago. It takes text that is copied to the clipboard and converts it into hexadecimal then formats it into a string usable by AutoIt. Here's the code: Local $c="46756E63205F556E4865782820247348657820290D0A094C6F63616C20246153706C6974203D20537472696E6753706C 69742824734865782C202222292C202473526574203D2027272C2024690D0A09466F72202469203D203120746F2024615370 6C69745B305D207374657020320D0A0909247352657420263D204368722844656328246153706C69745B24695D2026202461 53706C69745B2469202B20315D29290D0A094E6578740D0A0952657475726E2024735265740D0A456E6446756E63" ClipPut('Local $c=""' & @CRLF & '$c&="' & _StringChunk(_Hex(ClipGet()), 512, '"' & @CRLF & '$c&="') & '"' & @CRLF & '$c=_UnHex($c)' & @CRLF & @CRLF & _UnHex($c)) Func _Hex( $sStr ) Local $aSplit = StringSplit($sStr, ""), $sRet = '', $i For $i = 1 to $aSplit[0] $sRet &= Hex(Asc($aSplit[$i]), 2) Next Return $sRet EndFunc Func _UnHex( $sHex ) Local $aSplit = StringSplit($sHex, ""), $sRet = '', $i For $i = 1 to $aSplit[0] step 2 $sRet &= Chr(Dec($aSplit[$i] & $aSplit[$i + 1])) Next Return $sRet EndFunc Func _StringChunk( $sStr, $iChrs, $sSep = @CRLF ) Local $iLen = StringLen($sStr), $iMod = Mod($iLen, $iChrs), $iChrLeft = $iLen - $iMod, $sNew = "" For $i = 0 to $iChrLeft / $iChrs - 1 $sNew = $sNew & StringTrimLeft(StringTrimRight($sStr, $iLen - ( $i * $iChrs + $iChrs )), ( $i * $iChrs )) & $sSep Next Return $sNew & StringRight($sStr, $iMod) EndFunc Edited June 15, 2006 by erifash My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver 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