Place static controls

This commit is contained in:
David Botton 2022-01-17 18:49:11 -05:00
parent ebf0364775
commit 23581d8389
3 changed files with 25 additions and 8 deletions

View file

@ -14,7 +14,8 @@
(:use #:cl #:clog)) (:use #:cl #:clog))
(defpackage #:clog-tools (defpackage #:clog-tools
(:use #:cl #:clog #:clog-gui)) (:use #:cl #:clog #:clog-gui #:clog-web)
(:export :clog-builder :clog-db-admin))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Implementation - CLOG Utilities ;; Implementation - CLOG Utilities

View file

@ -1,5 +1,4 @@
(in-package :clog-tools) (in-package :clog-tools)
(export 'clog-builder)
(defparameter supported-controls (defparameter supported-controls
(list (list
@ -8,6 +7,7 @@
:create nil :create nil
:create-type nil :create-type nil
:properties nil :properties nil
:positioning nil
:events nil) :events nil)
'(:name "label" '(:name "label"
:description "Text Label" :description "Text Label"
@ -15,6 +15,7 @@
:create clog:create-label :create clog:create-label
:create-type :element :create-type :element
:create-content "label" :create-content "label"
:positioning :absolute
:properties ((:name "text" :properties ((:name "text"
:prop clog:text) :prop clog:text)
(:name "positioning" (:name "positioning"
@ -30,6 +31,7 @@
:create-type :form :create-type :form
:create-param :button :create-param :button
:create-value "button" :create-value "button"
:positioning :absolute
:properties ((:name "value" :properties ((:name "value"
:prop clog:value) :prop clog:value)
(:name "positioning" (:name "positioning"
@ -45,6 +47,7 @@
:create-type :form :create-type :form
:create-param :input :create-param :input
:create-value "" :create-value ""
:positioning :absolute
:properties ((:name "value" :properties ((:name "value"
:prop clog:value) :prop clog:value)
(:name "positioning" (:name "positioning"
@ -58,7 +61,8 @@
:clog-type clog:clog-div :clog-type clog:clog-div
:create clog:create-div :create clog:create-div
:create-type :element :create-type :element
:create-content "" :create-content "DIV"
:positioning :static
:properties ((:name "text" :properties ((:name "text"
:prop clog:text) :prop clog:text)
(:name "positioning" (:name "positioning"
@ -748,7 +752,13 @@ of controls and double click to select control."
;; create control ;; create control
(let* ((control-record (control-info (value (select-tool app)))) (let* ((control-record (control-info (value (select-tool app))))
(control-type-name (getf control-record :name)) (control-type-name (getf control-record :name))
(control (create-control content control-record (positioning (getf control-record :positioning))
(parent (when (eq positioning :static)
(current-control app)))
(control (create-control (if parent
parent
content)
control-record
(format nil "B~A~A" (format nil "B~A~A"
panel-uid panel-uid
next-id)))) next-id))))
@ -759,7 +769,7 @@ of controls and double click to select control."
(format nil "~A-~A" control-type-name (incf next-id))) (format nil "~A-~A" control-type-name (incf next-id)))
(setf (value (select-tool app)) 0) (setf (value (select-tool app)) 0)
(setf (box-sizing control) :content-box) (setf (box-sizing control) :content-box)
(setf (positioning control) :absolute) (setf (positioning control) positioning)
(set-geometry control (set-geometry control
:left (getf data :x) :left (getf data :x)
:top (getf data :y)) :top (getf data :y))
@ -820,6 +830,7 @@ of controls and double click to select control."
(close-window (window body)))) (close-window (window body))))
(clog-gui-initialize body) (clog-gui-initialize body)
(clog-web-initialize body :w3-css-url nil)
(init-control-list app panel-id) (init-control-list app panel-id)
(let* ((pbox (create-panel-box-layout (window-content win) (let* ((pbox (create-panel-box-layout (window-content win)
:left-width 0 :right-width 0 :left-width 0 :right-width 0
@ -947,7 +958,13 @@ of controls and double click to select control."
;; create control ;; create control
(let* ((control-record (control-info (value (select-tool app)))) (let* ((control-record (control-info (value (select-tool app))))
(control-type-name (getf control-record :name)) (control-type-name (getf control-record :name))
(control (create-control content control-record (positioning (getf control-record :positioning))
(parent (when (eq positioning :static)
(current-control app)))
(control (create-control (if parent
parent
content)
control-record
(format nil "B~A~A" (format nil "B~A~A"
panel-uid panel-uid
next-id)))) next-id))))
@ -958,7 +975,7 @@ of controls and double click to select control."
(format nil "~A-~A" control-type-name (incf next-id))) (format nil "~A-~A" control-type-name (incf next-id)))
(setf (value (select-tool app)) 0) (setf (value (select-tool app)) 0)
(setf (box-sizing control) :content-box) (setf (box-sizing control) :content-box)
(setf (positioning control) :absolute) (setf (positioning control) positioning)
(set-geometry control (set-geometry control
:left (getf data :x) :left (getf data :x)
:top (getf data :y)) :top (getf data :y))

View file

@ -1,5 +1,4 @@
(in-package :clog-tools) (in-package :clog-tools)
(export 'clog-db-admin)
(defclass app-data () (defclass app-data ()
((body ((body