[comp.sys.mac.hypercard] Object Graphics

jacob@latcs1.oz.au (Jacob L. Cybulski) (09/10/90)

Is there any public or commercial utility to organise a set of MacDraw-like
tools allowing the construction of Hypercard cards of movable graphical
objects. Preferably, the objects would behave as HC buttons and have
scripts attached.

If there is no such tools available, how difficult would it be to
interface an XCMD to an independent program window and to control
all the graphics behaviour from HC?

I tried to trick HC into doing sort of primitive object-graphics with
buttons. So far I managed to construct a few object-like buttons, e.g. lines
and polygons, I am having quite a few problems refreshing the card as
draging objects across, or worse tracking the mouse clicks into a particular
button (if rectangular buttons are used as hosts for lines and polys then
they are going to overlap, quite a lot).

Perhaps HC 2.0 solves all these problems and provides an extensive set
of button shapes? Perhaps the window and program interface is better?
I am new to Hypercard so perhaps I missed something out?

Jacob L. Cybulski

Amdahl Australian Intelligent Tools Program
Department of Computer Science
La Trobe University
Budoora, Vic 3083, Australia

Phone: +613 479 1270
Fax:   +613 470 4915
Telex: AA 33143
EMail: jacob@latcs1.oz

greggor@Apple.COM (Greg L. Anderson) (09/10/90)

In article <8731@latcs1.oz.au> jacob@latcs1.oz.au (Jacob L. Cybulski) writes:
>Is there any public or commercial utility to organise a set of MacDraw-like
>tools allowing the construction of Hypercard cards of movable graphical
>objects. Preferably, the objects would behave as HC buttons and have
>scripts attached.

I have written an XCMD polygon button handler for HC 1.2.5 that does about
half of what you want.  The polygons are all transparant autohilite--drawing
non-transparant objects on a hypercard card is not feasible, as there is no
easy way to give your XCMD's update events.  Tail-patching WaitNextEvent
would work--if tail-patching in general worked, which it doesn't.  If anyone
has any ideas about drawing on HC's card in non-XOR mode, I'd like to hear
them too.

My XCMD detects clicks on the polybuttons by intercepting mouseDown events
on the card or bg layer, building a region for each polybutton, and checking
PtInRegion to find hits.  This process is actually pretty fast--it takes
about 20 ticks from the mousedown event until the time the polybutton's script
takes control.

If anyone is interested in this XCMD, I might clean it up and post it.
Some manual setup is required.
-- 
  ___\    /___               Greg Anderson              ___\    /___ 
  \   \  /   /         Advanced Technology Group        \   \  /   /
   \  /\/\  /            Apple Computer,  Inc.           \  /\/\  /
    \/    \/               greggor@apple.com              \/    \/