Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. //06.04.2012
  2.  
  3. path_string history_list[40];
  4. int history_num;
  5. int history_current;
  6.  
  7. #define add_new_path 1
  8. #define go_back 2
  9. #define go_forvard 3
  10.  
  11. //history_current
  12.  
  13. dword GetCurrentFolder()
  14. {
  15.         char cur_fol[4096];
  16.         copystr(#path,#cur_fol);
  17.         cur_fol[strlen(#cur_fol)-1]=0x00; //îáðåçàåì ïîñëåäíèé /
  18.         copystr(#cur_fol+find_symbol(#cur_fol,'/'),#cur_fol);
  19.         return #cur_fol;
  20. }
  21.  
  22. void HistoryPath(byte action)
  23. {
  24.         if (action==add_new_path)
  25.         {
  26.                 if (history_num>0) && (strcmp(#path,#history_list[history_num-1].Item)==0) return;
  27.                
  28.                 copystr(#path,#history_list[history_num].Item);
  29.                 history_num++;
  30.         }
  31.        
  32.         if (action==go_back)
  33.         {
  34.                 if (history_num<=2) return;
  35.                 history_num--;
  36.                 copystr(#history_list[history_num-1].Item,#path);
  37.         }
  38.  
  39.         if (action==go_forvard)
  40.         {
  41.                 WriteDebug("");
  42.                 for (i=0; i<history_num; i++;)
  43.                 {
  44.                         WriteDebug(#history_list[i].Item);
  45.                         WriteDebug(IntToStr(history_num));
  46.                 }
  47.                 if (strcmp("",#history_list[history_num].Item)==0) return;
  48.                 history_num++;
  49.                 copystr(#history_list[history_num-1].Item,#path);
  50.                 SelectFile("");
  51.                 return;
  52.         }      
  53. }