tehsage Posted August 23, 2006 Share Posted August 23, 2006 Yeah, I'm pretty oblivious. I'm having a little trouble with my program right now. Currently, I'm working on a basic text editor. I'm not exactly sure it's all possibly, but I'm trying anyway. =/ Anyway, this is what I have.#include <GUIConstants.au3>$MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"GUICreate("Text Editor V1.0") ; will create a dialog box that when displayed is centered$newdoc=GUICtrlCreateEdit ("", 5,5,390,390,$ES_AUTOVSCROLL+$WS_VSCROLL)$filemenu = GUICtrlCreateMenu ("&File")$fileitem = GUICtrlCreateMenuitem ("&Open",$filemenu)$saveitem = GUICtrlCreateMenuitem ("&Save",$filemenu)$exititem = GUICtrlCreateMenuitem ("&Exit",$filemenu)GUISetState ()GUICtrlSetData (1,$newdoc,1)While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $exititem Then ExitLoop If $msg = $saveitem Then $var = FileSaveDialog( "Choose a name.", $MyDocsFolder, "Text files (*.txt)", 3, "*.txt") $file = FileOpen($var, 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $newdoc) FileClose($file)EndIf If $msg = $fileitem Then $var = FileOpenDialog("Choose a file", $MyDocsFolder, "Text files (*.txt)", 1 + 4, "*.txt") $file = FileOpen($var, 0) $newdoc = $file EndIfWendI'm not sure how to get the FileOpenDialog and FileSaveDialog to work with the GUI Edit. Any suggestions? ^_-; Link to comment Share on other sites More sharing options...
Zedna Posted August 23, 2006 Share Posted August 23, 2006 Yeah, I'm pretty oblivious. I'm having a little trouble with my program right now. Currently, I'm working on a basic text editor. I'm not exactly sure it's all possibly, but I'm trying anyway. =/ Anyway, this is what I have. I'm not sure how to get the FileOpenDialog and FileSaveDialog to work with the GUI Edit. Any suggestions? ^_-; $text = FileRead($file) GUICtrlSetData ($newdoc, $text)oÝ÷ Ù«¢+ØÀÌØíÑáÐôU% ÑɱI ÀÌØí¹Ý½¤)¥±]É¥Ñ ÀÌØí¥±°ÀÌØíÑáФ Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
tehsage Posted August 23, 2006 Author Share Posted August 23, 2006 $text = FileRead($file) GUICtrlSetData ($newdoc, $text)oÝ÷ Ù«¢+ØÀÌØíÑáÐôU% ÑɱI ÀÌØí¹Ý½¤)¥±]É¥Ñ ÀÌØí¥±°ÀÌØíÑáФSaving works now, but whenever I attempt to open a file, I get this error. ERROR: FileRead() [built-in]called with wrong number of args. $text = FileRead($file) Link to comment Share on other sites More sharing options...
Zedna Posted August 23, 2006 Share Posted August 23, 2006 (edited) Saving works now, but whenever I attempt to open a file, I get this error.You are using old version 3.1.1 or old beta version.Instal latest beta (133) or better new release version 3.2.0.1 Edited August 23, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
tehsage Posted August 23, 2006 Author Share Posted August 23, 2006 You are using old version 3.1.1 or old beta version.Instal latest beta (133) or better new release version 3.2.0.1! It works now. Many thanks. 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