[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


I have uploaded the file rulers.lisp to /pub/mcl/contrib/. This file implements
a new class called scrolling-window-with-rulers, built on
ccl::scrolling-window. There are methods to add and remove rulers from
the window, as well as a slot to control whether rulers are displayed
or not. This slot contains the window's zoom factor, which controls the
scale of the rulers. Ruler units can be set to any of three values,
and the mouse position is tracked in the rulers. Enjoy!

Following are some comments from the file.

;;; faultrease:rulers.lisp
;;; methods to draw rulers in a window

;;; to turn rulers on:  (setf (slot-value <window> 'rulers) <zoom>)
;;; to turn rulers off: (setf (slot-value <window> 'rulers) nil)
;;; where <window> is a scrolling-window-with-rulers
;;; and <zoom> is the zoom ratio
;;; when rulers are on, the current mouse location will be tracked
;;; in the rulers, using a gray pattern
;;; to set ruler units: (setq *ruler-units* <unit>)
;;; where <unit> is one of (inch centimeter point pixel)