original commit: 1f325130969f85bffd6fc7a54ca8b3d8ec7f0491
This commit is contained in:
Robby Findler 2000-01-25 22:23:07 +00:00
parent faa5c32dc7
commit 7a772ba1d7
4 changed files with 47 additions and 23 deletions

View File

@ -257,13 +257,12 @@
[update-filename
(lambda (name)
(let ([filename (if name
(let-values ([(base name dir) (split-path (mzlib:file:normalize-path name))])
name)
(mzlib:file:file-name-from-path (mzlib:file:normalize-path name))
"")])
(for-each (lambda (canvas)
(let ([tlw (send canvas get-top-level-window)])
(when (is-a? tlw frame:editor<%>)
(send tlw set-label name))))
(send tlw set-label filename))))
(get-canvases))))])
(override
[after-save-file

View File

@ -139,7 +139,9 @@
file-filter s))
(cons s rest)]
[else rest])))))
(if (eq? (system-type) 'unix) string<? string-ci<?)))
;(if (eq? (system-type) 'unix) string<? string-ci<?)
string-ci<?
))
(send name-list set-selection-and-edit 0)
(set! last-selected -1)))))]
@ -327,7 +329,9 @@
(super-init (if save-mode? "Put file" "Get file")
parent-win
default-width
default-height))
default-height
#f #f
'(resize-border)))
(private
@ -374,12 +378,33 @@
; look for letter at beginning of a filename
[(char? code)
(let loop ([pos (add1 curr-pos)])
(unless (>= pos num-items)
(let ([first-char (string-ref (get-string pos) 0)])
(if (char=? code first-char)
(set-selection-and-edit pos)
(loop (add1 pos))))))]
(let ([next-matching
(let loop ([pos (add1 curr-pos)])
(cond
[(>= pos num-items) #f]
[else
(let ([first-char (string-ref (get-string pos) 0)])
(if (char-ci=? code first-char)
pos
(loop (add1 pos))))]))])
(if next-matching
(set-selection-and-edit next-matching)
;; didn't find anything forward; start again at front of list
(let loop ([pos 0]
[last-before 0])
(cond
[(<= pos num-items)
(let ([first-char (string-ref (get-string pos) 0)])
(cond
[(char-ci=? code first-char)
(set-selection-and-edit pos)]
[(char-ci<=? first-char code)
(loop (+ pos 1)
pos)]
[else
(set-selection-and-edit last-before)]))]
[else (set-selection-and-edit last-before)]))))]
; movement keys
[(and (eq? code 'up)

View File

@ -14,7 +14,8 @@
[pasteboard : framework:pasteboard^]
[editor : framework:editor^]
[canvas : framework:canvas^]
[mzlib:function : mzlib:function^])
[mzlib:function : mzlib:function^]
[mzlib:file : mzlib:file^])
(rename [-editor<%> editor<%>]
[-pasteboard% pasteboard%]
@ -177,9 +178,7 @@
(send (get-editor) on-close))])
(private
[label (if file-name
(let-values ([(base name dir?) (split-path file-name)])
(or name
file-name))
(mzlib:file:file-name-from-path file-name)
(gui-utils:next-untitled-name))]
[label-prefix (application:current-app-name)]
[do-label
@ -317,12 +316,13 @@
(format "Welcome to ~a" (application:current-app-name))))]
[help-menu:about-string (lambda () (application:current-app-name))])
(sequence (apply super-init
(get-entire-label)
parent
width
height
args))
(sequence
(apply super-init
(get-entire-label)
parent
width
height
args))
(public
[get-canvas (let ([c #f])

View File

@ -920,8 +920,8 @@
(map-meta "c:b" "backward-sexp")
(map-meta "s:c:b" "select-backward-sexp")
(map-meta "c:u" "up-sexp")
(map-meta "c:d" "down-sexp")
;(map-meta "c:u" "up-sexp")
;(map-meta "c:d" "down-sexp")
(map-meta "c:p" "flash-backward-sexp")
(map-meta "s:c:n" "flash-forward-sexp")