Add some missing methods on window

This commit is contained in:
David Botton 2020-12-29 20:04:25 -05:00
parent 3ace7a8c35
commit 26822cb46a
3 changed files with 77 additions and 7 deletions

View file

@ -240,7 +240,7 @@ events and messages may not be trasmitted on most browsers."))
(execute obj "print()"))
;;;;;;;;;;;;;;;
;; Scroll-by ;;
;; scroll-by ;;
;;;;;;;;;;;;;;;
(defgeneric scroll-by (clog-window x y)
@ -259,6 +259,46 @@ events and messages may not be trasmitted on most browsers."))
(defmethod scroll-to ((obj clog-window) x y)
(execute obj (format nil "scrollTo(~A,~A)" x y)))
;;;;;;;;;;;;;
;; move-by ;;
;;;;;;;;;;;;;
(defgeneric move-by (clog-window x y)
(:documentation "Move browser window by x y."))
(defmethod move-by ((obj clog-window) x y)
(execute obj (format nil "moveBy(~A,~A)" x y)))
;;;;;;;;;;;;;
;; move-to ;;
;;;;;;;;;;;;;
(defgeneric move-to (clog-window x y)
(:documentation "Move browser window to x y."))
(defmethod move-to ((obj clog-window) x y)
(execute obj (format nil "moveTo(~A,~A)" x y)))
;;;;;;;;;;;;;;;
;; resize-by ;;
;;;;;;;;;;;;;;;
(defgeneric resize-by (clog-window x y)
(:documentation "Resize browser window by x y."))
(defmethod resize-by ((obj clog-window) x y)
(execute obj (format nil "resizeBy(~A,~A)" x y)))
;;;;;;;;;;;;;;;
;; resize-to ;;
;;;;;;;;;;;;;;;
(defgeneric resize-to (clog-window x y)
(:documentation "Resize browser window to x y."))
(defmethod resize-to ((obj clog-window) x y)
(execute obj (format nil "resizeTo(~A,~A)" x y)))
;;;;;;;;;;;;;;;;;;
;; close-window ;;
;;;;;;;;;;;;;;;;;;

View file

@ -152,13 +152,11 @@ application."
(set-on-orientation-change generic-function)
(set-on-storage generic-function)
(set-on-resize generic-function)
(move-by generic-function)
(move-to generic-function)
(resize-by generic-function)
(resize-to generic-function))
;; These have no use in most modern browsers
;; (move-by generic-function)
;; (move-to generic-function)
;; (resize-by generic-function)
;; (resize-to generic-function)
)
(defsection @clog-document (:title "CLOG Document Objects")
"CLOG-Document - CLOG Document Objects"

View file

@ -843,6 +843,38 @@ If <code>ON-ORIENTATION-CHANGE-HANDLER</code> is nil unbind the event.</p></li>
is nil unbind the event.</p></li>
</ul>
<p><a id='x-28CLOG-3AMOVE-BY-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3AMOVE-BY-20GENERIC-FUNCTION-29" >MOVE-BY</a></span></span> <span class="locative-args">CLOG-WINDOW X Y</span></span></p>
<p>Move browser window by x y.</p></li>
</ul>
<p><a id='x-28CLOG-3AMOVE-TO-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3AMOVE-TO-20GENERIC-FUNCTION-29" >MOVE-TO</a></span></span> <span class="locative-args">CLOG-WINDOW X Y</span></span></p>
<p>Move browser window to x y.</p></li>
</ul>
<p><a id='x-28CLOG-3ARESIZE-BY-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ARESIZE-BY-20GENERIC-FUNCTION-29" >RESIZE-BY</a></span></span> <span class="locative-args">CLOG-WINDOW X Y</span></span></p>
<p>Resize browser window by x y.</p></li>
</ul>
<p><a id='x-28CLOG-3ARESIZE-TO-20GENERIC-FUNCTION-29'></a></p>
<ul>
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#x-28CLOG-3ARESIZE-TO-20GENERIC-FUNCTION-29" >RESIZE-TO</a></span></span> <span class="locative-args">CLOG-WINDOW X Y</span></span></p>
<p>Resize browser window to x y.</p></li>
</ul>
<p><a id='x-28CLOG-3A-40CLOG-DOCUMENT-20MGL-PAX-3ASECTION-29'></a></p>
<p><span class="outer-navigation"><span class="navigation"> <a href="#x-28CLOG-3A-40CLOG-WINDOW-20MGL-PAX-3ASECTION-29" title="CLOG Window Objects">&#8592;</a> <a href="#x-28CLOG-3A-40CLOG-MANUAL-20MGL-PAX-3ASECTION-29" title="The CLOG manual">&#8593;</a> <a href="#x-28CLOG-3A-40CLOG-LOCATION-20MGL-PAX-3ASECTION-29" title="CLOG Location Objects">&#8594;</a> <a href="#x-28CLOG-3A-40CLOG-DOCUMENT-20MGL-PAX-3ASECTION-29" title="CLOG Document Objects">&#8634;</a></span></span></p>