Subversion Repositories Kolibri OS

Rev

Rev 7645 | Rev 7804 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. void Scroll() {
  3.         dword i;
  4.  
  5.         dword sc_x = files.x + files.w;
  6.         dword sc_y = files.y;
  7.         dword sc_h = files.h - 16;
  8.         dword sc_slider_y;
  9.         dword sc_center;
  10.  
  11.         if (files.count<=0)
  12.         {
  13.                 sc_slider_y = sc_y;
  14.                 sc_slider_h = sc_h - 1;
  15.         }
  16.         else
  17.         {
  18.                 sc_slider_y = files.first * sc_h / files.count + sc_y;
  19.                 sc_slider_h = sc_h * files.visible - files.visible / files.count;
  20.                 if (sc_slider_h < 20) sc_slider_h = 20; //minimal scroll width
  21.                 if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= sc_y + sc_h - sc_slider_h - 1; //фы  сюы№°юую ёяшёър
  22.         }
  23.         //slider
  24.         DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,col.graph);
  25.         DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2, system.color.work_light , system.color.work_dark);
  26.         if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[13-i]);
  27.         if (scroll_used)  for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[i]);
  28.  
  29.         sc_center = sc_slider_h / 2 + sc_slider_y;
  30.  
  31.         DrawBar(sc_x+4,   sc_center-3, 8,  1, col.graph);
  32.         DrawBar(sc_x+4+1, sc_center-2, 8,  1, system.color.work_light);
  33.  
  34.         DrawBar(sc_x+3,   sc_center,   10, 1, col.graph);
  35.         DrawBar(sc_x+3+1, sc_center+1, 10, 1, system.color.work_light);
  36.  
  37.         DrawBar(sc_x+4,   sc_center+3, 8,  1, col.graph);
  38.         DrawBar(sc_x+4+1, sc_center+4, 8,  1, system.color.work_light);
  39.  
  40.         //area before slider
  41.         if (sc_slider_y > sc_y + 1)
  42.         {
  43.                 DrawBar(sc_x+1, sc_y,   15, 1, col.slider_bg_left);
  44.                 DrawBar(sc_x+1, sc_y+1,  1, sc_slider_y-sc_y-1, col.slider_bg_left);
  45.                 DrawBar(sc_x+2, sc_y+1, 14, sc_slider_y-sc_y-1, col.slider_bg_big);
  46.         }
  47.         //area after slider
  48.         if (sc_h-sc_slider_h+sc_y-2>sc_slider_y)
  49.         {
  50.                 DrawBar(sc_x+1, sc_slider_y + sc_slider_h+1, 15, 1, col.slider_bg_left);
  51.                 DrawBar(sc_x+1, sc_slider_y + sc_slider_h+2,  1, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_left);
  52.                 DrawBar(sc_x+2, sc_slider_y + sc_slider_h+2, 14, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_big);
  53.         }
  54. }
  55.  
  56. void DrawFlatButtonSmall(dword x,y,width,height,id,text)
  57. {
  58.         DrawRectangle(x,y,width,height,col.graph);
  59.         DrawRectangle3D(x+1,y+1,width-2,height-2, system.color.work_light, system.color.work_dark);
  60.         PutPixel(x+width-1, y+1, system.color.work_dark);
  61.         DrawFilledBar(x+2, y+2, width-3, height-3);
  62.         if (id) DefineHiddenButton(x+1,y+1,width-2,height-2,id);
  63.         WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,system.color.work_text,text);
  64. }
  65.  
  66. void DrawFilledBar(dword x, y, w, h)
  67. {
  68.         int i, fill_h;
  69.         if (h < 12) {
  70.                 for (i=0; i<h; i++) DrawBar(x, y+i, w, 1, col.work_gradient[-i*3+15]);
  71.         } else {
  72.                 DrawBar(x, y, w, h, col.work_gradient[12]);
  73.         }
  74. }
  75.  
  76. int popin_w=260;
  77. void DrawEolitePopup(dword b1_text, b2_text)
  78. {
  79.         int but_x;
  80.         int popin_x = files.w - popin_w / 2 + files.x ;
  81.         DrawPopup(popin_x, 160, popin_w, 95, 1, system.color.work, col.graph);
  82.         but_x = DrawStandartCaptButton(popin_x+23, 215, POPUP_BTN1, b1_text);
  83.         DrawStandartCaptButton(popin_x+23 + but_x, 215, POPUP_BTN2, b2_text);
  84. }
  85.  
  86. void DrawDot(dword x,y) {
  87.         dword col_pxl = MixColors(col.graph, col.work, 60);
  88.         DrawBar(x+1,y,2,4,col.graph);
  89.         DrawBar(x,y+1,4,2,col.graph);
  90.         PutPixel(x,y,col_pxl);
  91.         PutPixel(x+3,y,col_pxl);
  92.         PutPixel(x,y+3,col_pxl);
  93.         PutPixel(x+3,y+3,col_pxl);
  94. }
  95.  
  96. void DrawCaptButtonSmallText(dword x,y,w,h,id,color_b, color_t,text)
  97. {
  98.         dword tx = -strlen(text)*6+w/2+x;
  99.         dword ty = h/2-3+y;
  100.         DefineButton(x,y,w,h,id,color_b);
  101.         WriteText(tx,ty,0x80,color_t,text);
  102. }