(module proof-frame mzscheme
(require (lib "unit.ss")
(lib "class.ss")
(lib "mred.ss" "mred")
(lib "tool.ss" "drscheme")
(lib "bitmap-label.ss" "mrlib")
(lib "etc.ss")
"proof-signatures.scm"
(planet "class-utils.ss" ("cce" "class-utils.plt" 1 1)))
(provide proof-frame@)
(define-unit proof-frame@
(import drscheme:tool^ proof-interfaces^)
(export proof-frame^)
(define proof-frame-mixin
(mixin (drscheme:unit:frame<%>) (proof-frame<%>)
(inherit get-current-tab)
(define parent-panel #f)
(define proof-panel #f)
(define drscheme-panel #f)
(define/override (get-definitions/interactions-panel-parent)
(define top-panel
(super get-definitions/interactions-panel-parent))
(set! parent-panel (new vertical-panel% [parent top-panel]))
(set! proof-panel
(new horizontal-panel%
[parent parent-panel]
[stretchable-height #f]
[alignment '(center center)]
[style '(border)]))
(set! drscheme-panel (new vertical-panel% [parent parent-panel]))
drscheme-panel)
(super-new)
(define start-button
(new button%
[parent proof-panel]
[label "Start"]
[callback (lambda _ (send (get-current-tab) proof-start))]))
(define stop-button
(new button%
[parent proof-panel]
[label "Stop"]
[callback (lambda _ (send (get-current-tab) proof-stop))]))
(define/public (proof-show visible?)
(send parent-panel
change-children
(lambda (cs)
(if visible?
(list proof-panel drscheme-panel)
(list drscheme-panel)))))
(define/public (proof-enable-start enabled?)
(when start-button (send start-button enable enabled?)))
(define/public (proof-enable-stop enabled?)
(when stop-button (send stop-button enable enabled?)))
(define/augment (on-tab-change old-tab new-tab)
(inner (void) on-tab-change old-tab new-tab)
(send new-tab proof-update))
(send (get-current-tab) proof-update)
))
)
)