[comp.sys.amiga] Egad!! Changes already??

crunch@well.UUCP (12/11/86)

TIPS ON USING EGAD
------------------

   By now,  people have sucessfully "made" an EGAD program,  or you might
have recieved your FISH disk 46 (I think) by now.   In either case,  I
just want to give everyone some tips on using it and some "workarounds"
to some bugs I found.


ON SETTING FLAGS
----------------

   If you have "made" some gadgets by drawing out the rectangle with the
RIGHT mouse button,   and THEN set the flags,   you might have a few
problems.   So,   it's important for you to set the flags FIRST before
you draw out the rectangle in the window.


ON CHANGING THE SIZE OF GADGETS WITH IMAGES
-------------------------------------------

   One small forsight we have missed, is not covering the case where we
change the gadget size of a boolean or propgadget.   If one attempts to
change the size of the gadget which is using an image,   it might trash
the system.   In our next release,   we will have that fixed.    In the
meantime,   you can first DELETE the gadget and add a new one.

   Another problem,  is when you specify 4 bitplanes, like typing: "egad 4"
to start it up,   and make a few gadgets,  if you save the gadget set file
then leave the program,  if you expect to go back and edit the gadget set 
again,   and don't specify 4 bitplanes (believe me,  it's easy to forget),
the system integrity may be flakey. Again,  I just want to bring this to 
your attention.


GOOD HABITS TO PICK UP ON
-------------------------

   If you're working on a large gadget set,   it might be a good idea to
ocassionally save your gadget set,   like after each one you make.   As 
I have had some problems.   It doesn't happen very often,   so until I can
isolate the problem (or if someone else does),  just be careful.


HERE ARE SOME CHANGES
---------------------

   And now,  our first change:   In men.c there is some code that I put in
where I specify the image size of the "slider knob" of a Proportional gadget
wrong.    I do some "tweaking" so the image data just covers the "inside"
area of the Proportional "body".    This code was put in the wrong place,
so if you happen to make boolean gadgets,   this "tweaked" size also appears
in Boolean gadgets.    So,   here's the change in "men.c":    Look for
*****>>   marker at left column.

----------------------------  OLD PIECE ------------------------------
           case SET_IMAG_BORD: /* Add GadgetRender */
                      if (SelectedGadget == NULL) {
                           autoreq(
                         "First click on the gadget you want to add the image
to.",
                                       " OK ","Right");
                           SelectedGadget = NULL;
                           break;
                          }
              i = curgad;
              curgad = findadr(gads,SelectedGadget,nextgad);
              if (curgad == -1) {
                 kprintf("couldn't find selected gad in gads array!!\n");
                 break;
              }
              if (nextgad) {
                  if (!get_req_name("Enter Image Name", gadimage[curgad])) {
                     SelectedGadget = NULL;
                     break;
                  }
                  flags = (long)SelectedGadget->UserData;
                  wid = SelectedGadget->Width;    /* Image width */
                  hgt = SelectedGadget->Height;   /* Image Width */
		  
*****>>           hgt -= 3;   /* This is NOT correct */
*****>>           wid -= 8;   /* And here,  so delete this line */

                  if (SelectedGadget->GadgetType == PROPGADGET) {
                     pi = (struct PropInfo *)SelectedGadget->SpecialInfo;
                     if ((pi->Flags & FREEHORIZ) == FREEHORIZ) wid >>= 2;
                     if ((pi->Flags & FREEVERT)  == FREEVERT)  hgt >>= 2;
                  }


------------------------- NEW PORTION -----------------------------

           case SET_IMAG_BORD: /* Add GadgetRender */
                      if (SelectedGadget == NULL) {
                           autoreq(
                         "First click on the gadget you want to add the image to
.",
                                       " OK ","Right");
                           SelectedGadget = NULL;
                           break;
                }
         i = curgad;
              curgad = findadr(gads,SelectedGadget,nextgad);
           if (curgad == -1) {
              kprintf("couldn't find selected gad in gads array!!\n");
                 break;
              }
              if (nextgad) {
                  if (!get_req_name("Enter Image Name", gadimage[curgad])) {
                     SelectedGadget = NULL;
           break;
                  }
                  flags = (long)SelectedGadget->UserData;
                  wid = SelectedGadget->Width;    /* Image width */
                  hgt = SelectedGadget->Height;   /* Image Width */
                  if (SelectedGadget->GadgetType == PROPGADGET) {
 
****>>               /* ### JD - Moved "wid" & "hgt" tweak here */
****>>               wid -= 8;   hgt -= 3;
                     pi = (struct PropInfo *)SelectedGadget->SpecialInfo;
                     if ((pi->Flags & FREEHORIZ) == FREEHORIZ) wid >>= 2;
                     if ((pi->Flags & FREEVERT)  == FREEVERT)  hgt >>= 2;
                  }
 
******* IMPORTANT NOTE *******

   Please don't forget to change the case: SET_SEL_BORD code as well.  
It's almost the same.    In fact,  I'm sure some enterprising programmer
might be able to combine them.

   I think this is all for now,   I will probably have more later,  and
plan on posting a list of known bugs.    Speaking of bugs,  because I'm
posting the source,  please feel free to fix any bugs you might find
and mail me the fix.    

   For those just learning C or programming,   and if you find any bugs,
PLEASE PLEASE mail me and describe it.    Please spend a little time and
describe your environment,  such as:   1) Memory size,    2) Gadget type,
3) How many gadgets,   4) Also, please describe to me if you are using
intuitext (And if you have more than one),  or Images.    If you can,  also
please record the GURU number in your report.    Please make an attempt
to repeat the bug.    Try and describe the steps you took to re-create the
bug.    Intermittant bugs are almost IMPOSSIBLE to find.    

   I will probably ignore reports like:  "My system crashed when I exited
the image editor,  but I couldn't get it to happen every time".    At least
make an attempt to describe the last 10 steps (if any) you took that led
you to the GURU.     And mail all bug reports to:

John Draper - The programmers Network
"A global village of software developers and engineers"
WELL:  crunch
 BIX:  crunch
UUCP:  ihnp4!ptsfa!well!crunch
 CIS:  76703,4322