Category : Graphic Animations - Lots of older FLI's
Archive   : AFLIX.ZIP
Filename : AFBUTTON.LSP

 
Output of file : AFBUTTON.LSP contained in archive : AFLIX.ZIP

;
; Generate interactive buttons
;
; Last updated in release 1.0a
;
; Designed and implemented by Kelvin R. Throop in May of 1987.
;

(setq flixver "1.0a")

; BUTTON -- Add a button to the image

(defun C:button ()
(initget 1)
(setq p1 (getpoint "\nFirst corner of button: "))
(initget 1)
(setq p2 (getcorner p1 "\nSecond corner of button: "))
(initget (+ 1 2 4))
(setq bn (getint "\nButton number: "))

(setq c1 (list (min (car p1) (car p2)) (min (cadr p1) (cadr p2))))
(setq c2 (list (max (car p1) (car p2)) (max (cadr p1) (cadr p2))))

(setvar "CMDECHO" 0)
(setq blippo (getvar "BLIPMODE"))
(setvar "BLIPMODE" 0)

(setq slayer (getvar "CLAYER"))
(command "LAYER" "MAKE" "$$BUTTONS" "")
(setq scolour (getvar "CECOLOR"))
(command "COLOUR" 100)
; Draw button outline polyline
(command "PLINE" c1 (list (car c1) (cadr c2))
c2 (list (car c2) (cadr c1))
"c"
)
; Label button number
(command "TEXT" "MIDDLE" (list (/ (+ (car c1) (car c2)) 2.0)
(/ (+ (cadr c1) (cadr c2)) 2.0))
(* 0.9 (- (cadr c2) (cadr c1)))
0
(itoa bn)
)
; Draw button definition line
(command "COLOUR" (+ 100 bn))
(command "LINE" c1 c2)
(command)


(command "LAYER" "SET" slayer "")
(command "COLOUR" scolour)
(setvar "BLIPMODE" blippo)
(setvar "CMDECHO" 1)
(princ)
)