mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
More design work, added popup panels option to project view
This commit is contained in:
parent
31f207c28a
commit
bf446f6f9f
8 changed files with 375 additions and 391 deletions
|
|
@ -7,11 +7,11 @@
|
|||
(window-focus (control-events-win app))
|
||||
(let* ((win (create-gui-window obj :title "Control CLOG Events"
|
||||
:left 225
|
||||
:top 480
|
||||
:height 200 :width 645
|
||||
:has-pinner t :client-movement *client-side-movement*))
|
||||
(content (window-content win))
|
||||
status)
|
||||
(set-geometry win :top "" :bottom 0)
|
||||
(setf (current-editor-is-lisp app) t)
|
||||
(set-on-window-focus win
|
||||
(lambda (obj)
|
||||
|
|
@ -42,15 +42,6 @@
|
|||
(set-on-window-size-done win (lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(clog-ace:resize (event-editor app))))
|
||||
(panel-mode win t)
|
||||
(set-on-window-focus win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win t)))
|
||||
(set-on-window-blur win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win nil)))
|
||||
(set-on-window-close win (lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(setf (event-editor app) nil)
|
||||
|
|
@ -65,11 +56,11 @@
|
|||
(window-focus (control-js-events-win app))
|
||||
(let* ((win (create-gui-window obj :title "Control Client JavaScript Events"
|
||||
:left 225
|
||||
:top 700
|
||||
:height 200 :width 645
|
||||
:has-pinner t :client-movement *client-side-movement*))
|
||||
(content (window-content win))
|
||||
status)
|
||||
(set-geometry win :top "" :bottom 0)
|
||||
(setf (current-editor-is-lisp app) nil)
|
||||
(set-on-window-focus win
|
||||
(lambda (obj)
|
||||
|
|
@ -102,15 +93,6 @@
|
|||
(set-on-window-size-done win (lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(clog-ace:resize (event-js-editor app))))
|
||||
(panel-mode win t)
|
||||
(set-on-window-focus win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win t)))
|
||||
(set-on-window-blur win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win nil)))
|
||||
(set-on-window-close win (lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(setf (event-js-editor app) nil)
|
||||
|
|
@ -125,11 +107,11 @@
|
|||
(window-focus (control-ps-events-win app))
|
||||
(let* ((win (create-gui-window obj :title "Control Client ParenScript Events"
|
||||
:left 225
|
||||
:top 700
|
||||
:height 200 :width 645
|
||||
:has-pinner t :client-movement *client-side-movement*))
|
||||
(content (window-content win))
|
||||
status)
|
||||
(set-geometry win :top "" :bottom 0)
|
||||
(setf (current-editor-is-lisp app) nil)
|
||||
(set-on-window-focus win
|
||||
(lambda (obj)
|
||||
|
|
@ -161,15 +143,6 @@
|
|||
(set-on-window-size-done win (lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(clog-ace:resize (event-ps-editor app))))
|
||||
(panel-mode win t)
|
||||
(set-on-window-focus win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win t)))
|
||||
(set-on-window-blur win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win nil)))
|
||||
(set-on-window-close win (lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(setf (event-ps-editor app) nil)
|
||||
|
|
@ -179,6 +152,7 @@
|
|||
|
||||
(defun on-populate-control-events-win (obj)
|
||||
"Populate the control events for the current control"
|
||||
(when obj
|
||||
(let* ((app (connection-data-item obj "builder-app-data"))
|
||||
(event-win (control-events-win app))
|
||||
(elist (events-list app))
|
||||
|
|
@ -247,7 +221,7 @@
|
|||
(set-on-blur (event-editor app) #'on-blur)))))))
|
||||
(populate-options))))))
|
||||
(on-populate-control-ps-events-win obj)
|
||||
(on-populate-control-js-events-win obj))
|
||||
(on-populate-control-js-events-win obj)))
|
||||
|
||||
(defun on-populate-control-js-events-win (obj)
|
||||
"Populate the control js events for the current control"
|
||||
|
|
|
|||
|
|
@ -109,12 +109,15 @@
|
|||
(on-size win))))
|
||||
(window-focus (controls-win app))))
|
||||
|
||||
(defun on-populate-control-list-win (content &key win)
|
||||
(defun on-populate-control-list-win (content &key win clear)
|
||||
"Populate the control-list-window to allow drag and drop adjust of order
|
||||
of controls and double click to select control."
|
||||
(when content
|
||||
(with-sync-event (content)
|
||||
(let ((app (connection-data-item content "builder-app-data")))
|
||||
(if clear
|
||||
(when (control-list-win app)
|
||||
(setf (inner-html (control-list-win app)) ""))
|
||||
(with-sync-event (content)
|
||||
(let ((panel-id (html-id content))
|
||||
(last-ctl nil))
|
||||
(when (control-list-win app)
|
||||
|
|
@ -202,4 +205,4 @@ of controls and double click to select control."
|
|||
(when (equal dcc "undefined") ; when t is not a composite control
|
||||
(add-siblings (first-child control) (format nil "~A→" sim)))))
|
||||
(setf control (next-sibling control))))))
|
||||
(add-siblings (first-child content) "")))))))))
|
||||
(add-siblings (first-child content) ""))))))))))
|
||||
|
|
|
|||
|
|
@ -22,12 +22,15 @@
|
|||
(set-geometry control-list :left 0 :top 0 :right 0)))
|
||||
(window-focus (control-properties-win app))))
|
||||
|
||||
(defun on-populate-control-properties-win (obj &key win)
|
||||
(defun on-populate-control-properties-win (obj &key win clear)
|
||||
"Populate the control properties for the current control"
|
||||
;; obj if current-control is nil must be content
|
||||
(when obj
|
||||
(let ((app (connection-data-item obj "builder-app-data")))
|
||||
(if clear
|
||||
(setf (inner-html (properties-list app)) "")
|
||||
(with-sync-event (obj)
|
||||
(bordeaux-threads:make-thread (lambda () (on-populate-control-events-win obj)))
|
||||
(let ((app (connection-data-item obj "builder-app-data")))
|
||||
(let* ((prop-win (control-properties-win app))
|
||||
(control (if (current-control app)
|
||||
(current-control app)
|
||||
|
|
@ -147,4 +150,4 @@
|
|||
(set-geometry placer :top (position-top control)
|
||||
:left (position-left control)
|
||||
:width (client-width control)
|
||||
:height (client-height control))))))))))))))
|
||||
:height (client-height control))))))))))))))))
|
||||
|
|
|
|||
|
|
@ -481,11 +481,13 @@ not a temporarily attached one when using select-control."
|
|||
|
||||
;; Panel Windows
|
||||
|
||||
(defun on-new-builder-panel-ext (obj &key open-file popup)
|
||||
(defun on-new-builder-panel-ext (obj &key open-file popup open-ext)
|
||||
(open-window (window (connection-body obj))
|
||||
(if open-file
|
||||
(format nil "/panel-editor?open-panel=~A"
|
||||
open-file)
|
||||
(format nil "/panel-editor?open-panel=~A~A"
|
||||
open-file (if open-ext
|
||||
(format nil "&open-ext=~A" open-ext)
|
||||
""))
|
||||
"/source-editor")
|
||||
:specs (if (or popup *open-external-panels-in-popup*)
|
||||
"width=1280,height=700"
|
||||
|
|
@ -589,9 +591,10 @@ not a temporarily attached one when using select-control."
|
|||
(multiple-value-bind (pop pop-win)
|
||||
(open-clog-popup obj :specs "width=640,height=480")
|
||||
(when pop
|
||||
(create-div content :content "Panel is external. Click to bring to front.")
|
||||
(let ((msg (create-button content :content "Panel is external. Click to bring to front.")))
|
||||
(set-geometry msg :units "%" :height 100 :width 100)
|
||||
(set-on-click content
|
||||
(lambda (obj) (focus pop-win)))
|
||||
(lambda (obj) (focus pop-win))))
|
||||
(setf ext-panel pop)
|
||||
(cond ((eq open-ext :custom)
|
||||
(load-css (html-document pop) "/css/jquery-ui.css")
|
||||
|
|
@ -613,9 +616,13 @@ not a temporarily attached one when using select-control."
|
|||
(set-on-before-unload (window pop)
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(deselect-current-control app)
|
||||
(on-populate-control-events-win content)
|
||||
(on-populate-control-list-win content :win win :clear t)
|
||||
(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" "./"
|
||||
|
|
@ -649,23 +656,21 @@ not a temporarily attached one when using select-control."
|
|||
(on-show-control-events-win win)
|
||||
(on-show-control-properties-win win)
|
||||
(on-show-control-list-win win)
|
||||
(panel-mode win t)
|
||||
(on-populate-control-properties-win content :win win)
|
||||
(on-populate-control-list-win content :win win)
|
||||
;; setup window events
|
||||
(set-on-window-focus win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win t)
|
||||
(on-populate-control-properties-win content :win win)
|
||||
(on-populate-control-list-win content :win win)))
|
||||
(set-on-window-blur win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(panel-mode win nil)))
|
||||
(set-on-window-close win
|
||||
(lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(deselect-current-control app)
|
||||
(on-populate-control-events-win content)
|
||||
(on-populate-control-list-win content :win win :clear t)
|
||||
(on-populate-control-properties-win content :win win :clear t)
|
||||
(setf (current-control app) nil)
|
||||
(destroy-control-list app panel-id)
|
||||
(when ext-panel
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@
|
|||
(let* ((app (connection-data-item panel "builder-app-data")))
|
||||
(when *open-external*
|
||||
(setf (checkedp (open-ext panel)) t))
|
||||
(when *open-panels-as-popups*
|
||||
(setf (checkedp (pop-panel panel)) t))
|
||||
(when (uiop:directory-exists-p #P"~/common-lisp/")
|
||||
(pushnew #P"~/common-lisp/"
|
||||
(symbol-value (read-from-string "ql:*local-project-directories*"))
|
||||
|
|
@ -367,8 +369,8 @@
|
|||
((and (> (length item) 5)
|
||||
(equal (subseq item (- (length item) 5)) ".clog"))
|
||||
(if (checkedp (open-ext panel))
|
||||
(on-new-builder-panel-ext target :open-file item)
|
||||
(on-new-builder-panel target :open-file item)))
|
||||
(on-new-builder-panel-ext target :open-file item :open-ext (checkedp (pop-panel panel)))
|
||||
(on-new-builder-panel target :open-file item :open-ext (checkedp (pop-panel panel)))))
|
||||
(t
|
||||
(if (checkedp (open-ext panel))
|
||||
(on-open-file-ext target :open-file item)
|
||||
|
|
|
|||
|
|
@ -100,14 +100,6 @@ clog-builder window.")
|
|||
:accessor project-win
|
||||
:initform nil
|
||||
:documentation "Project window")
|
||||
(right-panel
|
||||
:accessor right-panel
|
||||
:initform nil
|
||||
:documentation "Right panel")
|
||||
(left-panel
|
||||
:accessor left-panel
|
||||
:initform nil
|
||||
:documentation "Left panel")
|
||||
(control-properties-win
|
||||
:accessor control-properties-win
|
||||
:initform nil
|
||||
|
|
@ -196,15 +188,6 @@ clog-builder window.")
|
|||
(setf (hiddenp win) t)
|
||||
nil))))))
|
||||
|
||||
(defun panel-mode (obj bool)
|
||||
"Set the status for display or hiding the side panels."
|
||||
(when obj
|
||||
(let ((app (connection-data-item obj "builder-app-data")))
|
||||
(when (right-panel app)
|
||||
(setf (hiddenp (right-panel app)) (not bool)))
|
||||
(when (left-panel app)
|
||||
(setf (hiddenp (left-panel app)) (not bool))))))
|
||||
|
||||
(defun on-help-about-builder (obj)
|
||||
"Open about box"
|
||||
(let ((about (create-gui-window obj
|
||||
|
|
@ -342,7 +325,8 @@ clog-builder window.")
|
|||
(set-html-on-close body "Connection Lost")
|
||||
(let ((app (make-instance 'builder-app-data))
|
||||
(open-file (form-data-item (form-get-data body) "open-file"))
|
||||
(open-panel (form-data-item (form-get-data body) "open-panel")))
|
||||
(open-panel (form-data-item (form-get-data body) "open-panel"))
|
||||
(open-ext (form-data-item (form-get-data body) "open-ext")))
|
||||
(setf (connection-data-item body "builder-app-data") app)
|
||||
(setf (title (html-document body)) "CLOG Builder")
|
||||
(clog-gui-initialize body)
|
||||
|
|
@ -435,7 +419,7 @@ clog-builder window.")
|
|||
(cond
|
||||
(open-panel
|
||||
(setf (title (html-document body)) open-panel)
|
||||
(on-new-builder-panel body :open-file open-panel))
|
||||
(on-new-builder-panel body :open-file open-panel :open-ext open-ext))
|
||||
(open-file
|
||||
(setf (title (html-document body)) open-file)
|
||||
(on-open-file body :open-file open-file :maximized t))
|
||||
|
|
|
|||
6
tools/panel-projects.clog
vendored
6
tools/panel-projects.clog
vendored
|
|
@ -1,4 +1,4 @@
|
|||
<data id="I3918817107" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="47" data-clog-title="projects"></data><label for="undefined" data-clog-type="label" data-clog-for="projects-list" data-clog-name="projects-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 6.99858px;">Current Project</label><select data-clog-type="dropdown" data-clog-name="project-list" style="box-sizing: content-box; position: absolute; left: 5px; top: 35px; width: 386.54px; height: 22px; bottom: 309.041px;" data-on-create="(projects-setup panel)" data-on-change="(projects-populate panel)"></select><button data-clog-type="button" data-clog-name="edit-asd" style="box-sizing: content-box; position: absolute; left: 400px; top: 32px; height: 22px; width: 90px;" data-on-click="(let ((sel (text-value (project-list panel))))
|
||||
<data id="I3920248400" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="49" data-clog-title="projects"></data><label for="undefined" data-clog-type="label" data-clog-for="projects-list" data-clog-name="projects-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 6.99858px;">Current Project</label><select data-clog-type="dropdown" data-clog-name="project-list" style="box-sizing: content-box; position: absolute; left: 5px; top: 35px; width: 386.54px; height: 22px; bottom: 309.041px;" data-on-create="(projects-setup panel)" data-on-change="(projects-populate panel)"></select><button data-clog-type="button" data-clog-name="edit-asd" style="box-sizing: content-box; position: absolute; left: 400px; top: 32px; height: 22px; width: 90px;" data-on-click="(let ((sel (text-value (project-list panel))))
|
||||
(on-open-file panel :open-file (asdf:system-source-file
|
||||
(asdf:find-system sel))))" title="Manualy projects .asd file">Edit .asd</button><label for="CLOGB386871257741" data-clog-type="label" data-clog-for="entry-point" data-clog-name="entry-point-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 69px;">Entry Point - package:function</label><input type="TEXT" value="" data-clog-type="input" data-clog-name="entry-point" style="box-sizing: content-box; position: absolute; left: 5px; top: 94px; width: 381px; height: 22.5px;" data-on-change="(projects-entry-point-change panel)"><button data-clog-type="button" data-clog-name="run-button" style="box-sizing: content-box; position: absolute; left: 400px; top: 92px; width: 90px; height: 22.5px;" data-on-click="(projects-run panel)">Run</button><button data-clog-type="button" data-clog-name="new-project-button" style="box-sizing: content-box; position: absolute; left: 520px; top: 8px; width: 100px; height: 22px;" data-on-click="(on-new-app-template panel)" title="Create new project from template">New</button><button data-clog-type="button" data-clog-name="unload-project-button" style="box-sizing: content-box; position: absolute; left: 520px; top: 43px; width: 100px; height: 22px; bottom: 309.041px;" data-on-click="(let ((sel (text-value (project-list panel))))
|
||||
(unless (equal sel "None")
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
(projects-add-dep panel sys))">Add</button><button data-clog-type="button" data-clog-name="runtime-del-dep" style="box-sizing: content-box; position: absolute; left: 95px; top: 480px; width: 65px; height: 22px;" data-on-click="(let ((sys (text-value (project-list panel)))
|
||||
(file (select-text (runtime-deps panel))))
|
||||
(remove-dep-from-defsystem sys file)
|
||||
(projects-populate panel))">Remove</button><label for="CLOGB3868393704" data-clog-type="label" data-clog-for="designtime-list" data-clog-name="designtime-label" style="box-sizing: content-box; position: absolute; left: 290.007px; top: 65px;">Design Time System (/tools)</label><select data-clog-type="listbox" size="4" data-clog-name="designtime-list" style="box-sizing: content-box; position: absolute; left: 290px; top: 115px; width: 265px; height: 195.545px;" data-on-double-click="(open-projects-component target panel
|
||||
(projects-populate panel))">Remove</button><label for="CLOGB3868393704" data-clog-type="label" data-clog-for="designtime-list" data-clog-name="designtime-label" style="box-sizing: content-box; position: absolute; left: 290px; top: 65px;">Design Time System (/tools)</label><select data-clog-type="listbox" size="4" data-clog-name="designtime-list" style="box-sizing: content-box; position: absolute; left: 290px; top: 115px; width: 265px; height: 195.545px;" data-on-double-click="(open-projects-component target panel
|
||||
(format nil "~A/tools" (text-value (project-list panel))) target)"></select><button data-clog-type="button" data-clog-name="designtime-add-clog" style="box-sizing: content-box; position: absolute; left: 290px; top: 320px;" data-on-click="(let ((sys (text-value (project-list panel))))
|
||||
(projects-add-clog panel sys))
|
||||
">Add .clog</button><button data-clog-type="button" data-clog-name="designtime-add-lisp" style="box-sizing: content-box; position: absolute; left: 386px; top: 320px;" data-on-click="(let ((sys (format nil "~A/tools" (text-value (project-list panel)))))
|
||||
|
|
@ -37,4 +37,4 @@
|
|||
(projects-populate panel))">Remove</button><button data-clog-type="button" data-clog-name="design-plugin" style="box-sizing: content-box; position: absolute; left: 470px; top: 480px; width: 65px; height: 22px;" data-on-click="(let ((sys (text-value (project-list panel))))
|
||||
(projects-add-plugin panel sys))
|
||||
">Plugin</button></div>
|
||||
<label for="CLOGB391881683346" data-clog-type="label" data-clog-for="open-ext" data-clog-name="ext-win-label" style="box-sizing: content-box; position: absolute; left: 531px; top: 151px;" class="">Open External</label><input type="CHECKBOX" value="" data-clog-type="checkbox" data-clog-name="open-ext" style="box-sizing: content-box; position: absolute; left: 513px; top: 155px;">
|
||||
<label for="CLOGB391881683346" data-clog-type="label" data-clog-for="open-ext" data-clog-name="ext-win-label" style="box-sizing: content-box; position: absolute; left: 531px; top: 144px;" class="">open external</label><input type="CHECKBOX" value="" data-clog-type="checkbox" data-clog-name="open-ext" style="box-sizing: content-box; position: absolute; left: 513px; top: 150px;"><input type="CHECKBOX" value="" data-clog-type="checkbox" data-clog-name="pop-panel" style="box-sizing: content-box; position: absolute; left: 513px; top: 167px;"><label for="undefined" data-clog-type="label" data-clog-for="pop-panel" data-clog-name="pop-panel-label" style="box-sizing: content-box; position: absolute; left: 531px; top: 161px;">popup panels</label>
|
||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue