mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
dir view
This commit is contained in:
parent
780918d1ed
commit
145bad7cd4
8 changed files with 135 additions and 45 deletions
2
clog.asd
2
clog.asd
|
|
@ -64,10 +64,12 @@
|
|||
(:file "sys-browser")
|
||||
(:file "projects")
|
||||
(:file "clog-builder-repl")
|
||||
(:file "dir-view")
|
||||
;; clog-builder code
|
||||
(:file "clog-builder-settings")
|
||||
(:file "clog-builder")
|
||||
(:file "clog-builder-projects")
|
||||
(:file "clog-builder-asdf-browser")
|
||||
(:file "clog-builder-sys-browser")
|
||||
(:file "clog-builder-dir-win")
|
||||
(:file "clog-builder-images")))
|
||||
|
|
|
|||
25
tools/clog-builder-dir-win.lisp
Normal file
25
tools/clog-builder-dir-win.lisp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(in-package :clog-tools)
|
||||
|
||||
(defun populate-dir-win (panel d)
|
||||
(let ((dir (directory-namestring (uiop:truename* d))))
|
||||
;; Dirs
|
||||
(setf (inner-html (folders panel)) "")
|
||||
(add-select-option (folders panel)
|
||||
(format nil "~A" dir)
|
||||
(format nil ". (~A)" dir))
|
||||
(unless (or (equalp dir "/") (equalp dir #P"/"))
|
||||
(add-select-option (folders panel) (format nil "~A../" dir) ".."))
|
||||
(dolist (item (uiop:subdirectories dir))
|
||||
(add-select-option (folders panel) item item))
|
||||
;; Files
|
||||
(setf (inner-html (files panel)) "")
|
||||
(dolist (item (uiop:directory-files (directory-namestring dir)))
|
||||
(add-select-option (files panel) item (file-namestring item)))))
|
||||
|
||||
(defun on-select-dir-win (panel)
|
||||
(let ((item (value (files panel))))
|
||||
(cond ((and (> (length item) 5)
|
||||
(equal (subseq item (- (length item) 5)) ".clog"))
|
||||
(on-new-builder-panel panel :open-file item))
|
||||
(t
|
||||
(on-open-file panel :open-file item)))))
|
||||
|
|
@ -11,7 +11,15 @@
|
|||
(setf (text-value (project-list panel)) (current-project app))
|
||||
(projects-populate panel))
|
||||
(t
|
||||
(setf (text-value (project-list panel)) "None")))))
|
||||
(setf (text-value (project-list panel)) "None")
|
||||
(projects-populate panel)))))
|
||||
|
||||
(defun projects-view-dir (panel)
|
||||
(ignore-errors
|
||||
(let* ((app (connection-data-item panel "builder-app-data"))
|
||||
(sel (text-value (project-list panel)))
|
||||
(sys (asdf:find-system (format nil "~A" sel))))
|
||||
(on-dir-win panel :dir (asdf:system-source-directory sys)))))
|
||||
|
||||
(defun projects-run (panel)
|
||||
(let ((val (text-value (entry-point panel))))
|
||||
|
|
|
|||
|
|
@ -2536,7 +2536,7 @@ of controls and double click to select control."
|
|||
:eval-in-package (text-value pac-line))))
|
||||
(on-open-file obj :title-class "w3-blue" :title "file eval" :text result))))))))
|
||||
(defun on-repl (obj)
|
||||
"Open quick start"
|
||||
"Open REPL"
|
||||
(let* ((win (create-gui-window obj :title "CLOG Builder REPL"
|
||||
:top 40 :left 225
|
||||
:width 600 :height 400
|
||||
|
|
@ -2588,6 +2588,17 @@ of controls and double click to select control."
|
|||
:title-class "w3-red"
|
||||
:text c)))))))
|
||||
|
||||
(defun on-dir-win (obj &key dir)
|
||||
"Open dir window"
|
||||
(let* ((win (create-gui-window obj :title "Directory Window"
|
||||
:top 40 :left 225
|
||||
:width 600 :height 400
|
||||
:client-movement t))
|
||||
(d (create-dir-view (window-content win))))
|
||||
(set-geometry d :units "%" :width 100 :height 100)
|
||||
(when dir
|
||||
(populate-dir-win d dir))))
|
||||
|
||||
(defun on-new-builder (body)
|
||||
"Launch instance of the CLOG Builder"
|
||||
(set-html-on-close body "Connection Lost")
|
||||
|
|
@ -2620,6 +2631,7 @@ of controls and double click to select control."
|
|||
(Create-gui-menu-item src :content "New System Browser" :on-click 'on-new-sys-browser)
|
||||
(create-gui-menu-item src :content "New ASDF System Browser" :on-click 'on-new-asdf-browser)
|
||||
(create-gui-menu-item tools :content "Control Events" :on-click 'on-show-control-events-win)
|
||||
(create-gui-menu-item tools :content "Directory Window" :on-click 'on-dir-win)
|
||||
(create-gui-menu-item tools :content "List Callers" :on-click 'on-show-callers)
|
||||
(create-gui-menu-item tools :content "List Callees" :on-click 'on-show-callees)
|
||||
(create-gui-menu-item tools :content "Thread Viewer" :on-click 'on-show-thread-viewer)
|
||||
|
|
|
|||
1
tools/dir-view.clog
Normal file
1
tools/dir-view.clog
Normal file
|
|
@ -0,0 +1 @@
|
|||
<data id="I3871043518" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="6" data-clog-title="dir-view"></data><select data-clog-type="listbox" size="4" data-clog-name="folders" style="box-sizing: content-box; position: absolute; left: 10px; top: 10px; right: 10px; height: 150px;" data-on-create="(populate-dir-win panel "./")" data-on-change="(populate-dir-win panel (value target))"></select><div data-clog-type="div" data-clog-name="divider" style="box-sizing: content-box; position: absolute; left: 10px; height: 5px; background-attachment: scroll; background-color: rgb(0, 0, 0); right: 10px; top: 166px;"></div><select data-clog-type="listbox" size="4" data-clog-name="files" style="box-sizing: content-box; position: absolute; inset: 175px 10px 10px;" data-on-double-click="(on-select-dir-win panel)"></select>
|
||||
35
tools/dir-view.lisp
Normal file
35
tools/dir-view.lisp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
;;;; CLOG Builder generated code - modify original clog file
|
||||
(in-package :clog-tools)
|
||||
(defclass dir-view (clog:clog-panel)
|
||||
((files :reader files) (divider :reader divider)
|
||||
(folders :reader folders)))
|
||||
(defun create-dir-view
|
||||
(clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t))
|
||||
(let ((panel
|
||||
(change-class
|
||||
(clog:create-div clog-obj :content
|
||||
"<select size=\"4\" style=\"box-sizing: content-box; position: absolute; left: 10px; top: 10px; right: 10px; height: 150px;\" id=\"CLOGB3871033758\" data-clog-name=\"folders\"></select><div style=\"box-sizing: content-box; position: absolute; left: 10px; height: 5px; background-attachment: scroll; background-color: rgb(0, 0, 0); right: 10px; top: 166px;\" id=\"CLOGB3871033756\" data-clog-name=\"divider\"></div><select id=\"CLOGB38710339135\" size=\"4\" style=\"box-sizing: content-box; position: absolute; inset: 175px 10px 10px;\" data-clog-name=\"files\"></select>"
|
||||
:hidden hidden :class class :html-id html-id
|
||||
:auto-place auto-place)
|
||||
'dir-view)))
|
||||
(setf (slot-value panel 'files)
|
||||
(attach-as-child clog-obj "CLOGB38710339135" :clog-type
|
||||
'clog:clog-select :new-id t))
|
||||
(setf (slot-value panel 'divider)
|
||||
(attach-as-child clog-obj "CLOGB3871033756" :clog-type
|
||||
'clog:clog-div :new-id t))
|
||||
(setf (slot-value panel 'folders)
|
||||
(attach-as-child clog-obj "CLOGB3871033758" :clog-type
|
||||
'clog:clog-select :new-id t))
|
||||
(let ((target (folders panel)))
|
||||
(declare (ignorable target))
|
||||
(populate-dir-win panel "./"))
|
||||
(clog:set-on-change (folders panel)
|
||||
(lambda (target)
|
||||
(declare (ignorable target))
|
||||
(populate-dir-win panel (value target))))
|
||||
(clog:set-on-double-click (files panel)
|
||||
(lambda (target)
|
||||
(declare (ignorable target))
|
||||
(on-select-dir-win panel)))
|
||||
panel))
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<data id="I3870693089" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="44" 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="I3871045686" data-in-package="clog-tools" data-custom-slots="" data-clog-next-id="45" 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))))
|
||||
(asdf:clear-system sel)
|
||||
|
|
@ -6,16 +6,16 @@
|
|||
(projects-populate panel))" title="ASDF unload project from Lisp image">Unload</button><button data-clog-type="button" data-clog-name="reload-project-button" style="box-sizing: content-box; position: absolute; left: 521px; top: 79px; width: 100px; height: 22px; bottom: 309.041px;" data-on-click="(let ((sel (text-value (project-list panel))))
|
||||
(asdf:clear-system sel)
|
||||
(projects-populate panel))" title="ASDF reload project in to Lisp image">Reload</button><button data-clog-type="button" data-clog-name="rerender-button" style="box-sizing: content-box; position: absolute; left: 521px; top: 116px; width: 100px;" tabindex="0" title="Rerender all clog files to Lisp" data-on-click="(projects-rerender panel)">Rerender</button><div data-clog-type="div" data-clog-name="file-group" style="box-sizing: content-box; position: absolute; left: 0px; top: 69px; width: 512px; height: 10px;"><label for="CLOGB3868393710" data-clog-type="label" data-clog-for="runtime-list" data-clog-name="runtime-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 65px;">Runtime System</label><label for="CLOGB3868452429" data-clog-type="label" data-clog-for="runtime-list" data-clog-name="dbl-click1" style="box-sizing: content-box; position: absolute; left: 5px; top: 85px;">(double click to launch)</label><select data-clog-type="listbox" size="4" data-clog-name="runtime-list" style="box-sizing: content-box; position: absolute; left: 5px; top: 115px; width: 260px; height: 196px;" data-on-double-click="(open-projects-component target (text-value (project-list panel)) target)"></select><button data-clog-type="button" data-clog-name="runtime-add-lisp" style="box-sizing: content-box; position: absolute; left: 5px; top: 320px;" data-on-click="(let ((sys (text-value (project-list panel))))
|
||||
(projects-add-lisp panel sys))">Add .lisp</button><button data-clog-type="button" data-clog-name="runtime-delete" style="box-sizing: content-box; position: absolute; left: 95px; top: 320px; width: 65px; height: 22px;" data-on-click="(let ((sys (text-value (project-list panel)))
|
||||
(projects-add-lisp panel sys))">Add .lisp</button><button data-clog-type="button" data-clog-name="runtime-delete" style="box-sizing: content-box; position: absolute; left: 93px; top: 320px; width: 65px; height: 22px;" data-on-click="(let ((sys (text-value (project-list panel)))
|
||||
(file (select-text (runtime-list panel))))
|
||||
(unless (equal file "")
|
||||
(setf file (subseq file 0 (- (length file) 5)))
|
||||
(remove-file-from-defsystem sys file :file)
|
||||
(projects-populate panel)))">Remove</button><label for="CLOGB3868619266" data-clog-type="label" data-clog-for="runtime-deps" data-clog-name="runtime-deps-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 365px;">Runtime Dependecies</label><select data-clog-type="listbox" size="4" data-clog-name="runtime-deps" style="box-sizing: content-box; position: absolute; left: 5px; top: 395px; width: 260px; height: 75px;"></select><button data-clog-type="button" data-clog-name="runtime-add-dep" style="box-sizing: content-box; position: absolute; left: 5px; top: 480px; width: 65px;" data-on-click="(let ((sys (text-value (project-list panel))))
|
||||
(projects-populate panel)))">Remove</button><button data-clog-type="button" data-clog-name="runtime-dir" style="box-sizing: content-box; position: absolute; left: 180px; top: 320px; width: 65px;" data-on-click="(projects-view-dir panel)">View Dir</button><label for="CLOGB3868619266" data-clog-type="label" data-clog-for="runtime-deps" data-clog-name="runtime-deps-label" style="box-sizing: content-box; position: absolute; left: 5px; top: 365px;">Runtime Dependecies</label><label for="CLOGB3868452430" data-clog-type="label" data-clog-for="designtime-list" data-clog-name="dbl-click2" style="box-sizing: content-box; position: absolute; left: 290px; top: 85px;">(double click to launch)</label><select data-clog-type="listbox" size="4" data-clog-name="runtime-deps" style="box-sizing: content-box; position: absolute; left: 5px; top: 395px; width: 260px; height: 75px;"></select><button data-clog-type="button" data-clog-name="runtime-add-dep" style="box-sizing: content-box; position: absolute; left: 5px; top: 480px; width: 65px;" data-on-click="(let ((sys (text-value (project-list panel))))
|
||||
(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><label for="CLOGB3868452430" data-clog-type="label" data-clog-for="designtime-list" data-clog-name="dbl-click2" style="box-sizing: content-box; position: absolute; left: 290px; top: 85px;">(double click to launch)</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
|
||||
(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
|
||||
(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)))))
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue