[comp.sys.amiga.programmer] Multiple Proportional Gadg's in one "container"

dylan@cs.washington.edu (Dylan McNamee) (02/23/91)

I am writing a DTP program that has a set of drafting tools.  Since
it is built on top of Post, I use PostScript objects.  Once an object
is on the screen, I want to be able to select it, and have a set of
proportional gadgets show up for the object (the endpoints of a line,
or the control points of a bezier, etc.) to allow the user to manipulate
the object.

Proportional gadgets live in a container, and in this case,
I want the container to be the whole window, and for there to be possibly
many prop gadgets.  The problem is that Intuition seems to assume there
is one prop gadget per container, because if you click anywhere in
the container, the gadget moves toward the click by a single increment.
This makes no sense if there are a ton of gadgets in the same container.
(I refer to Libs & Devices p. 84)

My question is, can I use Proportional gadgets for what I want to do?
If so, how do I get around this container problem?  If not, how
should I solve this problem?  (I assumed this was a tailor made application
for prop gadgets!)  I see "hacking" up a stationary set of gadgets,
and using followmouse as a possibility, but a gross one.

Any ideas? thanks,
dylan
-- 
dylan mcnamee             / "Ten Years After WWIV...there wasn't much to do;
dylan@cs.washington.edu \/all the bowling alleys were wrecked, so I spent most 
                         of my time looking for beer"  from Strange Brew

ken@cbmvax.commodore.com (Ken Farinsky - CATS) (02/27/91)

In article <15187@june.cs.washington.edu> dylan@june.cs.washington.edu (Dylan McNamee) writes:
>
>I am writing a DTP program that has a set of drafting tools.  Since
>it is built on top of Post, I use PostScript objects.  Once an object
>is on the screen, I want to be able to select it, and have a set of
>proportional gadgets show up for the object (the endpoints of a line,
>or the control points of a bezier, etc.) to allow the user to manipulate
>the object.
>
>My question is, can I use Proportional gadgets for what I want to do?
>If so, how do I get around this container problem?  If not, how
>should I solve this problem?  (I assumed this was a tailor made application
>for prop gadgets!)  I see "hacking" up a stationary set of gadgets,
>and using followmouse as a possibility, but a gross one.

If I understand what you are asking and what you are trying to do, the
answer is "no".  Overlapping proportional gadgets do not make sense
as the top one would eat all the mouse events, and it is not clear
from a given mouse event on which gadget to operate.

I assume that you want to attach "select points" to important positions
on the display (such as the ends of lines, etc.)  My suggestion would be
to use a single, large, boolean gadget with no highlighting, which covers
the entire display area.  The window should be GADGIMMEDIATE, FOLLOWMOUSE
and RELVERIFY.  When the user clicks in the gadget, the program will receive
a GADGETUP, a bunch of MOUSEMOVEs, followed by either a GADGETUP or
a MOUSEBUTTONS with the SELECTUP qualifier.  You'll have to do your
own calculations as to which point was selected and what the action was.
-- 
--
Ken Farinsky - CATS - (215) 431-9421 - Commodore Business Machines
uucp: ken@cbmvax.commodore.com   or  ...{uunet,rutgers}!cbmvax!ken
bix:  kfarinsky