Subversion Repositories Kolibri OS

Rev

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

  1. #include <kolibri.h>
  2. #include <kos_heap.h>
  3. #include <kos_file.h>
  4.  
  5. using namespace Kolibri;
  6.  
  7. const char header[] = "Colors";
  8.  
  9. bool KolibriOnStart(TStartData &kos_start, TThreadData th)
  10. {
  11.         kos_start.Left = 10;
  12.         kos_start.Top = 40;
  13.         kos_start.Width = 135;
  14.         kos_start.Height = 80;
  15.         kos_start.WinData.WindowColor = 0xFFFFFF;
  16.         kos_start.WinData.WindowType = 0x34; // 0x34 - fixed, 0x33 - not fixed
  17.         kos_start.WinData.Title = header;
  18.         return true;
  19. }
  20.  
  21. void KolibriOnPaint(void)
  22. {
  23.         // If button have ID 1, this is close button
  24.         DrawButton(2,0xff0000, 10,40,50,20);
  25.         DrawButton(3,0x00ff00, 70,10,50,20);
  26.         DrawButton(4,0x0000ff, 70,40,50,20);
  27.         DrawButton(5,0xFFFE00, 10,10,50,20);
  28. }
  29.  
  30. void KolibriOnButton(long id, TThreadData th)
  31. {
  32.         switch(id){
  33.         case 2:
  34.                 SetWindowCaption("Red");
  35.                 break;
  36.         case 3:
  37.                 SetWindowCaption("Green");
  38.                 break;
  39.         case 4:
  40.                 SetWindowCaption("Blue");
  41.                 break;
  42.         case 5:
  43.                 SetWindowCaption("Yellow");
  44.                 //break;
  45.         };
  46. }
  47. /*
  48. int KolibriOnIdle(TThreadData th)
  49. {
  50.         return -1;
  51. }
  52. void KolibriOnSize(int window_rect[], TThreadData th) {}
  53. void KolibriOnKeyPress(TThreadData th)
  54. {
  55.         GetKey();
  56. }
  57. void KolibriOnMouse(TThreadData th) {}
  58. */
  59.