home *** CD-ROM | disk | FTP | other *** search
/ Enter 1998 December / ENTER12_1.iso / Dema / Cad_Proj.ekt / Mega48t / CC / ENTLOOP.C_ / ENTLOOP.C
Encoding:
C/C++ Source or Header  |  1995-01-10  |  1.5 KB  |  54 lines

  1. /**********************************************************************/
  2. #include "std.h"
  3. #include "megatyp.h"
  4. #include "megacad.h"
  5. #define MAXPIDS 500
  6. /**********************************************************************/
  7. char edta[32000];// Puffer für variable Daten
  8. ulong pids[MAXPIDS]; // Platz für 500 Element ID's
  9. ushort pidnum;  // Zähler für die Anzahl der Elemet ID's
  10. /**********************************************************************/
  11. short SelPid(
  12.         void *argptr )
  13. {
  14.     t_entity  *ent;
  15.  
  16.     ent = argptr;
  17.     if(ent->attr.col == GREEN)
  18.     {
  19.         pids[pidnum] = ent->id;
  20.         pidnum++;
  21.     }
  22.     if(pidnum == MAXPIDS)
  23.         return(BREAK_LOOP);
  24.     else
  25.         return(CONTINUE_LOOP);
  26. }
  27. /**********************************************************************/
  28. short DoDraw(
  29.         void *ptr )
  30. {
  31.     DrawEntities(pids,pidnum);
  32. }
  33. /**********************************************************************/
  34. short main(
  35.         char *filename,
  36.         char *args )
  37. {
  38.     t_entity ent;
  39.     ulong filter;
  40.  
  41.     // Anzahl auf 0 vorinitialisieren
  42.     pidnum = 0;
  43.     SetFuncText("Farbe invertieren");
  44.     MouseHelp("Element wählen","zurück",HLP_INV(0,0,0));
  45.     // Selektionskriterium -> alle Elemente erlaubt
  46.     filter = 0xffffffff;
  47.     // Schleife über alle Elemente
  48.     EntityLoop(filter,SelPid,&ent,edta,sizeof(edta));
  49.     // alle Elemente, deren ID jetzt in pids steht, blinken
  50.     Blink(DoDraw,NULL);
  51.     return(0);
  52. }
  53. /**********************************************************************/
  54.