Subversion Repositories Kolibri OS

Rev

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