drscheme/dracula-drscheme-frame.ss
#lang scheme/gui

(require drscheme/tool
         framework
         "dracula-interfaces.ss"
         "executable-path.ss")

(provide dracula-drscheme-frame^
         dracula-drscheme-frame@)

(define-signature dracula-drscheme-frame^
  (dracula-drscheme-frame-mixin))

(define-unit dracula-drscheme-frame@
  (import drscheme:tool^ dracula-interfaces^)
  (export dracula-drscheme-frame^)

  (define dracula-drscheme-frame-mixin
    (mixin (drscheme:unit:frame<%>) (dracula-drscheme-frame<%>)
      (inherit get-current-tab)

      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;
      ;;  METHODS
      ;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      (define/override (get-definitions/interactions-panel-parent)
        (let* ([top (super get-definitions/interactions-panel-parent)]
               [mid (new panel:horizontal-dragable% [parent top])]
               [bot (new vertical-panel% [parent mid])])
          (set! dracula-gui-container mid)
          (queue-callback
           (lambda ()
             (send (get-current-tab) update-dracula-gui))
           #f)
          bot))

      (define/augment (on-tab-change old-tab new-tab)
        (queue-callback
         (lambda ()
           (send new-tab update-dracula-gui))
         #f)
        (inner (void) on-tab-change old-tab new-tab))

      (define/public (get-dracula-gui-container)
        (unless (is-a? dracula-gui-container area-container<%>)
          (error 'get-dracula-gui-container
                 "~s is not an area container" dracula-gui-container))
        dracula-gui-container)

      
      
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;
      ;;  INITIALIZATION
      ;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

      (define dracula-gui-container #f)

      (super-new)

      (inherit get-language-menu)
      (let ([super-menu (get-language-menu)])
        (new separator-menu-item% [parent super-menu])
        (new menu-item%
             [label "Save ACL2 Output As..."]
             [parent super-menu]
             [callback (lambda _ (send (get-current-tab) save-output))])
        (new menu-item%
             [label "Change Executable Path..."]
             [parent super-menu]
             [callback
              (lambda _ (prompt-and-set-executable-path))]))

      )))