Commit d8d19e9a authored by Dave Cooper's avatar Dave Cooper

updated drawing example with typeset-block

parent 5cc60a14
......@@ -2,8 +2,10 @@
# Ignore any file named foo.txt.
......@@ -327,8 +327,10 @@
#-allegro(warn "Find out how to retitle relevant windows in currently running lisp.~%")
#+(and allegro mswindows)
(defun set-window-titles ()
;;a(excl:console-control :title "Genworks Gendl™ Console")
(excl:console-control :title "Genworks Gendl™ Console")
#-(and allegro mswindows)
(defun set-window-titles ())
......@@ -5,6 +5,7 @@
:hidden-objects ((robot-assembly :type 'robot:assembly)
(text-block :type 'robot-text-block
:margins (twice (twice (the text-view left-margin)))
:width (the text-view width)
:length (the text-view length)
:robot-width (the robot-assembly height)
......@@ -12,11 +13,11 @@
:arm-angle-left (the robot-assembly arm-angle-left)
:head-angle (the robot-assembly head-angle)
:body-angle (the robot-assembly body-angle)))
((text-view :type 'base-view
:left-margin 0
:front-margin 0
;;:left-margin 0
;;:front-margin 0
:border-box? t
:objects (list (the text-block))
:length (half (the length))
......@@ -83,25 +84,25 @@
(define-object robot-text-block (typeset-block)
(robot-width robot-length body-angle arm-angle-left head-angle)
(robot-width robot-length body-angle arm-angle-left head-angle margins)
(tt:compile-text (:font "Helvetica" :font-size 12.0)
(tt:vspace 100)
(tt:paragraph () "Robot Data")
(tt:table (:col-widths (list 220 (- (the width) 220)))
(dolist (slot (list :robot-width :robot-length :body-angle :arm-angle-left :head-angle))
(tt:row ()
(tt:cell (:background-color "#00FF00") (tt:put-string (format nil "~a" (string-capitalize slot))))
(tt:cell ()
(tt:paragraph (:h-align :center) (tt:put-string (format nil "~a" (the (evaluate slot)))))))))))))
(let ((width (- (the width) (the margins))))
(tt:table (:col-widths (list (* 2/3 width) (* 1/3 width)))
(dolist (slot (list :robot-width :robot-length :body-angle :arm-angle-left :head-angle))
(tt:row ()
(tt:cell (:background-color "#00FF00") (tt:put-string (format nil "~a" (string-capitalize slot))))
(tt:cell ()
(tt:paragraph (:h-align :center) (tt:put-string (format nil "~a" (the (evaluate slot))))))))))))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment