added keyboard shortcuts for the first 9 tabs to the windows menu (on the mac)
svn: r18245
This commit is contained in:
parent
5ad04e3b2c
commit
95debe6353
|
@ -561,6 +561,17 @@
|
||||||
(let ([frame (find-frame item)])
|
(let ([frame (find-frame item)])
|
||||||
(when frame
|
(when frame
|
||||||
(send frame next-tab))))])
|
(send frame next-tab))))])
|
||||||
|
(let ([frame (find-frame windows-menu)])
|
||||||
|
(unless (= 1 (send frame get-tab-count))
|
||||||
|
(for ([i (in-range 0 (send frame get-tab-count))]
|
||||||
|
#:when (< i 9))
|
||||||
|
(new menu-item%
|
||||||
|
[parent windows-menu]
|
||||||
|
[label (format "Tab ~a: ~a" (+ i 1) (send frame get-tab-filename i))]
|
||||||
|
[shortcut (integer->char (+ (char->integer #\1) i))]
|
||||||
|
[callback
|
||||||
|
(λ (a b)
|
||||||
|
(send frame change-to-nth-tab i))]))))
|
||||||
(new separator-menu-item% [parent windows-menu]))))
|
(new separator-menu-item% [parent windows-menu]))))
|
||||||
|
|
||||||
;; Check for any files lost last time.
|
;; Check for any files lost last time.
|
||||||
|
|
|
@ -2080,6 +2080,9 @@ module browser threading seems wrong.
|
||||||
(unless (equal? label (send tabs-panel get-item-label (send tab get-i)))
|
(unless (equal? label (send tabs-panel get-item-label (send tab get-i)))
|
||||||
(send tabs-panel set-item-label (send tab get-i) label))))
|
(send tabs-panel set-item-label (send tab get-i) label))))
|
||||||
|
|
||||||
|
(define/public (get-tab-filename i)
|
||||||
|
(get-defs-tab-filename (send (list-ref tabs i) get-defs)))
|
||||||
|
|
||||||
(define/private (get-defs-tab-label defs tab)
|
(define/private (get-defs-tab-label defs tab)
|
||||||
(let ([fn (send defs get-filename)]
|
(let ([fn (send defs get-filename)]
|
||||||
[i-prefix (or (for/or ([i (in-list tabs)]
|
[i-prefix (or (for/or ([i (in-list tabs)]
|
||||||
|
@ -2090,11 +2093,13 @@ module browser threading seems wrong.
|
||||||
"")])
|
"")])
|
||||||
(string-append
|
(string-append
|
||||||
i-prefix
|
i-prefix
|
||||||
(add-modified-flag
|
(get-defs-tab-filename defs))))
|
||||||
defs
|
|
||||||
(if fn
|
(define/private (get-defs-tab-filename defs)
|
||||||
(get-tab-label-from-filename fn)
|
(let ([fn (send defs get-filename)])
|
||||||
(send defs get-filename/untitled-name))))))
|
(if fn
|
||||||
|
(get-tab-label-from-filename fn)
|
||||||
|
(send defs get-filename/untitled-name))))
|
||||||
|
|
||||||
(define/private (get-tab-label-from-filename fn)
|
(define/private (get-tab-label-from-filename fn)
|
||||||
(let* ([take-n
|
(let* ([take-n
|
||||||
|
|
|
@ -574,7 +574,16 @@ Shows the interactions window
|
||||||
Returns the currently active tab.
|
Returns the currently active tab.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@defmethod[(get-tab-filename [i (<=/c 0 (#,(method drscheme:unit:frame% get-tab-count)))]) string?]{
|
||||||
|
Returns a string naming the file in the @scheme[i]th tab or, if
|
||||||
|
the file is not saved, something like ``Untitled''.
|
||||||
|
}
|
||||||
|
|
||||||
|
@defmethod[(get-tab-count) exact-positive-integer?]{
|
||||||
|
Returns the number of open tabs in the frame.
|
||||||
|
}
|
||||||
|
|
||||||
@defmethod[(open-in-new-tab [filename (or/c path-string? #f)]) void?]{
|
@defmethod[(open-in-new-tab [filename (or/c path-string? #f)]) void?]{
|
||||||
Opens a new tab in this frame. If @scheme[filename] is a @scheme[path-string?],
|
Opens a new tab in this frame. If @scheme[filename] is a @scheme[path-string?],
|
||||||
It loads that file in the definitions window of the new tab.
|
It loads that file in the definitions window of the new tab.
|
||||||
|
|
|
@ -730,6 +730,7 @@ please adhere to these guidelines:
|
||||||
(most-recent-window "Most Recent Window")
|
(most-recent-window "Most Recent Window")
|
||||||
(next-tab "Next Tab")
|
(next-tab "Next Tab")
|
||||||
(prev-tab "Previous Tab")
|
(prev-tab "Previous Tab")
|
||||||
|
(tab-i "Tab ~a") ;; menu item in the windows menu under mac os x. ~a is filled with a number between 1 and 9.
|
||||||
|
|
||||||
(view-menu-label "&View")
|
(view-menu-label "&View")
|
||||||
(show-overview "Show &Program Contour")
|
(show-overview "Show &Program Contour")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user