X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/d0301620ac9aa7d8170ba628df493c1ff1e1d2fa..e9c163726f466dee83a8dbe7d952f6aaff4345b6:/src/ucw-test-component.lisp?ds=sidebyside diff --git a/src/ucw-test-component.lisp b/src/ucw-test-component.lisp index b5e3e73..477375e 100644 --- a/src/ucw-test-component.lisp +++ b/src/ucw-test-component.lisp @@ -1,16 +1,32 @@ (in-package :lisp-on-lines) -;;;; LoL CLOS Test Class -(defclass/meta test-class () - ((test-string :initform "test string" :type string)) +;;;; LoL CLOS Tests +;;;; +(defclass lol-test-class () + ((test-slot-value :initform "slot-value") + (test-string :initform "Test String")) (:documentation "foo")) -(define-attributes (test-class) - (test-string t :label "String :" :editablep t)) +(defvar *foo* nil) + +(defvar *standard-layers* '(viewer editor creator one-line as-string)) + +(define-attributes (lol-test-class) + (test-getter t + :label "Getter" + :getter (constantly "Hello World")) + (test-getter/setter t + :label "Getter/Setter:" + :getter (lambda () + *foo*) + :setter #'(lambda (value) + (setf *foo* value))) + (test-slot-value t) + (test-string string :label "String" :documentation)) (defcomponent test-component () - ((display-types :accessor display-types :initform (list 'viewer 'editor 'creator 'one-line 'as-string)) - (current-type :accessor current-type :initform 'viewer) + (current-layer :accessor current-type :initform 'viewer) + (layer-spec :accessor layer-spec :initform nil) (instance :accessor instance :initform (make-instance 'test-class)))) (defmethod render ((self test-component)) @@ -19,22 +35,13 @@ (with-component (self) (