Try to get result window size stuff right

part of darcs patch Sun Sep 18 14:32:07 EEST 2005  Eric Knauel <knauel@informatik.uni-tuebingen.de>
This commit is contained in:
eknauel 2005-09-27 08:59:55 +00:00
parent a4ee4822df
commit 93ee18ce47
6 changed files with 37 additions and 7 deletions

View File

@ -164,7 +164,8 @@
(select-list (select-list
(make-file-select-list (make-file-select-list
fs-objects working-dir fs-objects working-dir
(- (result-buffer-num-lines buffer) 2) ;; we need one line for the header
(- (result-buffer-num-lines buffer) 1)
(result-buffer-num-cols buffer)))) (result-buffer-num-cols buffer))))
(define (handle-return-key self selected-entry num-lines) (define (handle-return-key self selected-entry num-lines)

View File

@ -70,7 +70,7 @@
(make-unmarked-element (make-unmarked-element
job #t (format-job job num-cols))) job #t (format-job job num-cols)))
jobs) jobs)
(- (result-buffer-num-lines buffer) 1)))) (- (result-buffer-num-lines buffer) 2))))
(define get-selection-as-ref (define get-selection-as-ref
(make-get-selection-as-ref-method select-list)) (make-get-selection-as-ref-method select-list))
@ -216,7 +216,7 @@
,@(if (job-with-console? job) ,@(if (job-with-console? job)
`((,console-viewer "<View Console>" "")) `((,console-viewer "<View Console>" ""))
'()))) '())))
(- (result-buffer-num-lines buffer) 1))) (- (result-buffer-num-lines buffer) 3)))
(define (handle-key-press self key control-x-pressed?) (define (handle-key-press self key control-x-pressed?)
(cond (cond

View File

@ -304,8 +304,8 @@
(make-job-with-console (make-job-with-console
s-expr proc pty-in pty-out s-expr proc pty-in pty-out
(make-terminal-buffer (make-terminal-buffer
(- (result-buffer-num-cols (result-buffer)) 1) (result-buffer-num-cols (result-buffer))
(- (result-buffer-num-lines (result-buffer)) 1)))))) (result-buffer-num-lines (result-buffer)))))))
;; for use in Scheme mode ;; for use in Scheme mode
(define-syntax run/console (define-syntax run/console

View File

@ -57,6 +57,7 @@
(select-list (select-list
(make-process-selection-list (make-process-selection-list
(result-buffer-num-cols buffer) (result-buffer-num-cols buffer)
;; we need one line for the header
(- (result-buffer-num-lines buffer) 1) (- (result-buffer-num-lines buffer) 1)
processes)) processes))
(header (make-header-line (result-buffer-num-cols buffer)))) (header (make-header-line (result-buffer-num-cols buffer))))

View File

@ -302,3 +302,25 @@
(completions-for cs (or (to-complete-prefix to-complete) "")))) (completions-for cs (or (to-complete-prefix to-complete) ""))))
just-run-in-foreground)) just-run-in-foreground))
(define (make-debug-plugin val buffer)
(lambda (message)
(case message
((paint)
(lambda (self win buffer have-focus?)
(let ((cols (+ 0 (result-buffer-num-cols buffer)))
(lines (+ 0 (result-buffer-num-lines buffer))))
(wmove win 0 0)
(waddstr win "A")
(wmove win 0 cols)
(waddstr win "B")
(wmove win lines cols)
(waddstr win "C")
(wmove win lines 0)
(waddstr win "D")
(wrefresh win))))
(else
(lambda (self . more)
self)))))
(register-plugin!
(make-view-plugin make-debug-plugin (lambda (v) (eq? v 'debug))))

View File

@ -86,23 +86,29 @@
(make-app-window 1 1 (make-app-window 1 1
(- (COLS) 2) 2 (- (COLS) 2) 2
#f)) #f))
(debug-message '*bar-1* *bar-1*)
(set! *active-command-window* (set! *active-command-window*
(make-app-window 1 (+ (round (/ (LINES) 3)) 2) (make-app-window 1 (+ (round (/ (LINES) 3)) 2)
(- (COLS) 2) 3 (- (COLS) 2) 3
#f)) #f))
(debug-message '*active-command-window* *active-command-window*)
(set! *command-frame-window* (set! *command-frame-window*
(make-app-window 1 2 (make-app-window 1 2
(- (COLS) 2) (- (app-window-y (active-command-window)) 2) (- (COLS) 2) (- (app-window-y (active-command-window)) 2)
#f)) #f))
(debug-message '*command-frame-window* *command-frame-window*)
(set! *command-window* (set! *command-window*
(make-inlying-app-window (command-frame-window))) (make-inlying-app-window (command-frame-window)))
(debug-message '*command-window* *command-window*)
(set! *result-frame-window* (set! *result-frame-window*
(make-app-window 1 (+ (app-window-y (active-command-window)) 3) (make-app-window 1 (+ (app-window-y (active-command-window)) 3)
(- (COLS) 2) (- (COLS) 2)
(- (- (LINES) 6) (app-window-height (command-frame-window))) (- (- (LINES) 6) (app-window-height (command-frame-window)))
#f)) #f))
(debug-message '*result-frame-window* *result-frame-window*)
(set! *result-window* (set! *result-window*
(make-inlying-app-window (result-frame-window))) (make-inlying-app-window (result-frame-window)))
(debug-message '*result-window* *result-window*)
(let ((all-windows (let ((all-windows
(list (bar-1) (active-command-window) (list (bar-1) (active-command-window)
@ -113,7 +119,7 @@
(set-result-buffer-num-lines! (set-result-buffer-num-lines!
*result-buffer* (- (app-window-height (result-window)) 2)) *result-buffer* (- (app-window-height (result-window)) 2))
(set-result-buffer-num-cols! (set-result-buffer-num-cols!
*result-buffer* (- (app-window-width (result-window)) 3)) *result-buffer* (- (app-window-width (result-window)) 1))
(for-each wclear (for-each wclear
(map app-window-curses-win all-windows)))) (map app-window-curses-win all-windows))))