Subversion Repositories Kolibri OS

Rev

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