diff options
author | colin <colin@cicadas.surf> | 2024-12-14 08:36:23 -0800 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-12-14 08:36:23 -0800 |
commit | 3a2217263d581be9a7f629b10d75aa8e3d581890 (patch) | |
tree | 23f5f0a5449a06473aba2ec7914a3c2193823a10 /gui/menus.lisp | |
parent | 03cdbb6a15e130a012377ab8d54074b6864e3480 (diff) | |
parent | 8a51ba81c7df6b0b6dab7cf4b35b5ca084b653ba (diff) |
Merge branch 'refactor-with-def'
Diffstat (limited to 'gui/menus.lisp')
-rw-r--r-- | gui/menus.lisp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gui/menus.lisp b/gui/menus.lisp index 25abd7b..a477dd9 100644 --- a/gui/menus.lisp +++ b/gui/menus.lisp @@ -2,12 +2,13 @@ (in-package :wheelwork) -(defclass/std menu (unit interactive) - ((items :with :std nil - :doc "A list of interactive units") - (focus :with :std nil - :doc "The item that is focused in this menu, if any.") - (region :std (error "Menus require an explicit region")))) +(def:class menu (unit interactive) + ((items "list of interactive units in the menu") + :prefix :type list :initform nil) + ((focus "Object of menu with current focus.") + :prefix :type (or null unit) :initform nil) + ((region "Region where menu is displayed.") + :required :type region)) (defmethod cleanup :after ((menu menu)) (loop for item in (menu-items menu) do (cleanup item))) @@ -85,10 +86,13 @@ (render o))) -(defclass/std vscroller (menu) - ((scroll-speed :std 1) - (vert-scroll :std 0 - :doc "Vertical distance items have been displaced."))) +(def:class vscroller (menu) + (scroll-speed :type fixnum :initform 1) + (vert-scroll + :type fixnum + :initform 0 + :documentation "Vertical distance items have been displaced.")) + (defmethod (setf vert-scroll) :after (val (vs vscroller)) (loop |