|
|
|
@ -49,35 +49,61 @@
|
|
|
|
|
separator |
|
|
|
|
(cdr (assoc translation (translations verse))))) |
|
|
|
|
|
|
|
|
|
(defgeneric verse-to-latex (verse &key translation port)) |
|
|
|
|
(defmethod verse-to-latex ((verse verse) &key translation (port t)) |
|
|
|
|
(declare (ignore translation)) |
|
|
|
|
(format port "~A ~A ^{~A} ~%~{~A~%~} \\\\~%" |
|
|
|
|
(bname verse) |
|
|
|
|
(chapter verse) |
|
|
|
|
(vnumber verse) |
|
|
|
|
(mapcar (lambda (trans) (assoc trans |
|
|
|
|
(translations verse))) |
|
|
|
|
'(:mng :luth1545 :luth1912 :sch1951 :elb1871 :neue)))) |
|
|
|
|
|
|
|
|
|
(defgeneric get-text (verse)) |
|
|
|
|
(defmethod get-text ((verse verse)) |
|
|
|
|
(cdr (assoc cl-bible.data:*translation* (translations verse)))) |
|
|
|
|
(cdr (assoc cl-bible.data:*translation* |
|
|
|
|
(translations verse)))) |
|
|
|
|
|
|
|
|
|
(defmethod show-notes ((verse verse) (parent clog:clog-obj)) |
|
|
|
|
(let* ((win (clog-gui:create-gui-window parent |
|
|
|
|
:title "Notes" |
|
|
|
|
:content (let ((notes (notes verse))) |
|
|
|
|
(defun %format-notes (notes) |
|
|
|
|
(if notes |
|
|
|
|
(format nil "~{~A~^<br/>~}" notes) |
|
|
|
|
"No notes found")))) |
|
|
|
|
(_ (clog:create-br (clog-gui:window-content win))) |
|
|
|
|
(button (clog:create-button (clog-gui:window-content win) |
|
|
|
|
"No notes found")) |
|
|
|
|
|
|
|
|
|
(defun %create-notes-window (verse parent) |
|
|
|
|
(let ((win (clog-gui:window-content |
|
|
|
|
(clog-gui:create-gui-window parent |
|
|
|
|
:title "Notes" |
|
|
|
|
:content (%format-notes |
|
|
|
|
(notes verse)))))) |
|
|
|
|
(clog:create-br win) |
|
|
|
|
(clog:create-button win |
|
|
|
|
:content "Add notes"))) |
|
|
|
|
(declare (ignore _)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defgeneric show-notes (verse parent)) |
|
|
|
|
(defmethod show-notes ((verse verse) (parent clog:clog-obj)) |
|
|
|
|
(let ((button (%create-notes-window verse parent))) |
|
|
|
|
(clog:set-on-click button |
|
|
|
|
(lambda (obj) |
|
|
|
|
(declare (ignore obj)) |
|
|
|
|
(add-notes verse parent))))) |
|
|
|
|
|
|
|
|
|
(defmethod add-notes ((verse verse) (parent clog:clog-obj)) |
|
|
|
|
(let* ((win (clog-gui:window-content |
|
|
|
|
(defun %create-add-notes-window (parent) |
|
|
|
|
(let* ((form (clog:create-form |
|
|
|
|
(clog-gui:window-content |
|
|
|
|
(clog-gui:create-gui-window parent |
|
|
|
|
:title "Add note"))) |
|
|
|
|
(form (clog:create-form win)) |
|
|
|
|
(text (clog:create-text-area form :rows 4)) |
|
|
|
|
(_ (clog:create-br form)) |
|
|
|
|
(button (clog:create-button form :content "submit"))) |
|
|
|
|
(declare (ignore _)) |
|
|
|
|
:title "Add note")))) |
|
|
|
|
(text (clog:create-text-area form :rows 4 |
|
|
|
|
:columns 40))) |
|
|
|
|
(clog:create-br form) |
|
|
|
|
(values text |
|
|
|
|
(clog:create-button form :content "submit")))) |
|
|
|
|
|
|
|
|
|
(defgeneric add-notes (verse parent)) |
|
|
|
|
(defmethod add-notes ((verse verse) (parent clog:clog-obj)) |
|
|
|
|
(multiple-value-bind (text button) |
|
|
|
|
(%create-add-notes-window parent) |
|
|
|
|
(clog:set-on-click button |
|
|
|
|
(lambda (obj) |
|
|
|
|
(declare (ignore obj)) |
|
|
|
@ -85,9 +111,10 @@
|
|
|
|
|
|
|
|
|
|
(defgeneric verse-to-clog (verse parent &key translation)) |
|
|
|
|
(defmethod verse-to-clog ((verse verse) (parent clog:clog-obj) &key (translation :mng)) |
|
|
|
|
(let* ((verse-string (verse-to-string verse :translation translation)) |
|
|
|
|
(display (clog:create-p parent |
|
|
|
|
:content verse-string))) |
|
|
|
|
(let ((display |
|
|
|
|
(clog:create-p parent |
|
|
|
|
:content (verse-to-string verse |
|
|
|
|
:translation translation)))) |
|
|
|
|
(clog:set-on-click display |
|
|
|
|
(lambda (obj) |
|
|
|
|
(declare (ignore obj)) |
|
|
|
@ -116,4 +143,3 @@
|
|
|
|
|
|
|
|
|
|
(defun from-sexp (bible) |
|
|
|
|
(mapcar #'verse-from-sexp bible)) |
|
|
|
|
|
|
|
|
|