home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d4xx / d430 / smartfields.lha / SmartFields / Functions / field_clear.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-11  |  1.4 KB  |  45 lines

  1. /***************************************
  2. *  FIELD CLEAR v1.34
  3. *  © Copyright 1988 Timm Martin
  4. *  All Rights Reserved
  5. ****************************************/
  6.  
  7. #include <exec/io.h>
  8. #include <exec/types.h>
  9. #include <intuition/intuition.h>
  10. #include <console/fields.h>
  11. #include <console/functions.h>
  12. #include <toolkit/toolkit.h>
  13.  
  14. int field_clear( header, first, count, place )
  15.   struct FieldHeader *header;
  16.   struct Field *first;
  17.   UINT   count;
  18.   struct Field *place;
  19. {
  20.   struct Field *field;            /* for stepping thru field list */
  21.   int    i = 0;                   /* to count number of fields cleared */
  22.   void   RectFill();              /* graphics.library */
  23.   void   SetAPen();               /* graphics.library */
  24.   void   strcpy();                /* standard C library */
  25.  
  26.   field = first;
  27.   cursor_invisible( header->WriteReq );
  28.   while (field && i < count) {
  29.     SetAPen( header->Window->RPort, (long)(field->BackPen) );
  30.     RectFill( header->Window->RPort, (long)(field->Left), (long)(field->Top),
  31.               (long)(field->Right - header->Window->BorderRight),
  32.               (long)(field->Bottom - header->Window->BorderBottom) );
  33.     if (field->DupBuffer)
  34.       strcpy( field->DupBuffer, field->Buffer );
  35.     *(field->Buffer) = '\0';
  36.     field->NumChars = field->BufferPos = 0;
  37.     field = field->NextField;
  38.     i++;
  39.   }
  40.   if (place)
  41.     field_goto( header, place );
  42.  
  43.   return (i);
  44. }
  45.