Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
  3. void DrawPathBar()
  4. {
  5.         PathShow.area_size_x = Form.cwidth-300;
  6.         DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, 0xFFFfff);
  7.         DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,col_graph);
  8.         DefineHiddenButton(PathShow.start_x-4+1,PathShow.start_y-7+1,PathShow.area_size_x+4-2,20-2,PATH_BTN);
  9.         DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+5+18, 1, system.color.work_light);
  10.  
  11.         DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26");
  12.  
  13.         PathShow_prepare stdcall(#PathShow);
  14.         PathShow_draw stdcall(#PathShow);
  15. }
  16.  
  17. void DrawBreadCrumbs()
  18.  collection_int breadCrumb;
  19.  char PathShow_path[4096];
  20.  block btn;
  21.  int i;
  22.  unsigned text_line, area_w;
  23.  {
  24.         strcat(#PathShow_path, #path);
  25.         for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID);
  26.         breadCrumb.drop();
  27.         for (i=0; PathShow_path[i]; i++)
  28.         {
  29.                 if (PathShow_path[i]=='/') {
  30.                         PathShow_path[i] = NULL;
  31.                         breadCrumb.add(i+1);
  32.                 }
  33.         }
  34.         breadCrumb.add(i+1);
  35.         btn.set_size(246,10,NULL,20);
  36.         area_w = Form.cwidth - btn.x - 20;
  37.         for (i=0; i<breadCrumb.count-1; i++)
  38.         {
  39.                 text_line = breadCrumb.get(i) + #PathShow_path;
  40.                 btn.w = strlen(text_line)*8+10;
  41.                 DrawBreadcrumbButton(btn.x, btn.y, btn.w, btn.h, i+BREADCRUMB_ID, text_line);
  42.                 btn.x += btn.w;
  43.         }
  44.         //DrawFavButton(btn.x);
  45.         //btn.x+=20;
  46.         btn.x++;
  47.         DrawBar(btn.x,btn.y-1,Form.cwidth-btn.x-25,btn.h+3,col_work);
  48. }
  49.  
  50.  
  51. void ClickOnBreadCrumb(unsigned clickid)
  52. {
  53.         int i, slashpos = #path;
  54.         for (i=0; i!=clickid+2; i++) {
  55.                 slashpos=strchr(slashpos,'/')+1;
  56.         }
  57.         ESBYTE[slashpos-1] = NULL;
  58.         Open_Dir(#path,WITH_REDRAW);
  59. }
  60.  
  61.  
  62. dword col_palette_br[14] = {0xFFFfff,0xF3EDF0,0xF3EDF0,0xF3EDF0,0xF3EDF0,
  63.         0xF2EBEF,0xF2EBEF,
  64.         0xF0EAEC,0xEFE9EB,0xEDE6E9,0xEAE6E8,0xE9E4E6,0xE5E0E3,0xE3DDDE,0xE0DBDB,
  65.         0xDFDADA,0xDBD9DA,0xD2D0D2,0xC2C6C6};
  66. void DrawBreadcrumbButton(dword x,y,w,h,id,text)
  67. {
  68.         int i;
  69.         DrawRectangle(x,y,w,h,col_graph);
  70.         for (i=0; i<h-1; i++) DrawBar(x+1, y+i+1, w-1, 1, col_palette_br[i]);
  71.         DefineHiddenButton(x+1,y+1,w-2,h-2,id);
  72.         WriteText(-strlen(text)*8+w/2+x,h/2+y-7,0x90,0x444444,text);
  73.         DrawBar(x, y+h+1, w+1, 1, MixColors(col_work,0xFFFfff,120));
  74. }