added fake data tape inspector

This commit is contained in:
Claudio Maggioni 2018-12-10 18:17:46 +01:00
parent b8676240a6
commit f2dc3259c8

39
gui.rkt
View file

@ -160,6 +160,43 @@
(define m-file (new menu% [label "File"] [parent MB])) (define m-file (new menu% [label "File"] [parent MB]))
(define m-edit (new menu% [label "Edit"] [parent MB])) (define m-edit (new menu% [label "Edit"] [parent MB]))
; The tape panel
(define tape-panel
(new horizontal-panel%
[parent F]
[min-height 50]
[style (list 'auto-hscroll)]
[stretchable-height #f]))
; make-cell: Number String Boolean -> Canvas
(define (make-cell index content hl)
(new canvas%
[parent tape-panel]
[min-height 50]
[min-width 50]
[stretchable-height #f]
[label (string-append (number->string index) ":")]
[paint-callback
(lambda (c dc)
(send c set-canvas-background (if hl end-col run-col))
(send dc draw-text (send c get-label) 12.5 5)
(send dc draw-text content 12.5 25))]))
(make-cell 0 "000" #f)
(make-cell 1 "255" #t)
(make-cell 2 "100" #f)
(make-cell 300000000 "100" #f)
(make-cell 4 "100" #f)
(make-cell 5 "100" #f)
(make-cell 6 "100" #f)
(make-cell 7 "100" #f)
(make-cell 8 "100" #f)
(make-cell 9 "100" #f)
(make-cell 10 "100" #f)
(make-cell 11 "100" #f)
(make-cell 12 "100" #f)
(make-cell 13 "100" #f)
; The input horizontal panel ; The input horizontal panel
(define input-panel (define input-panel
(new horizontal-panel% (new horizontal-panel%
@ -174,7 +211,7 @@
; The input done callback (defaults to nothing) ; The input done callback (defaults to nothing)
; Type: (Button Event) -> _ ; Type: (Button Event) -> _
(define input-done-cb (lambda (ev) (void))) (define input-done-cb (lambda (btn ev) (void)))
; Definition of the run button widget ; Definition of the run button widget
(define INPUT-DONE-BTN (new button% (define INPUT-DONE-BTN (new button%