home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 454.lha / gadsel / gadsel.c < prev    next >
C/C++ Source or Header  |  1990-12-07  |  1KB  |  32 lines

  1. /*************************************************************************
  2. *
  3. *        file name:    gadsel.c
  4. *        author:        Thomas C. DeVeau
  5. *        creation date:    8-5-90
  6. *        purpose:    Gadget Selection function
  7. *
  8. **************************************************************************/
  9. #include "gadsel.h"   
  10.  
  11. void GadgetSelect(w,gp,gad,type,comp)
  12. struct Window *w;    /* controlling window */
  13. struct GadList *gp;    /* Gadgt list */
  14. SHORT gad;        /* gadget to select */
  15. USHORT type,comp;    /* type = GADGIMAGE or NULL, comp = Complement type
  16.                (i.e GADGHCOMP, GADGHIMAGE, GADGHNONE) */
  17. {
  18.     SHORT c,pos,apos;
  19.  
  20.     pos = RemoveGList(w,gp->GadgetList[0],gp->GadCount);
  21.     for(c = 0;c < gp->GadCount;c++)
  22.     {
  23.         gp->GadgetList[c]->Flags = type;
  24.         gp->GadgetList[c]->Activation = RELVERIFY+GADGIMMEDIATE;
  25.     }
  26.     gp->GadgetList[gad]->Flags = GADGIMAGE+comp+SELECTED;
  27.     gp->GadgetList[gad]->Activation = RELVERIFY+GADGIMMEDIATE+TOGGLESELECT;
  28.     apos = AddGList(w,gp->GadgetList[0],pos,gp->GadCount,NULL);
  29.     RefreshGList(gp->GadgetList[0],w,NULL,gp->GadCount);
  30. }
  31. /* end of file */
  32.