text-value works for elements and form elements

This commit is contained in:
David Botton 2022-02-17 21:52:00 -05:00
parent 03e75645f3
commit c8493d1053
3 changed files with 33 additions and 13 deletions

View file

@ -453,19 +453,24 @@ place-inside-bottom-of CLOG-OBJ."))
;; value ;;
;;;;;;;;;;;
(defgeneric value (clog-meter)
(:documentation "Get/Setf the value of the meter."))
(defmethod value ((obj clog-meter))
(property obj "value"))
(defgeneric set-value (clog-meter value)
(:documentation "Set value VALUE for CLOG-METER"))
(defmethod set-value ((obj clog-meter) value)
(setf (property obj "value") value))
(defsetf value set-value)
;;;;;;;;;;;;;;;;
;; text-value ;;
;;;;;;;;;;;;;;;;
(defmethod text-value ((obj clog-meter))
(property obj "value"))
(defmethod set-text-value ((obj clog-meter) value)
(setf (property obj "value") value))
(defsetf text-value set-text-value)
;;;;;;;;;;
;; high ;;
;;;;;;;;;;
@ -592,19 +597,24 @@ place-inside-bottom-of CLOG-OBJ."))
;; value ;;
;;;;;;;;;;;
(defgeneric value (clog-progress-bar)
(:documentation "Get/Setf the value of the progress-bar."))
(defmethod value ((obj clog-progress-bar))
(property obj "value"))
(defgeneric set-value (clog-progress-bar value)
(:documentation "Set value VALUE for CLOG-PROGRESS-BAR"))
(defmethod set-value ((obj clog-progress-bar) value)
(setf (property obj "value") value))
(defsetf value set-value)
;;;;;;;;;;;;;;;;
;; text-value ;;
;;;;;;;;;;;;;;;;
(defmethod text-value ((obj clog-progress-bar))
(property obj "value"))
(defmethod set-text-value ((obj clog-progress-bar) value)
(setf (property obj "value") value))
(defsetf text-value set-text-value)
;;;;;;;;;;;;;
;; maximum ;;
;;;;;;;;;;;;;

View file

@ -477,7 +477,8 @@ Normally index follows normal sequence of elements."))
(defgeneric text-value (clog-element)
(:documentation "Get/Setf the first text node of CLOG-ELEMENT.
Unlike TEXT this is only the text associated with this <tag>."))
Unlike TEXT this is only the text associated with this <tag>
Additionally for forms get/setf the value."))
(defmethod text-value ((obj clog-element))
(jquery-query obj (format nil "contents().not(~A.children()).text()" (jquery obj))))

View file

@ -428,6 +428,15 @@ have this set true ever. Autofocus on element when form loaded."))
(setf (property obj "value") value))
(defsetf value set-value)
;; overloading of text-value to equal value on forms
(defmethod text-value ((obj clog-form-element))
(property obj "value"))
(defmethod set-text-value ((obj clog-form-element) value)
(setf (property obj "value") value))
(defsetf text-value set-text-value)
;;;;;;;;;;;;;;;;;
;; radio-value ;;
;;;;;;;;;;;;;;;;;