[comp.sys.amiga.tech] 2.0's 3D gadgets. How?

davids@cup.portal.com (David Kenneth Schreiber) (09/17/90)

Is there something special I have to do so that the various system gadgets
(depth, close, etc.) look 3Dish on a custom screen?  I've been experimenting
with a 640x400x2 screen with the same palette, DetailPen, and BlockPen as
the Workbench screen, but none of the default gadgets (or the gadgets
in the default file requestor) have the normal 2.0 look.  What have I 
missed (the NewScreen and NewWindow structures are set up exactly as they
would be under 1.3)?  I'm running KS version 36.141 and SAS/C 5.10 on a 
3000.  Thanks. 

-Dave Schreiber at davids@cup.portal.com   Trial quote #3:
"Because of his close personal ties with Satan, [the instructor] was
able to compute the square root of any number with record speed."

peter@cbmvax.commodore.com (Peter Cherna) (09/17/90)

In article <33989@cup.portal.com> davids@cup.portal.com (David Kenneth Schreiber) writes:
>Is there something special I have to do so that the various system gadgets
>(depth, close, etc.) look 3Dish on a custom screen?  I've been experimenting
>with a 640x400x2 screen with the same palette, DetailPen, and BlockPen as
>the Workbench screen, but none of the default gadgets (or the gadgets
>in the default file requestor) have the normal 2.0 look.  What have I 
>missed (the NewScreen and NewWindow structures are set up exactly as they
>would be under 1.3)?  I'm running KS version 36.141 and SAS/C 5.10 on a 
>3000.  Thanks. 

There is a way, and it's not hard.

Unfortunately, Intuition has no way of determining the right colors to
use for all the fancy 3D-appearance unless you tell it.

Intuition has several pens it needs definitions for.  In order, here they
are.  (The values used for the Workbench screen are shown in brackets).

detailPen - Same as screen's DetailPen.  Used for things like text in
	the screen title. (Gray on WB)
blockPen - Same as screen's BlockPen. Used for the screen drag bar itself.
	(Black on WB)
textPen - Normal color for text.  This is usually pen 1.  (Black on WB)
shinePen - Color to use for the bright edges of 3D objects.  (White on WB)
shadowPen - Color to use for dark edges of 3D objects.  (Black on WB)
hifillPen - Color to fill active areas, like the border of the active
	window.  Clever gadgets highlight to this color.  (Blue on WB)
hifilltextPen - Text to use over hifillPen.  The title of the active
	window uses this pen.  (Black on WB)
backgroundPen - Background color.  Normally pen zero.  (Gray on WB)
hilighttextPen - A bright text color used on the normal background.
	The preferences editors use this color.  (Blue on WB)

To specify these pens, you need to pass the SA_Pens tag item to
OpenScreenTags().  Create an array of UWORD, terminated by ~0.
For the WB, you would have

wbPens = {0, 1, 1, 2, 1, 3, 1, 0, 3, ~0};

Then you would say

	myscreen = OpenScreenTags(&mynewscreen,
		SA_Pens, wbPens,
		TAG_DONE);

If you want to be 1.3-compatible as well, then you should set
the NS_EXTENDED bit in NewScreen->Flags, and use the ExtNewScreen
structure, which can contain a pointer to the tag-list with SA_Pens
in it.  You can pass the ExtNewScreen to OpenScreen() and 1.3
will ignore it.

>-Dave Schreiber at davids@cup.portal.com   Trial quote #3:

     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.
"Very strange... the window is broken on both sides."