mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
update documentation, remove tabs
This commit is contained in:
parent
2c9ce0864f
commit
25a9462f1f
84 changed files with 2163 additions and 2278 deletions
|
|
@ -21,27 +21,27 @@
|
|||
(with-sync-event (obj) ; Serialize events to on-mouse-down.
|
||||
(let ((app (connection-data-item obj "app-data"))) ; Ensure the first event received
|
||||
(unless (in-drag-p app) ; to drag is the only one, ie only
|
||||
(setf (in-drag-p app) t) ; the innermost box is dragged.
|
||||
(let* ((mouse-x (getf data :screen-x)) ; Use the screen coordinates not
|
||||
(mouse-y (getf data :screen-y)) ; the coordinates relative to the obj
|
||||
(obj-top (parse-integer (top obj) :junk-allowed t))
|
||||
(obj-left (parse-integer (left obj) :junk-allowed t)))
|
||||
(setf (drag-x app) (- mouse-x obj-left))
|
||||
(setf (drag-y app) (- mouse-y obj-top))
|
||||
(if (eq (getf data :event-type) :touch)
|
||||
(progn
|
||||
(set-on-touch-move obj 'on-mouse-move)
|
||||
(set-on-touch-end obj 'stop-obj-grab)
|
||||
(set-on-touch-cancel obj 'on-mouse-leave))
|
||||
(progn
|
||||
(set-on-mouse-move obj 'on-mouse-move)
|
||||
(set-on-mouse-up obj 'stop-obj-grab)
|
||||
(set-on-mouse-leave obj 'on-mouse-leave))))))))
|
||||
(setf (in-drag-p app) t) ; the innermost box is dragged.
|
||||
(let* ((mouse-x (getf data :screen-x)) ; Use the screen coordinates not
|
||||
(mouse-y (getf data :screen-y)) ; the coordinates relative to the obj
|
||||
(obj-top (parse-integer (top obj) :junk-allowed t))
|
||||
(obj-left (parse-integer (left obj) :junk-allowed t)))
|
||||
(setf (drag-x app) (- mouse-x obj-left))
|
||||
(setf (drag-y app) (- mouse-y obj-top))
|
||||
(if (eq (getf data :event-type) :touch)
|
||||
(progn
|
||||
(set-on-touch-move obj 'on-mouse-move)
|
||||
(set-on-touch-end obj 'stop-obj-grab)
|
||||
(set-on-touch-cancel obj 'on-mouse-leave))
|
||||
(progn
|
||||
(set-on-mouse-move obj 'on-mouse-move)
|
||||
(set-on-mouse-up obj 'stop-obj-grab)
|
||||
(set-on-mouse-leave obj 'on-mouse-leave))))))))
|
||||
|
||||
(defun on-mouse-move (obj data)
|
||||
(let* ((app (connection-data-item obj "app-data"))
|
||||
(x (getf data :screen-x))
|
||||
(y (getf data :screen-y)))
|
||||
(x (getf data :screen-x))
|
||||
(y (getf data :screen-y)))
|
||||
(setf (top obj) (unit :px (- y (drag-y app))))
|
||||
(setf (left obj) (unit :px (- x (drag-x app))))))
|
||||
|
||||
|
|
@ -61,12 +61,12 @@
|
|||
|
||||
(defun on-new-window (body)
|
||||
(let ((app (make-instance 'app-data))) ; Create our "App-Data" for this instance
|
||||
(setf (connection-data-item body "app-data") app)) ; of our App.
|
||||
(setf (connection-data-item body "app-data") app)) ; of our App.
|
||||
(setf (title (html-document body)) "Tutorial 8")
|
||||
(let* ((div1 (create-div body))
|
||||
(div2 (create-div div1))
|
||||
(div3 (create-div div2))
|
||||
(dir (create-div div1 :content "<b>Click and drag the boxes</b>")))
|
||||
(div2 (create-div div1))
|
||||
(div3 (create-div div2))
|
||||
(dir (create-div div1 :content "<b>Click and drag the boxes</b>")))
|
||||
;; Absolute allows fixed positioning relative to parent
|
||||
(setf (positioning dir) :absolute)
|
||||
(setf (bottom dir) 0)
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
;; sizes
|
||||
(setf (width div1) 400)
|
||||
(setf (width div2) 300)
|
||||
(setf (width div3) 200)
|
||||
(setf (width div3) 200)
|
||||
(setf (height div1) 400)
|
||||
(setf (height div2) 300)
|
||||
(setf (height div3) 200)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue