View script | License | Download script | History | Other scripts by: notchent |
1-May 22:49 UTC
[0.043] 11.403k
[0.043] 11.403k
Archive version of: rebgui-editor.r ... version: 2 ... notchent 18-Apr-2010REBOL [ title: "RebGUI Editor" date: 18-Apr-2010 file: %rebgui-editor.r author: Nick Antonaccio purpose: { A minimal text editor program, written to demonstrate menus and a few other basic features of RebGUI. Taken from the tutorial at http://re-bol.com } ] do load-thru http://re-bol.com/rebgui.r ; Build#117 filename: %temp.txt make-dir %./edit_history/ ctx-rebgui/on-fkey/f5: does [write filename x/text launch filename] backup: does [ write rejoin [ %./edit_history/ last split-path filename "_" now/date "_" replace/all form now/time ":" "-" ] x/text ] display/maximize/close "RebGUI Editor" [ tight menu #LW data [ "File" [ " New " [backup if true = question "Erase Current Text?" [filename: %temp.txt set-text x copy ""]] " Open " [backup filetemp: to-file request-file/file filename if filetemp = %none [return] set-text x read filename: filetemp] " Save " [backup write filename x/text] " Save As " [backup filetemp: to-file request-file/save/file filename if filetemp = %none [return] write filename: filetemp x/text] " Save and Run " [backup write filename x/text launch filename] " Print " [browse rejoin ["<pre>" x/text "<pre>"]] " Quit " [backup if true = question "Really Close?" [quit]] ] "Options" [ " Appearance " [request-ui] ] "Help" [ " Shortcut Keys " [alert "F5: Save and Run^/Ctrl+Z: Undo^/Ctrl+Y: Redo^/Esc: Undo All^/Ctrl+S: Spellcheck"] ] ] return x: area #LHW ] [backup question "Really Close?"] do-events |