Changeset main,87 for main/form.lisp


Ignore:
Timestamp:
02/23/2008 12:27:43 AM (18 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
tui
revision id:
dsowen@fugue88.ws-20080223002743-09u28trz6kvjtdpo
Message:
  • Integrate checkboxes into forms.
  • Fixed checkbox display glitches.
  • Added keystrokes to checkbox.
  • Fixed package symbols.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/form.lisp

    r80 r87  
    4141   (precision :initarg :precision)
    4242   (inactive-background :initarg :inactive-background)
     43   (active-background :initarg :active-background)))
     44
     45(defclass checkbox-def (value-widget-def)
     46  ((inactive-background :initarg :inactive-background)
    4347   (active-background :initarg :active-background)))
    4448
     
    8387                  :active-background (list ,@active-background)))
    8488
     89(defun make-checkbox-def (row column name &key read-only
     90                          (inactive-background
     91                           *default-inactive-widget-background*)
     92                          (active-background
     93                           *default-active-widget-background*))
     94  `(make-instance 'checkbox-def
     95                  :row ,row :column ,column :name ,name :read-only ,read-only
     96                  :inactive-background (list ,@inactive-background)
     97                  :active-background (list ,@active-background)))
     98
    8599(defun parse-widget-form (widget-form)
    86100  (destructuring-bind (type &rest args) widget-form
     
    88102             (:label 'make-label-def)
    89103             (:textbox 'make-textbox-def)
    90              (:numberbox 'make-numberbox-def))
     104             (:numberbox 'make-numberbox-def)
     105             (:checkbox 'make-checkbox-def))
    91106           args)))
    92107
     
    97112* (:label row column text)
    98113* (:textbox row column name display-width &key data-width read-only)
    99 * (:numberbox row column name display-width &key data-width precision read-only)"
     114* (:numberbox row column name display-width &key data-width precision read-only)
     115* (:checkbox row column name)"
    100116  (destructuring-bind (&key ((:inactive-widget-background *default-inactive-widget-background*) '(#\Nul 0))
    101117                            ((:active-widget-background *default-active-widget-background*) '(#\Nul 0)))
     
    146162                            :validator validator
    147163                            :inactive-background inactive-background
    148                             :active-background active-background))))))
     164                            :active-background active-background)))))
     165  (:method ((cbd checkbox-def) form)
     166    (with-slots (row column name inactive-background active-background) cbd
     167      (with-slots (data window scroll) form
     168        (let ((r (make-reflector data name)))
     169          (create-widget 'db-checkbox window (- row scroll) column
     170                         :data r
     171                         :inactive-background inactive-background
     172                         :active-background active-background))))))
    149173
    150174
Note: See TracChangeset for help on using the changeset viewer.