add-supported-controls and control-info

This commit is contained in:
David Botton 2022-06-16 18:01:23 -04:00
parent bfc164c5ea
commit edb1c94233
3 changed files with 18 additions and 6 deletions

View file

@ -15,7 +15,11 @@
(defpackage #:clog-tools (defpackage #:clog-tools
(:use #:cl #:clog #:clog-gui #:clog-web) (:use #:cl #:clog #:clog-gui #:clog-web)
(:export :clog-builder :clog-db-admin :clog-new-app)) (:export :clog-builder
:add-supported-controls
:control-info
:clog-db-admin
:clog-new-app))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - CLOG Utilities ;; Implementation - CLOG Utilities

View file

@ -154,14 +154,14 @@
(defparameter *props-form-values* (defparameter *props-form-values*
`((:name "value" `((:name "value"
:setf clog:value) :setf clog:value)
(:name "default value"
:prop "defaultValue")
(:name "place holder"
:prop "placeholder")
(:name "name on form" (:name "name on form"
:setf clog:name) :setf clog:name)
(:name "size" (:name "size"
:prop "size") :prop "size")
(:name "place holder"
:prop "placeholder")
(:name "default value"
:prop "defaultValue")
(:name "image url" (:name "image url"
:prop "src") :prop "src")
(:name "image alt" (:name "image alt"

View file

@ -240,7 +240,7 @@ create-div's"
;; Control utilities ;; Control utilities
(defun control-info (control-type-name) (defun control-info (control-type-name)
"Return control informaton record for CONTROL-TYPE-NAME from the *supported-controls* list." "Return the control-record for CONTROL-TYPE-NAME from supported controls."
(if (equal control-type-name "clog-data") (if (equal control-type-name "clog-data")
`(:name "clog-data" `(:name "clog-data"
:description "Panel Properties" :description "Panel Properties"
@ -257,6 +257,10 @@ create-div's"
:get ,(lambda (control) (height control))))) :get ,(lambda (control) (height control)))))
(find-if (lambda (x) (equal (getf x :name) control-type-name)) *supported-controls*))) (find-if (lambda (x) (equal (getf x :name) control-type-name)) *supported-controls*)))
(defun add-supported-controls (control-records)
"Add a list of control-records to builder's supported controls."
(alexandria:appendf *supported-controls* control-records))
(defun create-control (parent content control-record uid &key custom-query) (defun create-control (parent content control-record uid &key custom-query)
"Return a new control based on CONTROL-RECORD as a child of PARENT" "Return a new control based on CONTROL-RECORD as a child of PARENT"
(let* ((create-type (getf control-record :create-type)) (let* ((create-type (getf control-record :create-type))
@ -1499,6 +1503,10 @@ of controls and double click to select control."
(lambda (obj) (lambda (obj)
(declare (ignore obj)) (declare (ignore obj))
(open-window (window body) "https://rabbibotton.github.io/clog/clog-manual.html"))) (open-window (window body) "https://rabbibotton.github.io/clog/clog-manual.html")))
(create-gui-menu-item help :content "CLOG Tutorials" :on-click
(lambda (obj)
(declare (ignore obj))
(open-window (window body) "https://github.com/rabbibotton/clog/blob/main/LEARN.md")))
(create-gui-menu-item help :content "Lisp in Y Minutes" :on-click (create-gui-menu-item help :content "Lisp in Y Minutes" :on-click
(lambda (obj) (lambda (obj)
(declare (ignore obj)) (declare (ignore obj))