Changeset main,48


Ignore:
Timestamp:
11/13/2007 04:31:46 PM (19 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui
revision id:
dsowen@fugue88.ws-20071113163146-2c9661gfdiyqnwbf
Message:

Modified colormap.
Fixed flat-menu to work with other new code.

Location:
main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/flat-menu.lisp

    r39 r48  
    11(defpackage #:flat-menu
    2   (:use #:cl #:cffi)
     2  (:use #:cl #:cffi #:dso-util #:tui-input #:tui-output #:tui-window)
    33  (:export #:*shortcut-style* #:*highlight-style* #:menu #:selected
    44           #:make-menu))
     
    2626    (multiple-value-bind (s1 s2 s3) (break-text text shortcut-pos)
    2727      (when highlight
    28         (cdk::c-wattron window *highlight-style*))
    29       (cdk::move-and-add-string window row column s1)
    30       (cdk::c-wattron window *shortcut-style*)
    31       (cdk::move-and-add-string window row (incf column (length s1)) s2)
    32       (cdk::c-wattroff window *shortcut-style*)
    33       (cdk::move-and-add-string window row (incf column (length s2)) s3)
     28        (cdk::c-wattron (window-pointer window) *highlight-style*))
     29      (move-and-add-string window row column s1)
     30      (cdk::c-wattron (window-pointer window) *shortcut-style*)
     31      (move-and-add-string window row (incf column (length s1)) s2)
     32      (cdk::c-wattroff (window-pointer window) *shortcut-style*)
     33      (move-and-add-string window row (incf column (length s2)) s3)
    3434      (when highlight
    35         (cdk::c-wattroff window *highlight-style*)))))
     35        (cdk::c-wattroff (window-pointer window) *highlight-style*)))))
    3636
    3737
     
    8989    (with-accessors ((selected selected)) menu
    9090      (loop
    91          (cdk::c-refresh-window window)
    92          (let ((ch (cdk::c-wgetch window)))
    93            (cond
    94              ((= ch 258)
     91         (refresh window)
     92         (let ((ch (read-key window)))
     93           (case ch
     94             (:key-down
    9595              (incf selected))
    96              ((= ch 259)
     96             (:key-up
    9797              (decf selected))
    9898             (t (return))))))))
    9999
    100100(defun test ()
    101   (let ((screen (cdk::c-init-curses-screen)))
     101  (with-screen (screen)
    102102    (cdk::c-cbreak)
    103103    (cdk::c-noecho)
    104104    (cdk::c-nonl)
    105     (cdk::c-keypad screen t)
    106     (cdk::c-erase-window screen)
     105    (cdk::c-keypad (window-pointer screen) t)
     106    (erase screen)
    107107    (let ((menu (make-menu screen 5 10 '(("Hello, world!" 7) ("Goodbye, galaxy!" 9)))))
    108       (activate-menu menu))
    109     (cdk::c-end-curses)))
     108      (activate-menu menu))))
  • main/window/screen.lisp

    r41 r48  
    3636            (dotimes (i 63)
    3737              (let ((j (1+ i)))
    38                 (init-pair j (floor j 8) (mod j 8))))
     38                (init-pair j (mod j 8) (floor j 8))))
    3939            (let ((,screen (make-instance 'screen-window :ptr ,ptr)))
    4040              ,@body)
Note: See TracChangeset for help on using the changeset viewer.