Refactoring.
This commit is contained in:
parent
f50d64b3b2
commit
8bceeadaab
|
@ -200,15 +200,9 @@
|
|||
|
||||
;; control panel
|
||||
(define panel #f)
|
||||
(define/public (show-optimization-coach)
|
||||
(define area-container (get-area-container))
|
||||
(define definitions (get-definitions-text))
|
||||
(define filters (send definitions get-filters))
|
||||
(cond [panel
|
||||
(send area-container add-child panel)]
|
||||
[else
|
||||
(define (create-panel)
|
||||
(set! panel (new horizontal-panel%
|
||||
[parent area-container]
|
||||
[parent (get-area-container)]
|
||||
[stretchable-height #f]))
|
||||
(new button%
|
||||
[label "Clear"]
|
||||
|
@ -227,8 +221,13 @@
|
|||
(cons f filters)))
|
||||
;; redraw
|
||||
(send definitions add-highlights))]
|
||||
[value (memq f filters)]))])
|
||||
[value #f]))) ; will be updated in `show-optimization-coach'
|
||||
|
||||
(define/public (show-optimization-coach)
|
||||
(cond [panel (send (get-area-container) add-child panel)]
|
||||
[else (create-panel)])
|
||||
;; update check-boxes
|
||||
(define filters (send (get-definitions-text) get-filters))
|
||||
(for ([c (in-list (for/list ([c (in-list (send panel get-children))]
|
||||
#:when (is-a? c check-box%))
|
||||
c))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user