make double-clicking in the list box for the "Open Collection Path..."
menu item work
This commit is contained in:
parent
d9dae651fd
commit
0ae42ae401
|
@ -48,7 +48,12 @@
|
||||||
(define lb (new list-box%
|
(define lb (new list-box%
|
||||||
[style (if dir? '(extended) '(single))]
|
[style (if dir? '(extended) '(single))]
|
||||||
[parent dlg] [choices '()] [label #f]
|
[parent dlg] [choices '()] [label #f]
|
||||||
[callback (λ (lb evt) (update-buttons))]))
|
[callback (λ (lb evt)
|
||||||
|
(cond
|
||||||
|
[(equal? (send evt get-event-type) 'list-box-dclick)
|
||||||
|
(handle-list-box-double-click)]
|
||||||
|
[else
|
||||||
|
(update-buttons)]))]))
|
||||||
|
|
||||||
(define different-racket-panel
|
(define different-racket-panel
|
||||||
(new vertical-panel%
|
(new vertical-panel%
|
||||||
|
@ -212,7 +217,7 @@
|
||||||
[else
|
[else
|
||||||
(define item-to-act-on (get-item-to-act-on))
|
(define item-to-act-on (get-item-to-act-on))
|
||||||
(cond
|
(cond
|
||||||
[item-to-act-on
|
[item-to-act-on
|
||||||
(define datum (send lb get-data item-to-act-on))
|
(define datum (send lb get-data item-to-act-on))
|
||||||
(cond
|
(cond
|
||||||
[(path? datum)
|
[(path? datum)
|
||||||
|
@ -225,6 +230,23 @@
|
||||||
(send ok-button enable #f)
|
(send ok-button enable #f)
|
||||||
(send enter-sub-button enable #f)])]))
|
(send enter-sub-button enable #f)])]))
|
||||||
|
|
||||||
|
(define (handle-list-box-double-click)
|
||||||
|
(cond
|
||||||
|
[dir?
|
||||||
|
(ok)]
|
||||||
|
[else
|
||||||
|
(define item-to-act-on (get-item-to-act-on))
|
||||||
|
(cond
|
||||||
|
[item-to-act-on
|
||||||
|
(define datum (send lb get-data item-to-act-on))
|
||||||
|
(cond
|
||||||
|
[(path? datum)
|
||||||
|
(ok)]
|
||||||
|
[(string? datum)
|
||||||
|
(enter-sub)])]
|
||||||
|
[else
|
||||||
|
(void)])]))
|
||||||
|
|
||||||
(define (get-item-to-act-on)
|
(define (get-item-to-act-on)
|
||||||
(or (send lb get-selection)
|
(or (send lb get-selection)
|
||||||
(and (<= 1 (send lb get-number))
|
(and (<= 1 (send lb get-number))
|
||||||
|
@ -342,3 +364,7 @@
|
||||||
(preferences:set-default 'drracket:get-module-path-from-user-size
|
(preferences:set-default 'drracket:get-module-path-from-user-size
|
||||||
(list 600 600)
|
(list 600 600)
|
||||||
(list/c exact-nonnegative-integer? exact-nonnegative-integer?))
|
(list/c exact-nonnegative-integer? exact-nonnegative-integer?))
|
||||||
|
|
||||||
|
|
||||||
|
(module+ main
|
||||||
|
(get-module-path-from-user))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user