From: Jose Carlos Senciales
Subject: Moving on Capi:pinboard-layout
Date: 
Message-ID: <3B947F45.70907ECE@lcc.uma.es>
hello, i would like to know how to move to any coordinate (X Y) on a
capi:pinboard-layout.
Actually, i�m using the function set-scroll-position but this is not
fine when you are using some transform in scale, then
i�m wondering if it�ll exist another way to do it.

thanks in advance.

--
Jos� Carlos Senciales Chaves.

From: Paul Tarvydas
Subject: Re: Moving on Capi:pinboard-layout
Date: 
Message-ID: <_75l7.70588$f01.19280315@news3.rdc1.on.home.com>
I'm not sure if this entirely answers your question, but here is the set of
routines I've got for accessing and manipulating CAPI objects.  Since this
library was built via accretion, there may be some dead concepts left lying
around (I think that the hint-table stuff might now be unnecessary -
comments anyone?)

pt



(defun get-x (p)
  "Return the X coordinate for CAPI object p"
  (multiple-value-bind (x y) (capi:pinboard-pane-position p)
    (declare (ignore y))
    (if x
        x
      (lookup :x (capi::hint-table p)))))

(defun get-y (p)
  "Return the Y coordinate for CAPI object p"
  (multiple-value-bind (x y) (capi:pinboard-pane-position p)
    (declare (ignore x))
    (if y
        y
      (lookup :y (capi::hint-table p)))))

(defun get-width (p)
  "Return the width of CAPI object p"
  (multiple-value-bind (w h) (capi:pinboard-pane-size p)
    (declare (ignore h))
    (if w
        w
      (lookup :min-width (capi::hint-table p)))))

(defun get-height (p)
  "Return the height of CAPI object p"
  (multiple-value-bind (w h) (capi:pinboard-pane-size p)
    (declare (ignore w))
    (if h
        h
      (lookup :min-height (capi::hint-table p)))))

(defun set-xy (obj x y)
  "Set the X and Y coordinates for CAPI object obj."
  (setf (capi:pinboard-pane-position obj) (values x y)))

(defun set-wh (obj w h)
  "Set the width and height for CAPI object obj."
  (setf (capi:pinboard-pane-size obj) (values w h)))

(defun canvas-append (port object x y w h)
  "Add a CAPI object to a pinboard layout, then
   set x, y, w and h"
  (setf (capi:layout-description port)
        (append (capi:layout-description port) (list object)))
  (setf (capi:pinboard-pane-position object)
        (values x y))
  (setf (capi:pinboard-pane-size object)
        (values w h)))

(defmethod canvas-delete (port object)
  "Remove a CAPI object from a pinboard layout."
  (capi:manipulate-pinboard port object :delete))

(defun redraw (obj)
  "Cause CAPI object obj to be redrawn"
  (capi:redraw-pinboard-object obj))

(defun canvas-all-objects (port)
  "Return a list of all object in a pinboard layout"
  (capi:layout-description port))

;; helper
(defun lookup (obj lis)
  (let ((r (member obj lis)))
    (if r (second r) nil)))
From: Jose Carlos Senciales
Subject: Re: Moving on Capi:pinboard-layout
Date: 
Message-ID: <3B94EC18.D38B1AC9@lcc.uma.es>
Thanks a lot,

But my problem is that i have a graphic too big then i can move the graphics
with scroll-bars in the window
but i want to move to any concrete x y coordenates without using manually
scroll bar, then i had found
the function capi:set-scroll-position, that automatically do this but it
doesn�t function well when i have a graphic with
any transform done, like for example scaling.

Where have you found the functions like capi::hint-table or
capi:manipulate-pinboard ? In my Capi Reference Manual from lispworks Harlequin
don�t appear anything for this functions and really they can be very usefull.

Sorry for my bad english and thanks.

--
Jos� Carlos Senciales Chaves.
From: Dave Fox
Subject: Re: Moving on Capi:pinboard-layout
Date: 
Message-ID: <epg09vgjp1.fsf@harlequin.co.uk>
Jose Carlos Senciales <······@lcc.uma.es> writes:
> 
> Thanks a lot,
> 
> But my problem is that i have a graphic too big then i can move the graphics
> with scroll-bars in the window
> but i want to move to any concrete x y coordenates without using manually
> scroll bar, then i had found
> the function capi:set-scroll-position, that automatically do this but it
> doesn�t function well when i have a graphic with
> any transform done, like for example scaling.
> 
> Where have you found the functions like capi::hint-table or
> capi:manipulate-pinboard ? In my Capi Reference Manual from
> lispworks Harlequin don�t appear anything for this functions and
> really they can be very usefull.
> 
> Sorry for my bad english and thanks.
> 
> --
> Jos� Carlos Senciales Chaves.
> 
> 

The problem is that the graphics-port transform only affects drawing,
not the size/position of pinboard objects. 

You can do the 'transform' instead by (SETF CAPI:PINBOARD-PANE-SIZE)
and/or (SETF CAPI:PINBOARD-PANE-POSITION)

Dave


Dave Fox                                Email: ·····@xanalys.com
Xanalys Inc, Barrington Hall,             Tel:   +44 1223 873879
Barrington, Cambridge CB2 5RG, England.   Fax:   +44 1223 873873
These opinions are not necessarily those of Xanalys.