diff --git a/doc/clog-manual.html b/doc/clog-manual.html index 1f0b093..90ab6be 100644 --- a/doc/clog-manual.html +++ b/doc/clog-manual.html @@ -2362,6 +2362,15 @@ A list of standard cursor types can be found at:
Remove CLOG-Element from the clog cache on browser.
+ + +[generic-function] DESTROY CLOG-ELEMENT
+ +Remove CLOG-Element from the DOM on browser and clog cache +on browser.
:AUTO-PLACE (default t) place-inside-bottom-of [generic-function] CREATE-IMG CLOG-OBJ &KEY URL-SRC ALT-TEXT CLASS HTML-ID AUTO-PLACE
+[generic-function] CREATE-IMG CLOG-OBJ &KEY URL-SRC ALT-TEXT HIDDEN CLASS HTML-ID AUTO-PLACE
Create a new CLOG-Img as child of CLOG-OBJ with :URL-SRC
(default "") and :ALT-TEXT (default "") if :AUTO-PLACE (default t)
@@ -2548,11 +2557,11 @@ placing image to constrain image size.
[generic-function] CREATE-DIV CLOG-OBJ &KEY CONTENT CLASS HTML-ID AUTO-PLACE
+[generic-function] CREATE-DIV CLOG-OBJ &KEY CONTENT HIDDEN CLASS HTML-ID AUTO-PLACE
Create a new CLOG-Div as child of CLOG-OBJ with :CONTENT
(default "") and if :AUTO-PLACE (default t) place-inside-bottom-of
-CLOG-OBJ
CLOG-OBJ. If hidden it true visiblep is set to nil.
CLOG-HR - Class for CLOG Hortizontal Rules
[generic-function] CREATE-P CLOG-OBJ &KEY CONTENT CLASS HTML-ID AUTO-PLACE
+[generic-function] CREATE-P CLOG-OBJ &KEY CONTENT HIDDEN CLASS HTML-ID AUTO-PLACE
Create a new CLOG-P as child of CLOG-OBJ with :CONTENT
(default "") and if :AUTO-PLACE (default t) place-inside-bottom-of
@@ -2717,7 +2726,7 @@ instead through the value property.
[generic-function] CREATE-SPAN CLOG-OBJ &KEY CONTENT CLASS HTML-ID AUTO-PLACE
+[generic-function] CREATE-SPAN CLOG-OBJ &KEY CONTENT HIDDEN CLASS HTML-ID AUTO-PLACE
Create a new CLOG-Span as child of CLOG-OBJ with CONTENT
and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ
:AUTO-PLACE (default t) place-inside-bottom-of CLOG-OB
-[generic-function] CREATE-SECTION CLOG-OBJ SECTION &KEY CONTENT CLASS HTML-ID AUTO-PLACE
+[generic-function] CREATE-SECTION CLOG-OBJ SECTION &KEY CONTENT HIDDEN CLASS HTML-ID AUTO-PLACE
Create a new CLOG-Section of section type as child of
CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of
@@ -2768,7 +2777,7 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OB
-[generic-function] CREATE-PHRASE CLOG-OBJ PHRASE &KEY CONTENT CLASS HTML-ID AUTO-PLACE
+[generic-function] CREATE-PHRASE CLOG-OBJ PHRASE &KEY CONTENT HIDDEN CLASS HTML-ID AUTO-PLACE
Create a new CLOG-Phrase of phrase type as child of
CLOG-OBJ with CONTENT and if :AUTO-PLACE (default t) place-inside-bottom-of
@@ -2939,7 +2948,7 @@ and if :AUTO-PLACE (default t) place-inside-bottom-of [generic-function] CREATE-TABLE CLOG-OBJ &KEY CLASS HTML-ID AUTO-PLACE
+[generic-function] CREATE-TABLE CLOG-OBJ &KEY HIDDEN CLASS HTML-ID AUTO-PLACE
Create a new CLOG-Table as child of CLOG-OBJ
and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ
@@ -3365,6 +3374,15 @@ instead through the value property.
group called NAME.
+
+
+
+[generic-function] SELECT-VALUE CLOG-OBJ NAME
+
+Returns the value of select item called NAME and must
+be unique name on entire document.
+
+
@@ -4612,13 +4630,16 @@ The on-window-change clog-obj received is the new window
-[generic-function] CREATE-GUI-WINDOW CLOG-OBJ &KEY TITLE CONTENT LEFT TOP WIDTH HEIGHT MAXIMIZE CLIENT-MOVEMENT HTML-ID
+[generic-function] CREATE-GUI-WINDOW CLOG-OBJ &KEY TITLE CONTENT LEFT TOP WIDTH HEIGHT MAXIMIZE HAS-PINNER KEEP-ON-TOP HIDDEN CLIENT-MOVEMENT HTML-ID
Create a clog-gui-window. If client-movement is t then
use jquery-ui to move/resize and will not work on mobile. When client-movement
is t only on-window-move is fired once at start of drag and on-window-move-done
at end of drag and on-window-resize at start of resize and
-on-window-resize-done at end of resize.
+on-window-resize-done at end of resize. If has-pinner a toggle wil appear on
+title bar to allow pinning the window in place, if keep-on-top t then when
+pinned also will keep-on-top. If had-pinned is nil and keep-on-top t then
+the window will be set to keep-on-top always.
@@ -4650,7 +4671,9 @@ on-window-resize-done at end of resize.
[generic-function] WINDOW-CLOSE CLOG-GUI-WINDOW
-Close CLOG-GUI-WINDOW. on-window-can-close is not called.
+Close CLOG-GUI-WINDOW. on-window-can-close is not called.
+CLOG-GUI-WINDOW is removed from DOM but still present in the CLOG cache on
+the browser.
@@ -4844,6 +4867,16 @@ Calls on-input with input box contents or nil if canceled.
Calls on-input with t if confirmed or nil if canceled.
+
+
+
+[function] FORM-DIALOG OBJ CONTENT FIELDS ON-INPUT &KEY (MODAL T) (TITLE "Form") (OK-TEXT "OK") (CANCEL-TEXT "Cancel") (LEFT NIL) (TOP NIL) (WIDTH 400) (HEIGHT 500) (CLIENT-MOVEMENT NIL) (HTML-ID NIL)
+
+Create a form dialog box with CONTENT followed by FIELDS centered.
+Fields is an alist of field names to field descriptions. Calls on-input
+with t if confirmed or nil if canceled.
+
+
diff --git a/source/clog-form.lisp b/source/clog-form.lisp
index 6748ca9..9df458c 100644
--- a/source/clog-form.lisp
+++ b/source/clog-form.lisp
@@ -382,6 +382,17 @@ group called NAME."))
(cc:query (connection-id obj)
(format nil "$('input:radio[name=~A]:checked').val()"
name)))
+;;;;;;;;;;;;;;;;;;
+;; select-value ;;
+;;;;;;;;;;;;;;;;;;
+
+(defgeneric select-value (clog-obj name)
+ (:documentation "Returns the value of select item called NAME and must
+be unique name on entire document."))
+
+(defmethod select-value ((obj clog-obj) name)
+ (cc:query (connection-id obj)
+ (format nil "$('select[name=~A] option:selected').val()" name)))
;;;;;;;;;;;;;;;;
;; name-value ;;
diff --git a/source/clog-gui.lisp b/source/clog-gui.lisp
index 8210cc7..1fd040b 100644
--- a/source/clog-gui.lisp
+++ b/source/clog-gui.lisp
@@ -1388,17 +1388,28 @@ Calls on-input with t if confirmed or nil if canceled."
(client-movement nil)
(html-id nil))
"Create a form dialog box with CONTENT followed by FIELDS centered.
-Fields is an alist of field names to field descriptions. Calls on-input
-with t if confirmed or nil if canceled."
+Fields is an a-list of field names to field descriptions, a third element
+can be added of another a-list of option Text to Value. Calls on-input
+with a-list of field name to value if confirmed or nil if canceled."
(unless html-id
(setf html-id (clog-connection:generate-id)))
(let* ((body (connection-data-item obj "clog-body"))
(fls (format nil "~{~A~}"
(mapcar (lambda (l)
- (format nil
-"~
- "
- (first l) html-id (second l)))
+ (if (third l)
+ (format nil
+ "~
+ "
+ (first l) html-id (second l)
+ (format nil "~{~A~}"
+ (mapcar (lambda (s)
+ (format nil
+ "" (second s) (first s)))
+ (third l))))
+ (format nil
+ "~
+ "
+ (first l) html-id (second l))))
fields)))
(win (create-gui-window obj
:title title
@@ -1445,9 +1456,13 @@ with t if confirmed or nil if canceled."
(window-end-modal win))
(let ((result (mapcar (lambda (l)
`(,(second l)
- ,(name-value win (format nil "~A-~A"
- html-id
- (second l)))))
+ ,(if (third l)
+ (select-value win (format nil "~A-~A"
+ html-id
+ (second l)))
+ (name-value win (format nil "~A-~A"
+ html-id
+ (second l))))))
fields)))
(window-close win)
(funcall on-input result)))
diff --git a/source/clog.lisp b/source/clog.lisp
index d6e191b..4bd747e 100644
--- a/source/clog.lisp
+++ b/source/clog.lisp
@@ -494,6 +494,7 @@ embedded in a native template application.)"
(default-value generic-function)
(value generic-function)
(radio-value generic-function)
+ (select-value generic-function)
(name-value generic-function)
(pattern generic-function)
(minimum generic-function)
diff --git a/tutorial/22-tutorial.lisp b/tutorial/22-tutorial.lisp
index 35740a8..9be3c01 100644
--- a/tutorial/22-tutorial.lisp
+++ b/tutorial/22-tutorial.lisp
@@ -73,7 +73,11 @@
(alert-dialog obj fname))))
(defun on-dlg-form (obj)
- (form-dialog obj "Please enter your information." '(("Name" "name")
+ (form-dialog obj "Please enter your information." '(("Title" "title" (("Mr." "mr")
+ ("Mrs." "mrs")
+ ("Ms." "ms")
+ ("Other" "other")))
+ ("Name" "name")
("Address" "address")
("City" "city")
("State" "st")