[comp.sys.mac.programmer] Rectangles in DITL's

nick@lfcs.ed.ac.uk (Nick Rothwell) (06/14/89)

Can somebody give a quick explanation of the Rect's in some of the
dialog DITL's, in particular for CNTL dialog items (scroll-bars and
the like, although I'm using custom CDEF's). The CNTL contains a rect,
and the DITL item contains a rect as well. Which gets used?  Can I
safely set the other one to (0,0,0,0)?
   I've tried poking about with ResEdit, but it doesn't behave well
with DITL's. Double-clicking such an item throws you straight into the
CNTL. (well, quite often it throws you straight into the nearest
bomb-box... :-< )

		Nick.
--
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcvax!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
               Fais que ton reve soit plus long que la nuit.

oster@dewey.soe.berkeley.edu (David Phillip Oster) (06/15/89)

In article <2354@etive.ed.ac.uk> nick@lfcs.ed.ac.uk (Nick Rothwell) writes:
_>Can somebody give a quick explanation of the Rect's in some of the
_>dialog DITL's, in particular for CNTL dialog items (scroll-bars and
_>the like, although I'm using custom CDEF's). The CNTL contains a rect,
_>and the DITL item contains a rect as well. Which gets used?  Can I
_>safely set the other one to (0,0,0,0)?
Both are used: The control is "drawn" first at the rectangle in the CTRL
resource, then resized by the one in the DITL. (This doesn't matter for
CDEFs, much. I believe if you give a tall rectangle in the CTRL and a wide
one in the DITL you'll get a really funny looking scroll bar.
They don't have to have the same left corner, but the safest thing, for
a custom CDEF, is to make them the same size.
_>   I've tried poking about with ResEdit, but it doesn't behave well
_>with DITL's. Double-clicking such an item throws you straight into the
_>CNTL.
If your custom CDEF is correct, then you must be using an ancient version
of ResEdit. Get  a new version from APDA.
Modern ResEdits include a "open as dialog item" for just such an
occasion.

--- David Phillip Oster            --"Unix Version 7 was an improvement not
Arpa: oster@dewey.soe.berkeley.edu --only over its predeccessors, but also its
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --successors."

jkjl@murtoa.cs.mu.oz (John Keong-Jin Lim) (06/15/89)

The difference between the CNTL rect and the DITL rect is that
the CNTL rect is the dimensions of the control. The DITL rect is
the rectangle that the CNTL rect is mapped onto.

Thus if the CNTL rect is {0,0,20,20} and the DITL rect is
{10,10,50,50} the control now appears 4 times (2x2) larger
than normal and offset by {10,10}.

Hope this helps.

	john

ps : thanks for the $$, nick.

nick@lfcs.ed.ac.uk (Nick Rothwell) (06/19/89)

In article <1586@munnari.oz.au>, jkjl@murtoa (John Keong-Jin Lim) writes:
>The difference between the CNTL rect and the DITL rect is that
>the CNTL rect is the dimensions of the control. The DITL rect is
>the rectangle that the CNTL rect is mapped onto.
>
>Thus if the CNTL rect is {0,0,20,20} and the DITL rect is
>{10,10,50,50} the control now appears 4 times (2x2) larger
>than normal and offset by {10,10}.

I tried that, I think, and found it didn't work - the control would
appear somewhere strange. I now make them *both the same*, for example,
{0, 100, 50, 150}, and this seems to work - the control appears at
(0, 100), (50, 150). 

>	john
>
>ps : thanks for the $$, nick.

Ok. - I wonder if you can cash it?

		Nick.
--
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcvax!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
               Fais que ton reve soit plus long que la nuit.