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

gEDA-user: Snap-to-pins, was: Stupid newbie question



Dave McGuire wrote:
On May 21, 2004, at 3:47 PM, DJ Delorie wrote:

One idea is to have the shift or ctrl keys temporarily toggle "snap to
pin" mode.  Draw nets as usual, but just before you select the final
pin, press and hold the shift key to go to snap to pin mode, select
the final pin, then release the shift key to revert to grid (or no
grid) mode.

This is an interesting idea. I seem to remember some general drawing package years ago (Micrografx Designer, maybe?) which, when drawing a line, would force it to perfectly vertical or horizontal if you dragged the second endpoint while holding down one of the modifier keys. This seemed very streamlined and supported the "one hand on the keyboard, the other on the mouse" way of doing things.
Well, gschem already uses CTRL to control ortho line drawing, so I suppose it would be a matter of figuring out how it works and using that. I see the TOPLEVEL structure contains CONTROLKEY and SHIFTKEY indicators, so I could wrap this in an if() check on the SHIFT key. I see right where to do this, I think. The real questions are:

1. Can anybody can help me figure out how to iterate across the available pins to find one to snap to.

2. Should I add a utility function like snap_grid() so other developers could do pin-snaps in the future? Not sure why you would, but it could be done that way. Or should I just add it to o_net and keep it simple?

Maybe we should take this discussion off list?

Regards,
Chad