Subversion Repositories Kolibri OS

Rev

Rev 5974 | Rev 5979 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include "..\lib\collection.h"
  2.  
  3. struct _History {
  4.         collection items;
  5.         int active;    
  6.         dword add();
  7.         dword back();
  8.         dword forward();
  9.         dword current();
  10. } History;
  11.  
  12. dword _History::add(dword in)
  13. {
  14.         if (!strcmp(in, items.get(active-1))) return 0;
  15.         items.count = active;
  16.         items.add(in);
  17.         active++;
  18.         return 1;
  19. }
  20.        
  21. dword _History::back()
  22. {
  23.         if (active==1) return 0;
  24.         active--;
  25.         return items.get(active-1);
  26. }
  27.  
  28. dword _History::forward()
  29. {
  30.         if (active==items.count) return 0;
  31.         active++;
  32.         return items.get(active-1);
  33. }
  34.  
  35. dword _History::current()
  36. {
  37.         return items.get(active-1);
  38. }