-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram.rkt
45 lines (33 loc) · 1.23 KB
/
program.rkt
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
#lang racket
(require "building-blocks-field.rkt")
(require "building-ground.rkt")
(provide program%)
(require "component.rkt")
; +----------+------------ +
; | Building | Definitions |
; | blocks +-------------+
; | | Expression |
; +----------+-------------+
(define program%
(class component%
(field (building-blocks (new building-blocks-field%))
(definitions-ground (new building-ground%))
(interaction-ground (new building-ground%)))
(define/public (mouse-move-to x y)
"")
(define/public (mouse-left-down)
"")
(define/public (mouse-left-up)
"")
(define/override (set-size! width height)
(super set-size! width height)
(send building-blocks set-size! (* width 1/4) height)
(send definitions-ground set-size! (* width 3/4) (* height 1/2))
(send interaction-ground set-size! (* width 3/4) (* height 1/2))
(send definitions-ground set-x! (* width 1/4))
(send interaction-ground set-position! (* width 1/4) (* height 1/2)))
(define/override (draw dc)
(send building-blocks draw dc )
(send definitions-ground draw dc)
(send interaction-ground draw dc))
(super-new [color "green"])))