Refactoring.
This commit is contained in:
parent
6af2e49db3
commit
fceb3db69c
|
@ -34,7 +34,7 @@
|
|||
,(match-lambda [(sub-report-entry s m 'mzc) #t]
|
||||
[_ #f]))))
|
||||
|
||||
(define-local-member-name get-coach-menu-item)
|
||||
(define-local-member-name get-optimization-coach-menu-item)
|
||||
|
||||
(define optimization-coach-drracket-button
|
||||
(list
|
||||
|
@ -207,11 +207,12 @@
|
|||
(mixin (drracket:unit:frame<%>) ()
|
||||
(inherit set-show-menu-sort-key get-current-tab)
|
||||
|
||||
(define/public (get-coach-menu-item) coach-menu-item)
|
||||
(define/public (get-optimization-coach-menu-item)
|
||||
optimization-coach-menu-item)
|
||||
|
||||
(define/override (add-show-menu-items show-menu)
|
||||
(super add-show-menu-items show-menu)
|
||||
(set! coach-menu-item
|
||||
(set! optimization-coach-menu-item
|
||||
(new menu-item%
|
||||
[label (string-constant show-optimization-coach)]
|
||||
[parent show-menu]
|
||||
|
@ -227,14 +228,14 @@
|
|||
(if (get-field panel tab)
|
||||
(send (send tab get-defs) clear-highlights)
|
||||
(optimization-coach-callback this)))]))
|
||||
(set-show-menu-sort-key coach-menu-item 403))
|
||||
(set-show-menu-sort-key optimization-coach-menu-item 403))
|
||||
|
||||
(define/augment (on-tab-change old-tab new-tab)
|
||||
(send old-tab hide-optimization-coach-panel #f) ; don't close it
|
||||
(when (get-field panel new-tab) ; if it was open before
|
||||
(send new-tab show-optimization-coach-panel)))
|
||||
|
||||
(define coach-menu-item #f)
|
||||
(define optimization-coach-menu-item #f)
|
||||
|
||||
(super-new)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user