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

  1. /***************************************
  2. *  FIELD RESHOW v1.37
  3. *  © Copyright 1988 Timm Martin
  4. *  All Rights Reserved
  5. ****************************************/
  6.  
  7. #include <exec/io.h>
  8. #include <exec/types.h>
  9. #include <graphics/text.h>
  10. #include <intuition/intuition.h>
  11. #include <console/fields.h>
  12. #include <console/functions.h>
  13. #include <toolkit/toolkit.h>
  14.  
  15. int field_reshow( header, first, count, place )
  16.   struct FieldHeader *header;
  17.   struct Field *first;
  18.   UINT   count;
  19.   struct Field *place;
  20. {
  21.   struct Field *field;            /* for stepping thru field list */
  22.   int    i = 0;                   /* number of fields reshowed */
  23.   int    strlen();                /* standard C library */
  24.  
  25.   field = first;
  26.   cursor_invisible( header->WriteReq );
  27.   while (field && i < count) {
  28.     if (field->Buffer)
  29.       field->NumChars = strlen( field->Buffer );
  30.     else
  31.       field->NumChars = 0;
  32.     field->BufferPos  = 0;
  33.     if (header->Window->Width  > field->Right &&
  34.         header->Window->Height > field->Bottom) {
  35.       cursor_place( header->WriteReq, field->Left, field->Top );
  36.       con_graphic_rend( header->WriteReq, field->Style, field->FrontPen, field->BackPen );
  37.       con_line_length( header->WriteReq, field->MaxChars );
  38.       con_char_mult_delete( header->WriteReq, field->MaxChars );
  39.       if (field->Buffer)
  40.         con_put_string( header->WriteReq, field->Buffer );
  41.     }
  42.     field = field->NextField;
  43.     i++;
  44.   }
  45.   if (place)
  46.     field_goto( header, field );
  47.  
  48.   return (i);
  49. }
  50.