CLIM mail archive

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

highlighting things in a table



    Date: Mon, 21 Sep 1992 11:22 EDT
    From: Clinton Hyde <chyde@chesapeake.ads.com>


    I want to change how things highlight in a table (i.e., I want to do
    something other than the regular boxing).

    how? I tried making a clim:highlight method, which works except that
    the position is wrong--it's window-relative rather than cell-relative.

Actually, output record coordinates are stored in a parent-relative
coordinate system, so just drawing the highlighting at the coordinates
given by the output record will give the wrong result.

    what's the right way?

Here's an example that assumes a rectangular output record:

(define-presentation-method highlight-presentation ((type <type>) record stream state)
  (declare (ignore state))	;we'll just use XOR
  (multiple-value-bind (xoff yoff)
      (convert-from-relative-to-absolute-coordinates
	stream (output-record-parent record))
    (with-bounding-rectangle* (left top right bottom) record
      (draw-rectangle* stream 
		       (+ left xoff) (+ top yoff)
		       (+ right xoff) (+ bottom yoff)
		       :ink +flipping-ink+ :filled t))))


0,,

References:

Main Index | Thread Index