diff --git a/clog-gui.lisp b/clog-gui.lisp index 0e7d0eb..6142541 100644 --- a/clog-gui.lisp +++ b/clog-gui.lisp @@ -983,25 +983,28 @@ interactions. Use window-end-modal to undo.")) (initial-filename nil)) "Create a local file dialog box called TITLE using INITIAL-DIR on server machine, upon close ON-FILE-NAME called with filename or nil if failure." - (let* ((win (create-gui-window obj + (let* ((win (create-gui-window obj :title title :maximize maximize :top top :left left :width width :height height)) - (box (create-div (window-content win) :class "w3-panel")) - (form (create-form box)) - (dirs (create-select form)) - (files (create-select form)) - (input (create-form-element form :input :label + (box (create-div (window-content win) :class "w3-panel")) + (form (create-form box)) + (dirs (create-select form)) + (files (create-select form)) + (input (create-form-element form :input :label (create-label form :content "File Name:"))) - (ok (create-button form :content "  OK  "))) + (ok (create-button form :content "OK")) + (cancel (create-button form :content "Cancel"))) (setf (size dirs) 4) (setf (box-width dirs) "100%") (setf (size files) 8) (setf (box-width files) "100%") (setf (box-width input) "100%") + (setf (width ok) "7em") + (setf (width cancel) "7em") (window-make-modal win) (flet ((populate-dirs (dir) (setf (inner-html dirs) "") @@ -1046,6 +1049,9 @@ machine, upon close ON-FILE-NAME called with filename or nil if failure." (declare (ignore obj)) (window-end-modal win) (funcall on-file-name nil))) + (set-on-click cancel (lambda (obj) + (declare (ignore obj)) + (window-close win))) (set-on-click ok (lambda (obj) (declare (ignore obj)) (set-on-window-close win nil) diff --git a/demos/03-demo.lisp b/demos/03-demo.lisp index db7435c..2c75cac 100644 --- a/demos/03-demo.lisp +++ b/demos/03-demo.lisp @@ -75,8 +75,9 @@ (format nil "editor_~A.setValue('~A');editor_~A.moveCursorTo(0,0);" (html-id (current-window obj)) (escape-string (read-file fname)) - (html-id (current-window obj))))) - :left (- (/ (width (body app)) 2) 200))))) + (html-id (current-window obj)))))) + :top 10 + :left (- (/ (width (body app)) 2) 200)))) (defun do-ide-file-save-as (obj) (let* ((app (connection-data-item obj "app-data")) @@ -90,8 +91,9 @@ (write-file (js-query obj (format nil "editor_~A.getValue()" (html-id cw))) fname))) - :left (- (/ (width (body app)) 2) 200) - :initial-filename (window-title cw))))) + :top 10 + :left (- (/ (width (body app)) 2) 200) + :initial-filename (window-title cw))))) (defun do-ide-file-save (obj) (if (equalp (window-title (current-window obj)) "New Window")