#Modula-2 Oxxi Gadgets
13-Sep-87 19:09:06
Sb: #84829-#Modula-2 Oxxi Gadgets
Fm: Pat Cummings, OXXI 76367,1704
To: Jim Vogel 73177,441
Jim:
I am always glad to help. Here is a piece of code which I experimented with
for doing mutual exclude gadgets:
IF (gad = GadOne) THEN
WITH GadTwo^ DO
SetAPen(rp^, 0);
RectFill(rp^, LeftEdge, TopEdge, LeftEdge+Width, TopEdge+Width);
END;
OnGadget(GadTwo^, win^, NIL);
OffGadget(GadOne, win^, NIL); ELSIF (gad = GadTwo) THEN
WITH GadOne^ DO
SetAPen(rp^, 0);
RectFill(rp^, LeftEdge, TopEdge, LeftEdge+Width, TopEdge+Height);
END;
OnGadgetd(GadOne^, win^, NIL);
OffGadget(GadTwo^, win^, NIL); END;
Corrections: first RectFill() should have TopEdge+Height.
NOTE: The order of the calls to OneGadget()/OffGadget() is important OnGadget()
must be called right after calling RectFill()!
The EMACS editor included with Benchmark Modula-2 has been improved
significantly from the first release and will continue to be improved. Thank
you for your suggestions.
>> Leon <<