Subversion Repositories Kolibri OS

Rev

Rev 2134 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. //Leency - 2011
  2.  
  3. #include "imgs\logo.txt"
  4.  
  5. #define REDRAW  1
  6. #define ANIM    2
  7. #define NOTIP   3
  8.  
  9. #define BROWSER_PATH    "/sys/htmlv"
  10. #define BROWSER_LINK    "http://www.kolibri-os.narod.ru"
  11.  
  12.  
  13. void authors()
  14. {  
  15.         byte p;
  16.         mouse mm;
  17.         byte id, letitclose=0;
  18.         SetEventMask(100111b);
  19.         loop() switch(WaitEvent())
  20.         {
  21.                 case evMouse:
  22.                                 mm.get();
  23.                                 //êóëüíî
  24.                                 IF (mm.x>85) && (mm.x<155) && (mm.y>190) && (mm.y<190+22)
  25.                                 IF (mm.lkm) {DrawRegion_3D(86,191,68,20,0xC7C7C7,0xFFFFFF); letitclose=1;}
  26.                                 ELSE {IF (letitclose) {DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7); Pause(7); ExitProcess();}}
  27.                                 ELSE IF (letitclose) {letitclose=0; DrawRegion_3D(86,191,68,20,0xFFFFFF,0xC7C7C7);}
  28.  
  29.                                 /*WHILE (mm.lkm==1) //àíèìàöûÿ Ûûûû)))
  30.                                 {
  31.                                         PutPaletteImage(p*16*15+#ficons,16,15,30,192,#ficons_pal);
  32.                                         IF (p>23) p=0; ELSE p++;
  33.                                         Pause(25);
  34.                                         mm.get();
  35.                                 }*/
  36.                                
  37.                                 break;
  38.                 case evButton:
  39.                                 id=GetButtonID();
  40.                                 IF (id==1) ExitProcess();
  41.                                 IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK);
  42.                                 break;
  43.                 case evKey:
  44.                                 IF (GetKey()==27) ExitProcess();
  45.                                 break;
  46.                 case evReDraw:
  47.                                 DefineAndDrawWindow(500,200,181,256,0x34,0x10EFEBEF,0,0,"About Eolite");
  48.                                 DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
  49.                                 PutPaletteImage(#logo,85,85,43,7,#logo_pal);
  50.                                 WriteText(33,100,0x80,0xBF40BF,"Eolite v0.99.8 RC3",0);
  51.                                 WriteText(55,120,0x80,0,"Developers:",0);
  52.                                 WriteText(39,130,0x80,0,"Leency & Veliant",0);
  53.                                 WriteText(30,140,0x80,0,"Diamond, Lrz, Nable",0);
  54.                                 WriteText(55,150,0x80,0," 2008-2011 ",0);
  55.                                 WriteText(12,170,0x80,0,"Visit",0);
  56.                                 DrawLink(48,170,23, "kolibri-os.narod.ru"); //ññûëêa
  57.                                 DrawFlatButton(85,190,70,22,0,0xE4DFE1, "Close");
  58.         }
  59. }
  60.  
  61. void DrawLink(dword x,y,btn_id, inscription)
  62. {
  63.         WriteText(x,y,0x80,0x4E00E7,inscription,0);
  64.         DrawBar(x,y+8,strlen(inscription)*6,1,0x4E00E7); //ïîä÷åðêíóòü ññûëêó
  65.         DefineButton(x-1,y-1,strlen(inscription)*6,10,btn_id+BT_HIDE,0);
  66. }
  67.  
  68.  
  69. #define add_new_path 1
  70. #define go_back 2
  71.  
  72. void HistoryPath(byte action)
  73. {
  74.         if (action==add_new_path)
  75.         {
  76.                 IF (strcmp(#PathHistory+find_symbol(#PathHistory,'|'),#path)==0) return;
  77.                 IF (strlen(#PathHistory)+strlen(#path)>2560)
  78.                 {
  79.                         copystr(#PathHistory+1024,#PathHistory);
  80.                         copystr("/",#PathHistory+strlen(#PathHistory));
  81.                 }
  82.                 copystr("|",#PathHistory+strlen(#PathHistory));
  83.                 copystr(#path,#PathHistory+strlen(#PathHistory));
  84.         }
  85.         if (action==go_back)
  86.         {
  87.                 i=strlen(#PathHistory)-1;
  88.                 WHILE (PathHistory[i]<>'|') { i--; };
  89.                 IF (i>0) PathHistory[i]=0x00;
  90.                 WHILE (PathHistory[i]<>'|')     { copystr(#PathHistory[i],#path); i--;  }
  91.                 IF (i>0) PathHistory[i]=0x00;
  92.         }
  93. }
  94.  
  95.  
  96. dword onLeft(dword right,left) {EAX=Form.width-right-left;}
  97. dword onTop(dword down,up) {EAX=Form.height-GetSkinWidth()-down-up;}
  98.  
  99.  
  100. void ShowMessage(dword message)
  101. {
  102.         DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, message);
  103.         Pause(150);
  104.         List_ReDraw();
  105. }
  106.  
  107.  
  108. dword ConvertSize(dword bytes)
  109. {
  110.         byte size_prefix[8], temp[3];
  111.         IF (bytes>=1073741824) copystr(" Gb",#temp);
  112.         ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
  113.         ELSE IF (bytes>=1024) copystr(" Kb",#temp);
  114.         ELSE copystr(" b ",#temp);
  115.         WHILE (bytes>1023) bytes/=1024;
  116.         copystr(IntToStr(bytes),#size_prefix);
  117.         copystr(#temp,#size_prefix+strlen(#size_prefix));
  118.         EAX=#size_prefix;
  119. }
  120.