Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!lll-lcc!well!crunch From: crunch@well.UUCP (John Draper) Newsgroups: comp.sys.amiga Subject: Egad!! Its done!! Message-ID: <2117@well.UUCP> Date: Tue, 25-Nov-86 04:15:55 EST Article-I.D.: well.2117 Posted: Tue Nov 25 04:15:55 1986 Date-Received: Tue, 25-Nov-86 20:14:43 EST Reply-To: crunch@well.UUCP (John Draper) Organization: Whole Earth Lectronic Link, Sausalito CA Lines: 243 ALL ABOUT THE GADGET EDITOR or "Egad!! Its almost here!! --------------------------- by John Draper Programmers Network On Sunday, I went over to Ray Larson's place in Berkeley and physically recieved his latest changes, on Monday, found and fixed a few nasty bugs, then hacked on it making lots of strange gadgets, control panels and lots of strange looking goodies that you can control with the mouse. We made a spiffy looking Graphic Equalizer for sound. Later, I made a nice looking Oscilloscope, and a few audio control panals. So, it looks like tonight is the final release night for EGAD, the spiffy little utility to ease your programming headaches. Ray Larson has left for a week, and he was the one that put the final touches on it. It's not perfet yet, but good enough to be called Ver 1.0. There are things that can crash it, but if you are careful and save your gadget set ocassionally, it will do good for you. There are things that we haven't checked yet, like asking it to read in a 4 bitplane gadget set when we entered it specifying 2. At the last moment, we decided to add more than 2 bitpanes. We can now have up to 4. Starting it up, at the CLI, type "egad " where "number" specifies the number of bitplanes you want. If you omit the number, the default is 2 bitplanes, then when you enter, you will get an empty window. Using the menu options, select the type of gadget you want, set the Activation and gadget flags, also the propinfo flags if appropriate, then using the RIGHT menu button, we draw out the rectangle specifying the gadget. Point to lower right to re-size it, or put cursor within window, press RIGHT button to move it. You can make as many of these "outlines" as you like. They only specify WHERE the gadgets go. To make them gadgets, you "Add new gadgets" using the "utility" menu. This makes it easy to make a lot of gadgets that are the same. We plan on adding CLONE GADGET as a future enhancement. It has a very nice self contained Image editor that can be linked into your OWN code that allows image editing. Upon exit, it returns a pointer to the Allocated Image and associated data. Other routines include converting Image to Bimap. The image editor allows line draw, pencil draw, box draw, and circle draw, and box fill. The Image editor has it's own menu set and remains active until we return the image. The Image editor entry allows editing of an existing image by passing it's structure pointer, or if NULL is passed, it edits a new image. Ray Larson did all this nice code. The IntuiText Editor allows font selection, text type ie: slanted, bold, etc, and you can set the forground and background pens. Text is actually displayed as you set them. Actually, the Gadget editor edited it's own nice IntuiText Requester panal that allows all this to happen. When you exit the IntuiText editor, you have this funney text stuck at the end of your cursor. You move the cursor and the text to where you want it, then press the left mouse button when you want to "stick" it there. You can have more than one IntuiText and can change them at any time. You can save as many Gadget set files as you like, they are VERY COMPACT and large sets of gadgets usually are less than 5k in size. You normally won't have to "Save as Source" until the very end. It can be done at any time. The source that you get is a separately compilable module that can be fed to the Manx C compiler. All you need to know are the Gadget names. It's also smart enough to add the #include's for all the appropriate header files that know about the Gadget stuff. It also has "fontinfo" structure according to your IntuiText needs. Here is the sample output for the Graphic Equalizer I talked about earlier. None of this code was generated by a human. /********************************************************************** * Gadget Structure Definitions * * The following structures were defined using the Gadget Editor created * by the Programmer's Network. * The credits for the Gadget Editor are: * * John Draper - Initial design, coordination, and integration. * Ray Larson - Images and Intuitext. * Brent Southard - Saving and restoring gadgets in binary form. * Dave Milligan - Gadget Editor Main menu. * * **********************************************************************/ /* The header files needed for gadget definitions */ #include #include #include #include #include #include #include #include /* Definitions for Gadget ID numbers */ #define LO1GAD 0 /********************************************************************** * Text attribute structures used in rendering IntuiTexts **********************************************************************/ char def_font[] ="topaz.font"; struct TextAttr TxtAt_Plain = { (UBYTE *)def_font, 8, FS_NORMAL, FPF_ROMFONT}; struct TextAttr TxtAt_BIU = {(UBYTE *)def_font, 8, FSF_BOLD | FSF_ITALIC | FSF_UNDERLINED, FPF_ROMFONT}; struct TextAttr TxtAt_BU = {(UBYTE *)def_font, 8, FSF_BOLD | FSF_UNDERLINED, FPF_ROMFONT}; struct TextAttr TxtAt_BI = {(UBYTE *)def_font, 8, FSF_BOLD | FSF_ITALIC, FPF_ROMFONT}; struct TextAttr TxtAt_B ={(UBYTE *)def_font, 8, FSF_BOLD, FPF_ROMFONT}; struct TextAttr TxtAt_IU ={(UBYTE *)def_font, 8, FSF_ITALIC | FSF_UNDERLINED, FPF_ROMFONT}; struct TextAttr TxtAt_I ={(UBYTE *)def_font, 8, FSF_ITALIC, FPF_ROMFONT}; struct TextAttr TxtAt_U ={(UBYTE *)def_font, 8, FSF_UNDERLINED, FPF_ROMFONT}; /***************************************************************/ /* The following data structure contains the image data */ /***************************************************************/ USHORT loimage_dat[]= { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /***************************************************************/ /* The following data structure defines the image */ /***************************************************************/ struct Image loimage = { 0, 16, /* Left, Top */ 62, 22, /* Width, Height */ 4, /* Depth */ (USHORT *)&loimage_dat, /* ImageData */ 0xff, /* PlanePick */ 0x00, /* PlaneOnOff */ NULL /* Next Image */ }; /***************************************************************/ /* The following data structure contains the image data */ /***************************************************************/ USHORT sel_dat[]= { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /********************************************************************** * IntuiTexts for the lo1 gadget. **********************************************************************/ struct IntuiText lo1_Text_0 = { 1, 0, /* FrontPen, BackPen */ JAM2, /* DrawMode */ 10, -8, /* LeftEdge, TopEdge */ &TxtAt_Plain, /* ITextFont Pointer */ /* The IText */ (UBYTE *)"50-100", NULL }; /********************************************************************** * Proportional gadget info for the lo1 gadget. **********************************************************************/ struct PropInfo lo1_prop_1 = { /* Flags */ FREEVERT | KNOBHIT, 0x0000, 0x0000, /* HorizPot, VertPot */ 0x1000, 0x1000, /* HorizBody, VertBody */ 70, 91, /* CWidth, CHeight */ 0x1111, 0x1111, /* HPotRes, VPotRes */ 4, 2 /* LeftBorder, TopBorder */ }; /********************************************************************** * Gadget Structure definition for the lo1 gadget. **********************************************************************/ struct Gadget lo1 = { NULL, /* NextGadget pointer */ 57, 48, /* LeftEdge, TopEdge */ 70, 91, /* Width, Height */ /* Gadget Flags */ GADGHNONE | GADGHIMAGE | GADGIMAGE, /* Activation Flags */ RELVERIFY | FOLLOWMOUSE, /* GadgetType */ PROPGADGET, (APTR)&loimage, /* GadgetRender */ (APTR)&sel, /* SelectRender */ &lo1_Text_0, /* GadgetText */ 0x0, /* MutualExclude */ (APTR)&lo1_prop_1, /* SpecialInfo */ LO1GAD, /* GadgetID */ 0xc /* UserData Pointer */ }; As you can see, the code is commented, and in about 10 minutes, any idiot can generate 80k of text file to feed to your C compiler, and it should compile it with NO ERRORS (unless EGAD has some bug we haven't found yet). Tommorrow, I plan on using EGAD to generate all my gadgets for my commercial product, and if I don't find anymore bugs, I will mail it to Fred Fish to include in his library. The WELL will get all 20 of the Source modules and Usenet will get them if the sites won't object because of the large volume of text. Then Compuserve and BIX will get it. And Cm on, UseNet folks please inform me if it's OK to post the Source??? Remember, it's 20 modules of Source code. And EGAD will ONLY work on 1.2 release, and compile under Manx 3.30c or better, and I don't know what Lattice will do after it "eats" it. And Cm'on Amiga and hurry up and get the 1.2 in the stores. So, Egad! Egad is done... EGAD!! Where did all those Gadgets come from.....EGAD!! Where did all this code come from, EGAD?? Crunch: Programmers Network, the Glogal Village Idiot.... WELL: crunch BIX: crunch UUCP: .....ihnp4!ptsfa!well!crunch CIS: 76703,4322