-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathexample.m
executable file
·67 lines (61 loc) · 2.26 KB
/
example.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! xbigforth
\ automatic generated code
\ do not edit
also editor also minos also forth
component class calc
public:
infotextfield ptr a#
infotextfield ptr b#
infotextfield ptr r#
( [varstart] ) ( [varend] )
how:
: params DF[ 0 ]DF X" No Title" ;
class;
component class thermometer
public:
canvas ptr temp
vscaler ptr pos
( [varstart] ) ( [varend] )
how:
: params DF[ 0 ]DF X" No Title" ;
class;
thermometer implements
( [methodstart] ) ( [methodend] )
: widget ( [dumpstart] )
CV[ outer with pos get endwith >r - >r
4 r@ 2+ steps 1 r> 1+ home!
path 0 r@ to 2 0 to 0 r> negate to fill ]CV ( MINOS ) ^^ CK[ 2drop 2drop ]CK ( MINOS ) $20 $1 *hfilll $C8 $1 *vfilll canvas new ^^bind temp
#1 habox new #-2 borderbox
^^ #0 #99 SC[ drop temp draw ]SC ( MINOS ) vscaler new ^^bind pos
$10 $1 *hfil $1 $2 *vfill glue new
^^ S[ close ]S ( MINOS ) TT" Close application" X" OK " button new
$10 $1 *hfil $1 $1 *vfill glue new
^^ S[ calc open ]S ( MINOS ) TT" Open calculator window" X" Calc" button new
$10 $1 *hfil $1 $2 *vfill glue new
#5 vabox new
#3 habox new #1 hskips
( [dumpend] ) ;
class;
calc implements
( [methodstart] ) ( [methodend] )
: widget ( [dumpstart] )
#12341234. ]N ( MINOS ) ^^ SN[ ]SN ( MINOS ) X" A:" infotextfield new ^^bind a#
#1234. ]N ( MINOS ) ^^ SN[ ]SN ( MINOS ) X" B:" infotextfield new ^^bind b#
^^ S[ a# get b# get d+ r# assign ]S ( MINOS ) X" +" button new
^^ S[ a# get b# get d- r# assign ]S ( MINOS ) X" -" button new
^^ S[ a# get b# get d* r# assign ]S ( MINOS ) X" *" button new
^^ S[ a# get b# get drop ud/mod r# assign drop ]S ( MINOS ) X" /" button new
^^ S[ a# get 1. b# get drop 0 ?DO 2over d* LOOP r# assign 2drop ]S ( MINOS ) X" ^" button new
^^ S[ r# get a# assign ]S ( MINOS ) X" >A" button new
^^ S[ r# get b# assign ]S ( MINOS ) X" >B" button new
#7 hatbox new #1 hskips
#0. ]N ( MINOS ) ^^ SN[ ]SN ( MINOS ) X" R:" infotextfield new ^^bind r#
#4 vabox new panel
( [dumpend] ) ;
class;
: main
thermometer open-app
calc open-app
event-loop bye ;
script? [IF] main [THEN]
previous previous previous