Subversion Repositories Kolibri OS

Rev

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