add window `command-frame-window' which surrounds `command-window' and

holds the border.
This commit is contained in:
eknauel 2005-05-17 15:02:01 +00:00
parent b161acf8cf
commit 3669859bb9
1 changed files with 23 additions and 12 deletions

View File

@ -23,6 +23,7 @@
(define bar-1 #f)
(define bar-2 #f)
(define command-frame-window #f)
(define command-window #f)
(define result-window #f)
@ -43,7 +44,7 @@
;;state of the upper window (Command-Window)
(define command-buffer
(make-buffer '("Welcome to the scsh-ncurses-ui!" "")
2 2 2 2 2
2 2 2 1 1
0 0
#t 1))
@ -390,22 +391,30 @@
(make-app-window 1 (+ (round (/ (LINES) 3)) 2)
(- (COLS) 2) 3
#f))
(set! command-window
(set! command-frame-window
(make-app-window 1 2
(- (COLS) 2) (- (app-window-y bar-2) 2)
#f))
(set! command-window
(make-app-window (+ (app-window-x command-frame-window) 1)
(+ (app-window-y command-frame-window) 1)
(- (app-window-width command-frame-window) 2)
(- (app-window-height command-frame-window) 2)
#f))
(set! result-window
(make-app-window 1 (+ (app-window-y bar-2) 3)
(- (COLS) 2)
(- (- (LINES) 6) (app-window-height command-window))
(- (- (LINES) 6) (app-window-height command-frame-window))
#f))
(window-init-curses-win! bar-1)
(window-init-curses-win! bar-2)
(window-init-curses-win! command-frame-window)
(window-init-curses-win! command-window)
(window-init-curses-win! result-window)
(wclear (app-window-curses-win bar-1))
(wclear (app-window-curses-win bar-2))
(wclear (app-window-curses-win command-window))
(wclear (app-window-curses-win command-frame-window))
(wclear (app-window-curses-win result-window))
(clear))
@ -418,15 +427,17 @@
(print-active-command-win (app-window-curses-win bar-2)
(app-window-width bar-2)))
(define (paint-command-window)
(box (app-window-curses-win command-window)
(ascii->char 0) (ascii->char 0)))
(define (paint-command-frame-window)
(box (app-window-curses-win command-frame-window)
(ascii->char 0) (ascii->char 0))
(wrefresh (app-window-curses-win command-frame-window)))
(define (paint-command-window-contents)
(set-buffer-num-lines! command-buffer
(- (app-window-height command-window) 2))
(set-buffer-num-cols! command-buffer
(- (app-window-width command-window) 3))
(werase (app-window-curses-win command-window))
(set! command-buffer
(print-command-buffer (app-window-curses-win command-window)
command-buffer))
@ -445,7 +456,7 @@
(init-windows!)
(paint-bar-1)
(paint-bar-2)
(paint-command-window)
(paint-command-frame-window)
(paint-command-window-contents)
(paint-result-window)
(move-cursor command-buffer))