Lisp HUG Maillist Archive

drag and drop graphics-pane nodes and tree-view nodes

     I'm trying to build a drag-and-drop application
using capi:graph-pane and capi:tree-view.  So far
I can't find any sample code showing how to drag-and-drop
nodes of these panes,  so I've resorted to a workaround
of selecting nodes to copy source nodes and double-clicking target nodes
to paste what's copied.  Of course this is much less easy to explain 
and less
natural than drag-and-drop,  plus it uses up the double-click
gesture that I'd like to use for better things like making
a node 'execute' or editing a node's name.

     Does anybody have some example code to enable a really simple
drag-and-drop for capi:graph-pane and capi:tree-view?
It's good enough to just draw a rectangle outline of inverted-pixels
sized to the objected dragged while dragging,  and generating
a call-back to a function with args of dragged-node,  dragged-onto-node.
(Inverting pixels to outline a dragged object may save the effort of 
actually drawing
the dragged object on the screen)

This is the approach Macintosh Common Lisp (MCL) took with
their simple GUI interface builder;  it was only a few pages of code in 
MCL
and produced a highly robust,  intuitive interface builder.

-- Lawrence


Re: drag and drop graphics-pane nodes and tree-view nodes

Gosh maybe nobody is doing drag-and-drop in graph-panes.
Is anybody doing any kind of drag-and-drop in CAPI?
I'm just a beginner with CAPI so I'm hoping for any sort of advice.

-- Lawrence Au

On Wednesday, March 31, 2004, at 11:07 AM, Lawrence Au wrote:

>     I'm trying to build a drag-and-drop application
> using capi:graph-pane and capi:tree-view.  So far
> I can't find any sample code showing how to drag-and-drop
> nodes of these panes,  so I've resorted to a workaround
> of selecting nodes to copy source nodes and double-clicking target 
> nodes
> to paste what's copied.  Of course this is much less easy to explain 
> and less
> natural than drag-and-drop,  plus it uses up the double-click
> gesture that I'd like to use for better things like making
> a node 'execute' or editing a node's name.
>
>     Does anybody have some example code to enable a really simple
> drag-and-drop for capi:graph-pane and capi:tree-view?
> It's good enough to just draw a rectangle outline of inverted-pixels
> sized to the objected dragged while dragging,  and generating
> a call-back to a function with args of dragged-node,  
> dragged-onto-node.
> (Inverting pixels to outline a dragged object may save the effort of 
> actually drawing
> the dragged object on the screen)
>
> This is the approach Macintosh Common Lisp (MCL) took with
> their simple GUI interface builder;  it was only a few pages of code 
> in MCL
> and produced a highly robust,  intuitive interface builder.
>
> -- Lawrence
>


Re: drag and drop graphics-pane nodes and tree-view nodes

Take a look at the documentation for the INPUT-MODEL slot of CAPI:OUTPUT-PANE.
That describes how to handle the mouse gestures.  Given the coordinates
of the mouse you'll need to figure out what objects your picking up and 
dropping.


RE: drag and drop graphics-pane nodes and tree-view nodes

Hi laurence,

There is an example that manipulates pinboard objects at:

..../examples/capi/graphics/pinboard-movement.lisp

It gives you a starting point.

Sebastien.

> -----Message d'origine-----
> De : owner-lisp-hug@xanalys.com [mailto:owner-lisp-hug@xanalys.com]De la
> part de Lawrence Au
> Envoye : jeudi 8 avril 2004 21:35
> A : Lawrence Au
> Cc : lisp-hug@xanalys.com
> Objet : Re: drag and drop graphics-pane nodes and tree-view nodes
> 
> 
> Gosh maybe nobody is doing drag-and-drop in graph-panes.
> Is anybody doing any kind of drag-and-drop in CAPI?
> I'm just a beginner with CAPI so I'm hoping for any sort of advice.
> 
> -- Lawrence Au
> 
> On Wednesday, March 31, 2004, at 11:07 AM, Lawrence Au wrote:
> 
> >     I'm trying to build a drag-and-drop application
> > using capi:graph-pane and capi:tree-view.  So far
> > I can't find any sample code showing how to drag-and-drop
> > nodes of these panes,  so I've resorted to a workaround
> > of selecting nodes to copy source nodes and double-clicking target 
> > nodes
> > to paste what's copied.  Of course this is much less easy to explain 
> > and less
> > natural than drag-and-drop,  plus it uses up the double-click
> > gesture that I'd like to use for better things like making
> > a node 'execute' or editing a node's name.
> >
> >     Does anybody have some example code to enable a really simple
> > drag-and-drop for capi:graph-pane and capi:tree-view?
> > It's good enough to just draw a rectangle outline of inverted-pixels
> > sized to the objected dragged while dragging,  and generating
> > a call-back to a function with args of dragged-node,  
> > dragged-onto-node.
> > (Inverting pixels to outline a dragged object may save the effort of 
> > actually drawing
> > the dragged object on the screen)
> >
> > This is the approach Macintosh Common Lisp (MCL) took with
> > their simple GUI interface builder;  it was only a few pages of code 
> > in MCL
> > and produced a highly robust,  intuitive interface builder.
> >
> > -- Lawrence
> >
> 
> 


Updated at: 2020-12-10 08:57 UTC