View script | License | Download script | History | Other scripts by: notchent |
1-May 23:01 UTC
[0.034] 12.1k
[0.034] 12.1k
Archive version of: rebgui-editor.r ... version: 3 ... 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/ backup: does [ write rejoin [ %./edit_history/ last split-path filename "_" now/date "_" replace/all form now/time ":" "-" ] x/text ] ctx-rebgui/on-fkey/f5: does [ backup write filename x/text launch filename ] 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 " [ write %./edit-history/print-file.html rejoin [ {<}{pre}{>} x/text {<}{pre}{>} ] browse %./edit-history/print-file.html ] " Quit " [ backup if true = question "Really Close?" [quit] ] ] "Options" [ " Appearance " [request-ui] ] "Help" [ " Shortcut Keys " [ alert trim/lines { 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 |