Subversion Repositories Kolibri OS

Rev

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

  1. #include "imgs\logo.txt"
  2.  
  3. void authors()
  4. {    
  5.         loop()
  6.         {
  7.                 switch(WaitEvent())
  8.                 {
  9.                         CASE evButton: ExitProcess();
  10.                         CASE evKey: IF (GetKey()==27) ExitProcess(); break;
  11.                         CASE evReDraw:
  12.                                 WindowRedrawStatus(1);
  13.                                 DefineAndDrawWindow(500,200,181,256,0x04,0x10EFEBEF,0,0,"About Eolite");
  14.                                 DrawBar(5,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
  15.                                 PutPaletteImage(#logo,85,85,48,7,#logo_pal);
  16.                                 WriteText(32,100,0x80,0xBF40BF,"Eolite v0.97.2 beta7",0);
  17.                                 WriteText(60,120,0x80,0,"Developers:",0);
  18.                                 WriteText(44,130,0x80,0,"Leency & Veliant",0);
  19.                                 WriteText(35,140,0x80,0,"Lrz, Diamond, Nable",0);
  20.                                 WriteText(26,160,0x80,0,"Made using C-- in 2008",0);
  21.                                 WriteText(23,170,0x80,0,"Visit www.kolibrios.org",0);
  22.                                 DrawFlatButton(90,190,70,22,2,0xE4DFE1, "Close");
  23.                                 WindowRedrawStatus(2);
  24.                 }
  25.         }
  26. }
  27.  
  28.  
  29. dword ConvertSize(dword bytes)
  30. {
  31.         char size_prefix[7], temp[3];
  32.         IF (bytes>=1073741824) copystr(" Gb",#temp);
  33.         ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
  34.         ELSE IF (bytes>=1024) copystr(" Kb",#temp);
  35.         ELSE copystr(" b ",#temp);
  36.         WHILE (bytes>1023) bytes/=1024;
  37.         copystr(IntToStr(bytes),#size_prefix);
  38.         copystr(#temp,#size_prefix+strlen(#size_prefix));
  39.         EAX=#size_prefix;
  40. }
  41.  
  42.  
  43. void Sort_by_Size(int a, b)   // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
  44. {                                        
  45.         int i= a;
  46.         IF (a >= b) return;
  47.         FOR (j = a; j <= b; j++)
  48.         {
  49.                 IF (ESDWORD[file_mas[j]*304 + buf+72-8] <= ESDWORD[file_mas[b]*304 + buf+72-8])
  50.                 { file_mas[i] >< file_mas[j];   i++;}
  51.         }
  52.         Sort_by_Size (a, i-2);
  53.         Sort_by_Size (i, b);
  54. }
  55.  
  56.  
  57. void Sort_by_Name(int a, b)   // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
  58. {                                        
  59.         int i = a;
  60.         IF (a >= b) return;
  61.         FOR (j = a; j <= b; j++)
  62.                 IF (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[i] >< file_mas[j];   i++;}
  63.         Sort_by_Name(a, i-2);
  64.         Sort_by_Name(i, b);
  65. }
  66.  
  67.  
  68. int partition1(dword a, b)
  69. {
  70.         dword i = a; byte filename1[256], filename2[256]; int n;
  71.         for (j = a; j <= b; j++)
  72.         {
  73.             //
  74.                 copystr(file_mas[j]*304 + buf+72, #filename1);
  75.                 copystr(file_mas[b]*304 + buf+72, #filename2);
  76.                 n=strlen(#filename1)-1;
  77.                 WHILE (filename1[n]<>'.') && (n>0) n--;
  78.                 IF (n) copystr(#filename1+n+1, #filename1);
  79.                 n=strlen(#filename2)-1;
  80.                 WHILE (filename2[n]<>'.') && (n>0) n--;
  81.                 IF (n) copystr(#filename2+n+1, #filename2);
  82.                 //
  83.                 n=strcmp(#filename1, #filename2);
  84.                 IF (n<0) { file_mas[i] >< file_mas[j];   i++;}
  85.                 IF (n==0) && (strcmp(file_mas[j]*304 + buf+72, file_mas[b]*304 + buf+72)<=0) { file_mas[i] >< file_mas[j];   i++;}
  86.         }
  87.         EAX = i-1;
  88. }
  89.  
  90. void Sort_by_Type(dword a, b)   // äëÿ ïåðâîãî âûçîâà: a = 0, b = <ýëåìåíòîâ â ìàññèâå> - 1
  91. {                                        
  92.         int c;
  93.         IF (a >= b) RETURN;
  94.         c = partition1(a, b);
  95.         Sort_by_Type(a, c-1);
  96.         Sort_by_Type(c+1, b);
  97. }
  98.  
  99.  
  100.