Subversion Repositories Kolibri OS

Rev

Rev 8868 | Go to most recent revision | Blame | 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.         if (efm) {
  6.                 return;
  7.                 PathShow.start_x = 10;
  8.                 PathShow.start_y = Form.cheight - status_bar_h;
  9.         } else {
  10.                 PathShow.start_x = 250;
  11.                 PathShow.start_y = 17;
  12.                 if (show_breadcrumb.checked) {
  13.                         DrawBreadCrumbs();
  14.                         return;
  15.                 }
  16.         }
  17.  
  18.         PathShow.area_size_x = Form.cwidth-300;
  19.         DrawBar(PathShow.start_x-3, PathShow.start_y-6, PathShow.area_size_x+3, 19, col.odd_line);
  20.         DrawRectangle(PathShow.start_x-4,PathShow.start_y-7,PathShow.area_size_x+4,20,sc.work_graph);
  21.         DefineHiddenButton(PathShow.start_x-4+1,PathShow.start_y-7+1,PathShow.area_size_x+4-2,20-2,PATH_BTN);
  22.         DrawBar(PathShow.start_x-4, PathShow.start_y+14, PathShow.area_size_x+5+18, 1, sc.work_light);
  23.  
  24.         DrawFlatButtonSmall(PathShow.start_x+PathShow.area_size_x,PathShow.start_y-7,18,20, 61, "\26");
  25.  
  26.         PathShow.background_color = col.odd_line;
  27.         PathShow.font_color = col.list_gb_text;
  28.         PathShow_prepare stdcall(#PathShow);
  29.         PathShow_draw stdcall(#PathShow);
  30. }
  31.  
  32. void DrawBreadCrumbs()
  33.  collection_int breadCrumb=0;
  34.  char PathShow_path[4096];
  35.  block btn;
  36.  int i;
  37.  unsigned text_line;
  38.  {
  39.         strcat(#PathShow_path, #path);
  40.         for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID);
  41.         breadCrumb.drop();
  42.         for (i=0; PathShow_path[i]; i++)
  43.         {
  44.                 if (PathShow_path[i]=='/') {
  45.                         PathShow_path[i] = NULL;
  46.                         breadCrumb.add(i+1);
  47.                 }
  48.         }
  49.         breadCrumb.add(i+1);
  50.         btn.set_size(246,10,NULL,20);
  51.         //area_w = Form.cwidth - btn.x - 20;
  52.         for (i=0; i<breadCrumb.count-1; i++)
  53.         {
  54.                 text_line = breadCrumb.get(i) + #PathShow_path;
  55.                 btn.w = strlen(text_line)*8+10;
  56.                 DrawBreadcrumbButton(btn.x, btn.y, btn.w, btn.h, i+BREADCRUMB_ID, text_line);
  57.                 btn.x += btn.w;
  58.         }
  59.         //DrawFavButton(btn.x);
  60.         //btn.x+=20;
  61.         btn.x++;
  62.         DrawBar(btn.x,btn.y-1,Form.cwidth-btn.x-25,btn.h+3,sc.work);
  63. }
  64.  
  65.  
  66. void ClickOnBreadCrumb(unsigned clickid)
  67. {
  68.         int i, slashpos = #path;
  69.         for (i=0; i!=clickid+2; i++) {
  70.                 slashpos=strchr(slashpos,'/')+1;
  71.         }
  72.         ESBYTE[slashpos-1] = NULL;
  73.         Open_Dir(#path,WITH_REDRAW);
  74. }
  75.  
  76.  
  77. void DrawBreadcrumbButton(dword x,y,w,h,id,text)
  78. {
  79.         int i;
  80.         DrawRectangle(x,y,w,h,sc.work_graph);
  81.         for (i=0; (i<h-1) & (i<20); i++) DrawBar(x+1, y+i+1, w-1, 1, col.work_gradient[20-i]);
  82.         DrawRectangle3D(x+1,y+1,w-2,h-2,sc.work_light, sc.work_dark);
  83.         DefineHiddenButton(x+1,y+1,w-2,h-2,id);
  84.         WriteText(-strlen(text)*8+w/2+x,h/2+y-7,0x90,sc.work_text,text);
  85.         DrawBar(x, y+h+1, w+1, 1, sc.work_light);
  86. }