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

  1. /***************************************
  2. *  FIELD DISPLAY v1.25
  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_display( header, first, count, place )
  15.   struct FieldHeader *header;
  16.   struct Field *first;
  17.   UINT   count;
  18.   struct Field *place;
  19. {
  20.   struct Field *field;        /* to step trhu field list */
  21.   REG    UINT i = 0;          /* number of fields displayed */
  22.   int    strlen();            /* standard C library */
  23.  
  24.   field = first;
  25.   cursor_invisible( header->WriteReq );
  26.   while (field && i < count) {
  27.     if (header->Window->Width > field->Right &&
  28.         header->Window->Height > field->Bottom) {
  29.       cursor_place( header->WriteReq, field->Left, field->Top );
  30.       con_graphic_rend( header->WriteReq, field->Style, field->FrontPen, field->BackPen );
  31.       con_put_string( header->WriteReq, field->Buffer );
  32.     }
  33.     field->NumChars  = strlen( field->Buffer );
  34.     field->BufferPos = 0;
  35.     field = field->NextField;
  36.     i++;
  37.   }
  38.   if (place)
  39.     field_goto( header, place );
  40.  
  41.   return (i);
  42. }
  43.