amiga@ccwf.cc.utexas.edu (Paul) (11/14/90)
From ut-emx!cs.utexas.edu!uunet!cbmvax!peter Wed Sep 19 20:53:12 CDT 1990 Article 14826 of comp.sys.amiga.tech: Path: ut-emx!cs.utexas.edu!uunet!cbmvax!peter >From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.tech Subject: Re: 2.0's 3D gadgets. How? Message-ID: <14481@cbmvax.commodore.com> Date: 17 Sep 90 15:44:29 GMT References: <33989@cup.portal.com> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Distribution: usa Organization: Commodore, West Chester, PA Lines: 59 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); I am also trying to d this but I am having a few problems. I have tried my code as stated above and blink gives an undefined symbol _OpenScreenTags. Do I need to include somthing else? my includes are as follows #include <exec/types.h> #include <intuition/intuition.h> #include <intuition/screens.h> and part of my open routine UWORD wbPens[] = {0, 1, 1, 2, 1, 3, 1, 0, 3, ~0}; . . . if (! (FirstScreen = (struct Screen *) OpenScreenTags(&FirstNewScreen,SA_Pens,wbPens,TAG_DONE))) { printf("Intuition Screen cannot be found!\n"); Close_All(); exit(FALSE); } Yes, I do have my includes assign pointed to the 2.0 includes. >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. The above statement is confusing to me. Do you create a ExtNewScreen structure with a tag list pointer, that you pass to OpenScreen() and then set the NS_EXENDED flag? I tried it this way and could not get it to work either. I think my problem here is I'm not sure how to make a tag-list for this (or other things). A small code example of a tag would be helpful. >>-Dave Schreiber at davids@cup.portal.com Trial quote #3: >peter@cbmvax.cbm.commodore.com Thanks in advance for all your help. -- Amiga@ccwf.cc.utexas.edu .....Paul...... Listen to what I mean, not what I say.
peter@cbmvax.commodore.com (Peter Cherna) (11/14/90)
In article <39661@ut-emx.uucp> amiga@ccwf.cc.utexas.edu (Paul) writes: > (I wrote) >>wbPens = {0, 1, 1, 2, 1, 3, 1, 0, 3, ~0}; >> >>Then you would say > >> myscreen = OpenScreenTags(&mynewscreen, >> SA_Pens, wbPens, >> TAG_DONE); > >I am also trying to d this but I am having a few problems. >I have tried my code as stated above and blink gives an >undefined symbol _OpenScreenTags. Do I need to include somthing >else? my includes are as follows You need a 2.0-current version of amiga.lib. Alternately, you can define your own OpenScreenTags(), as follows struct Screen *OpenScreenTags( struct NewScreen *ns, Tag firsttag, ...) { return( OpenScreenTagList( ns, &firsttag ) ); } >The above statement is confusing to me. Do you create a ExtNewScreen >structure with a tag list pointer, that you pass to OpenScreen() and >then set the NS_EXENDED flag? I tried it this way and could not get >it to work either. I think my problem here is I'm not sure how to make >a tag-list for this (or other things). A small code example of a tag >would be helpful. Set the NS_EXTENDED flag in the ExtNewScreen structure before you call OpenScreen(). To make a taglist, you would say: struct TagItem mytags[] = { SA_Pens, (ULONG) mypens, TAG_DONE, 0, /* Need full tagitem, hence 0 after TAG_DONE */ }; struct ExtNewScreen myens = { ... ... | NS_EXTENDED, /* Set the extended flag */ ... /* usual newscreen stuff goes here */ mytags, /* taglist pointer */ }; ... screen = OpenScreen( (struct NewScreen *) myens ); >Amiga@ccwf.cc.utexas.edu .....Paul...... Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "She read him like a book: she liked to peek at his end."