#Modula-2 Oxxi Gadgets
11 messages in this thread
Steve,
I am having some problems getting some gadgets to work the way I want to,
and wondered if you might have any suggestions. I have 3 Boolean text gadget's,
in a requester; I would like to select one, and have that deselect the other
two.
Since MutualExclusion is not working for gadget's yet, I have had to come up
with some cludge's.
First I tried OffGadget on all three, selecting and deselecting, then
OnGadget, and RefreshGList. While this made the gadget's blink quite nicely, it
didn't do what I wanted to!
Now I EndRequest, select and deselect, and then Request, which works OK,
except that the request blinks once, which does not look good. Here's the code
that I finally came up with…
PROCEDURE SwitchSel(gp1,gp2,gp3:GadgetPtr);
BEGIN
EndRequest(rp^,wp^);
IF NOT (Selected IN gp1^.Flags) THEN
INCL(gp1^.Flags,Selected);
END;
IF (Selected IN gp2^.Flags) THEN
EXCL(gp2^.Flags,Selected);
END;
IF (Selected IN gp3^.Flags) THEN
EXCL(gp3^.Flags,Selected);
END;
DC := Request(rp^,wp^);
END SwitchSel;
… any suggestion's?
Thanks,
Jim Vogel
Hi Jim:
I realise your message was for Steve but I thought I might be able to help.
The proper way to disable/enable gadgets is with OnGadget()/OffGadget() and it
really works, I checked. However, here is the problem the text is rendered
again when you issue a call to OnGadget() but the ghost pattern is still their
and is not erased. If you try OnGadget()/OffGadget() with an Image based gadget
you will notice it works just fine, because the whole image is redrawn. In
order to work properly you have to clear the rectangle where the text gadget is
located and then do a call to OnGadget(). I hope that helps.
>> Leon <<
Leon,
Your help is allways appreciated! I had known about that about image gadget's
but find that text gadgets are less work. when you say clear the rectangle,
what do you mean? It would look a lot a lot better that way.
Also, is there going to be any improvment's in the editor from Oxxi? I would
like to see three things added; 1. Allow the keypad keys to work like an IBM
keypad, with home, end, page up, ect.
2. Allow the mouse to work like a cut and paste(like textcraft) and
highlight as you mark.
3. Allow programing of the keys for often used words, like PROCEDURE,
MODULE BEGIN, END, ECT.; somewhat like what is available in UEDIT, and turbo
Pascal.
Thanks,
Jim Vogel
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 <<
Leon,
Thanks for the hint, will see how that will fit into my program. I think I
see what you mean; I had never used rectangle fill before, so didn't know about
it.
Hope I didn't seem like I was bitching, I really like BenchMark; It's great
by itself, but compared to the TDI it SUPERGREAT!! Wish I had seen it before I
upgraded to their commercial, what a waste.
The only other thing is the they had good customer concern in the begining,
but seemed to lose it(don't know why). Hope that that doesnot happen to Oxxi, I
have had a good response every time I've delt with them.
Thanks for listening,
Jim Vogel
Are any of you like me, i.e. looking in the mail wondering if TDI is going to
send me anything. Even a notice of discontinuance of their support for the
Amiga Modula-2 compiler. Me thinks that their correspondence with the boys in
England is handled by sea going vehicles. Maybe that's where Joyce came up with
the name for his book!
Wouldn't RefreshGadgets do the trick? I haven't tried it with a Requester but
it will take a Requester as an argument.
Erv, That would work for an image gadget, but a text gadgets doesn't refresh
the entire gadget, it just re-renders the text. (hope this is right… just
heard someone mention it earlier).
Regards, Larry.
Well, I guess you've already got your answer from the best source around, so
I'll leave it at that…
– Steve –