Subversion Repositories Kolibri OS

Rev

Rev 8043 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #define MEMSIZE 1024*40
  2.  
  3. #include "../lib/window.h"
  4. #include "../lib/timers.h"
  5.  
  6. window win1=0;
  7. dword timeID = 0;
  8. int t = 0;
  9. void intervalTest()
  10. {
  11.         t++;
  12.         if (t==10) clearInterval(timeID);
  13.         DrawBar(100, 70, 100, 100, 0xDED7CE);
  14.         WriteText(100,70,0x90,0,itoa(t));
  15. }
  16. void main()
  17. {
  18.         word id=0;
  19.         timeID = setInterval(#intervalTest, 100); // 100 => 1s
  20.         loop()
  21.         {
  22.                 switch(WaitEventTimeout(1))
  23.                 {
  24.                         case evButton:
  25.                                 id=GetButtonID();  
  26.                                 IF (id==1) ExitProcess();
  27.                                 break;
  28.                  
  29.                         case evKey:
  30.                                 GetKeys();
  31.                                 break;
  32.                          
  33.                         case evReDraw:
  34.                                 DefineAndDrawWindow(20,30,500,600,WINDOW_NORMAL,0xDED7CE,"Window",0);
  35.                                 if (!t) WriteText(100,70,0x90,0,"Start!");
  36.                                 break;
  37.                 }
  38.                 Timer.revise();
  39.         }
  40. }
  41.  
  42.