[comp.sys.amiga.tech] ClipRect's, Intuition & User code..

bsyme@cs.strath.ac.uk (Brian J Syme IE88) (10/17/90)

Given the number of file requesters out there, I'm sure someone must have
come across this before.. RastPort's have a clipping rectangle facility
used (amongst other things) to implement overlapping windows. Is it possible
to 'and' in an additional clipping rectangle without disturbing Intuition's
use of them (for gadgets, etc.) in a manner similar to Begin/EndUpdate()
(or whatever it's called.)

I ask because I'm writing a file-requester type utility and I'd like to
be able to use proportional fonts in it, using a straightforward
Text(rp,string,strlen(string)); rather than working out the number of
characters of each string that will completely fit, or any other
indirect method.

I assume the answer to my question is "no, you can't" - if not is there
any other good way of doing this that someone would like to tell me!

...oh, and what's been done in 2.0 to support variable font's, colors, etc.
in string gadgets? Anything? Is it compatible with 1.3? Hmm?

Sorry if all this has been brought up before.

-- 
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
<> Brian Syme            <> Why make things difficult, when with just a     <>
<> bsyme@cs.strath.ac.uk <> little more effort you could make them          <>
<>                       <> impossible.                                     <>
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

peter@cbmvax.commodore.com (Peter Cherna) (10/18/90)

In article <4863@baird.cs.strath.ac.uk> bsyme@cs.strath.ac.uk (Brian J Syme IE88) writes:
>
>Given the number of file requesters out there, I'm sure someone must have
>come across this before.. RastPort's have a clipping rectangle facility
>used (amongst other things) to implement overlapping windows. Is it possible
>to 'and' in an additional clipping rectangle without disturbing Intuition's
>use of them (for gadgets, etc.) in a manner similar to Begin/EndUpdate()
>(or whatever it's called.)

See layers.library/InstallClipRegion().
>...oh, and what's been done in 2.0 to support variable font's, colors, etc.
>in string gadgets? Anything? Is it compatible with 1.3? Hmm?

String gadgets work correctly with proportional fonts.  There is an
extension structure StringExtend that allows you to specify what
font to use, as well as the pen colors for the text in the gadget.
1.3 will ignore this extension information.

><> Brian Syme            <> Why make things difficult, when with just a     <>

     Peter
--
     Peter Cherna, Software Engineer, Commodore-Amiga, Inc.
     {uunet|rutgers}!cbmvax!peter    peter@cbmvax.cbm.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"Television is a medium because it is neither rare nor well-done."

forgeas@swinjm.UUCP (Jean-Michel Forgeas) (10/19/90)

In article <4863@baird.cs.strath.ac.uk>, Brian J Syme IE88 writes:

> [...] Is it possible
> to 'and' in an additional clipping rectangle without disturbing Intuition's
> use of them (for gadgets, etc.) in a manner similar to Begin/EndUpdate()
> (or whatever it's called.)
>
> I assume the answer to my question is "no, you can't" [...]

Do not assume that. I just found (six month ago!) that Intuition have
a function to do that (since AmigaOS 1.2 :-).
(You have to open layers.library too)
Here an example:

MyClipList( rp, list )
{
  struct Rectangle rect;
  struct Region *oldregion, *listregion;

    if (! (listregion = (struct Region *) NewRegion())) return;
    rect.MinX = list->MinX; rect.MinY = list->MinY;
    rect.MaxX = list->MaxX; rect.MaxY = list->MaxY;
    if (! OrRectRegion( listregion, &rect ))
        {
        DisposeRegion( listregion );
        return;
        }
    oldregion = InstallClipRegion( rp->Layer, listregion );
    MyDrawList( rp, list );    /* <== it's there !!! */
    InstallClipRegion( rp->Layer, oldregion );
    DisposeRegion( listregion );
}

Note that if you need, you can add more rectangles to your listregion.

Best regards,
Jean-Michel
--
                                     \___/
Jean-Michel Forgeas                   \-/
cbmvax!cbmehq!cbmfra!swinjm!forgeas    |    The Software Winery
                                      -^-
                           And, where is the universe ?