Subversion Repositories Kolibri OS

Rev

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