CLIM mail archive

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

Moving and zooming



I am writing some kind of graph-editor.
Because some aspects of the nodes can be changed by the user
(eg, node-label, status like selected,...) I present the nodes
using updating-output and manually redisplay them to
update the changing aspects. I thougt this could be
quite efficient and hope this is a "legal" use
of incremental-redisplay.

When the nodes are moved to another position, I also use 
the function REDISPLAY to move the output-record to the new
position (if the position has changed, any cached output
is invalidated). So far, so good.

I need  commands like "zoom in" and "zoom out".
I implemented them by modifying the medium-transformation of 
the display-pane. Now things are quite confusing, if that's not
the identity transformation.

1. After changing the transformation, I issue an window-erase-viewport
and REDISPLAY all objects. That works ok.
2. When I move an object, the graphic at the old position is
NOT erased --- execept it is positioned at point (0 0), which is mapped to
itself under my pure scaling-transformations.
3. This even happens if I create new objects (output records) under this 
transformation. So moving output records by using REDISPLAY just works
under the identity transform???

4. I'm using tracking-pointer to basically reimplement
dragging-output-record,
but just to move the record along the points of a raster. I'm all confused
by the coordinate systems the output-record uses (well, I should not use
the internal function clim::output-record-set-position*, but what else?),
the one inside the clauses :pointer-motion, :pointer-button-release
together 
with the value of :transformp and the visible position of the mouse on the 
screen (relative to the viewport of the pane, of course).

At the moment, I erase the ouput-record(s) and re-present them after zoom-
and move-operations. 

Besides any helping insight for my simple mind, other approaches to
implement move and zoom functionality in an efficient an CLIM-ish way
are welcome.

Thanks - Stefan.

- Stefan Bernemann   (berni@iml.fhg.de)


0,,


Main Index | Thread Index