reduce need to reload properties amd control-list

This commit is contained in:
David Botton 2024-06-24 19:52:47 -04:00
parent dbfe0723ce
commit 118da225e4
5 changed files with 24 additions and 18 deletions

View file

@ -8,7 +8,7 @@
(let* ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*)
(win (create-gui-window obj :title "Control CLOG Events"
:left 225
:left (+ *builder-left-panel-size* 5)
:height 200 :width 645
:has-pinner t :client-movement *client-side-movement*))
(content (window-content win))
@ -59,7 +59,7 @@
(let* ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*)
(win (create-gui-window obj :title "Control Client JavaScript Events"
:left 225
:left (+ *builder-left-panel-size* 5)
:height 200 :width 645
:has-pinner t :client-movement *client-side-movement*))
(content (window-content win))
@ -112,7 +112,7 @@
(let* ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*)
(win (create-gui-window obj :title "Control Client ParenScript Events"
:left 225
:left (+ *builder-left-panel-size* 5)
:height 200 :width 645
:has-pinner t :client-movement *client-side-movement*))
(content (window-content win))

View file

@ -49,10 +49,9 @@
(win (create-gui-window obj :title "Controls"
:has-pinner t
:keep-on-top t
:width 220))
:width *builder-left-panel-size*))
(content (window-content win))
(sheight (floor (/ (height content) 2)))
(swidth (floor (width content)))
(divider (create-panel content :top sheight :height 10 :left 0 :right 10
:class *builder-title-class*))
(control-list (create-panel content :height (- sheight 10) :left 0 :bottom 0 :right 10))
@ -63,6 +62,7 @@
(setf (control-list-win app) control-list)
(setf (select-tool app) pallete)
(set-on-window-close win (lambda (obj)
(declare (ignore obj))
(setf (controls-win app) nil)
(setf (select-tool app) nil)
(setf (control-list-win app) nil)))

View file

@ -87,7 +87,7 @@
(p (attribute (parent-element v) "data-clog-name")))
(unless (or (equal cname n)
(equal cname p))
(push n panel-controls))))
(push n panel-controls))))
(get-control-list app panel-id))
(push (attribute panel "data-clog-name") panel-controls)
(push
@ -128,6 +128,7 @@
(when (equal (subseq vname 0 1) "(")
(setf vname (format nil "|~A|" vname)))
(setf (attribute control "data-clog-name") vname)
(on-populate-control-list-win panel :win win)
(when (equal (getf info :name) "clog-data")
(when win
(setf (window-title win) vname)))))))

View file

@ -510,7 +510,7 @@ not a temporarily attached one when using select-control."
(*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*)
ext-panel
(win (create-gui-window obj :top 40 :left 225
(win (create-gui-window obj :top 40 :left (+ *builder-left-panel-size* 5)
:width 645 :height 430
:client-movement *client-side-movement*))
(box (create-panel-box-layout (window-content win)
@ -536,15 +536,14 @@ not a temporarily attached one when using select-control."
(m-lisp (create-gui-menu-drop-down menu :content "Lisp"))
(m-rndr (create-gui-menu-item m-lisp :content "render form to lisp"))
(m-rndras (create-gui-menu-item m-lisp :content "render form to lisp as..."))
(m-rndr (create-gui-menu-item m-lisp :content "render form to lisp"))
(m-eval (create-gui-menu-item m-lisp :content "evaluate"))
(m-test (create-gui-menu-item m-lisp :content "evaluate and test"))
(m-events (create-gui-menu-drop-down menu :content "controls"))
(tmp (create-gui-menu-item m-events :content "show control properties" :on-click 'on-show-control-properties-win))
(tmp (create-gui-menu-item m-events :content "show controls window" :on-click 'on-show-control-list-win))
(tmp (create-gui-menu-item m-events :content "show CLOG events" :on-click 'on-show-control-events-win))
(tmp (create-gui-menu-item m-events :content "show JavaScript events" :on-click 'on-show-control-js-events-win))
(tmp (create-gui-menu-item m-events :content "show ParenScript events" :on-click 'on-show-control-ps-events-win))
(tmp1 (create-gui-menu-item m-events :content "show control properties" :on-click 'on-show-control-properties-win))
(tmp2 (create-gui-menu-item m-events :content "show controls window" :on-click 'on-show-control-list-win))
(tmp3 (create-gui-menu-item m-events :content "show CLOG events" :on-click 'on-show-control-events-win))
(tmp4 (create-gui-menu-item m-events :content "show JavaScript events" :on-click 'on-show-control-js-events-win))
(tmp5 (create-gui-menu-item m-events :content "show ParenScript events" :on-click 'on-show-control-ps-events-win))
(m-help (create-gui-menu-drop-down menu :content "Help"))
(m-helpk (create-gui-menu-item m-help :content "quick start"))
(tool-bar (create-div (top-panel box) :class *builder-title-class*))
@ -564,7 +563,6 @@ not a temporarily attached one when using select-control."
(spacer (create-span tool-bar :content "   "))
(btn-help (create-span tool-bar :content "?" :class "w3-tiny w3-ripple"))
(content (center-panel box))
(in-simulation nil)
(undo-chain nil)
(redo-chain nil)
(is-dirty nil)
@ -572,7 +570,7 @@ not a temporarily attached one when using select-control."
(file-name "")
(render-file-name "")
(panel-id (html-id content)))
(declare (ignore spacer))
(declare (ignore spacer tmp1 tmp2 tmp3 tmp4 tmp5))
(add-class menu "w3-small")
(setf (overflow (top-panel box)) :visible) ; let menus leave the top panel
(add-class (top-panel box) *builder-title-class*)
@ -644,7 +642,7 @@ not a temporarily attached one when using select-control."
(on-populate-control-properties-win content :win win :clear t)
(setf content nil)
(setf ext-panel nil)
(Window-close win)))
(window-close win)))
(set-on-click (create-gui-menu-item m-file :content "export as a boot html")
(lambda (obj)
(server-file-dialog obj "Export as a Boot HTML" "./"
@ -685,8 +683,11 @@ not a temporarily attached one when using select-control."
(set-on-window-focus win
(lambda (obj)
(declare (ignore obj))
(on-populate-control-properties-win content :win win)
(on-populate-control-list-win content :win win)))
(unless (eq (last-panel-editor app) win)
(progn
(on-populate-control-properties-win content :win win)
(on-populate-control-list-win content :win win)
(setf (last-panel-editor app) win)))))
(set-on-window-close win
(lambda (obj)
(declare (ignore obj))

View file

@ -137,6 +137,10 @@ clog-builder window.")
:accessor control-list-win
:initform nil
:documentation "Current control list window")
(last-panel-editor
:accessor last-panel-editor
:initform nil
:documentation "Last editor panel focused, to avoid recalculations")
(control-pallete-win
:accessor control-pallete-win
:initform nil