'notepad clone
nomainwin
WindowWidth = 550
WindowHeight = 410
menu #main, "&File","&Open",[open],"&Save",[save],|,_
"&Print",[print],|,"E&xit",[quit]
menu #main, "Edit"
menu #main, "F&ont","&Courier New Large",[courier],"Courier &New Medium",[couriermedium],_
"Courier New &Small",[couriersmall],|,"&Arial Large",[arial],"Arial Medi&um",_
[arialmedium],"Arial S&mall",[arialsmall]
texteditor #main.te, 6, 36, 532, 322
bmpbutton #main.new, "bmp\newbttn.bmp", [new], UL, 6, 6
bmpbutton #main.open, "bmp\OPEN.BMP", [open], UL, 30, 6
bmpbutton #main.save, "bmp\SAVE.BMP", [save], UL, 54, 6
bmpbutton #main.print, "bmp\PRINT.BMP", [print], UL, 86, 6
bmpbutton #main.cut, "bmp\CUT.BMP", [cut], UL, 126, 6
bmpbutton #main.copy, "bmp\COPY.BMP", [copy], UL, 150, 6
bmpbutton #main.paste, "bmp\PASTE.BMP", [paste], UL, 174, 6
button #main.quit, "X", [quit], UL, 206, 6, 25, 25
open "Just a Notepad" for window as #main
#main "trapclose [quit]"
#main.te "!autoresize"
#main.quit "!font arial 18 bold"
[main.inputLoop] 'wait here for input event
wait
[new] 'Perform action for the bmpbutton named 'new'
#main.te "!cls"
wait
[open] 'Perform action for the bmpbutton named 'open'
filedialog "Open","*.txt",file$
if file$="" then wait
#main.te "!cls"
open file$ for input as #f
#main.te "!contents #f"
close #f
wait
[save] 'Perform action for the bmpbutton named 'save'
filedialog "Save","*.txt",file$
if file$="" then wait
if lower$(left$(file$,4))<>".txt" then file$=file$+".txt"
#main.te "!contents? string$"
open file$ for output as #f
print #f, string$
close #f
wait
[print] 'Perform action for the bmpbutton named 'print'
#main.te "!contents? string$"
lprint string$
dump
wait
[cut] 'Perform action for the bmpbutton named 'cut'
#main.te "!cut"
wait
[copy] 'Perform action for the bmpbutton named 'copy'
#main.te "!copy"
wait
[paste] 'Perform action for the bmpbutton named 'paste'
#main.te "!paste"
wait
[quit] 'Perform action for the bmpbutton named 'quit'
close #main : end
wait
[courier]
#main.te "!font courier_new 12"
wait
[couriermedium]
#main.te "!font courier_new 10"
wait
[couriersmall]
#main.te "!font courier_new 8"
wait
[arial]
#main.te "!font arial 12"
wait
[arialmedium]
#main.te "!font arial 10"
wait
[arialsmall]
#main.te "!font arial 8"
wait
|