Rev 5974 | Rev 5979 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5974 | Rev 5977 | ||
---|---|---|---|
Line -... | Line 1... | ||
- | 1 | #include "..\lib\collection.h" |
|
Line 1... | Line 2... | ||
1 | struct _FoldersHistory { |
2 | |
2 | collection history; |
3 | struct _History { |
3 | int history_current; |
4 | collection items; |
4 | int add(); |
5 | int active; |
5 | int back(); |
6 | dword add(); |
6 | int forward(); |
7 | dword back(); |
- | 8 | dword forward(); |
|
7 | } FoldersHistory; |
9 | dword current(); |
Line 8... | Line 10... | ||
8 | 10 | } History; |
|
9 | int _FoldersHistory::add() |
11 | |
10 | { |
12 | dword _History::add(dword in) |
11 | if (!strcmp(#path, history.get(history_current-1))) return 0; |
13 | { |
12 | history.count = history_current; |
14 | if (!strcmp(in, items.get(active-1))) return 0; |
13 | history.add(#path); |
15 | items.count = active; |
14 | history_current++; |
16 | items.add(in); |
15 | return 1; |
17 | active++; |
Line 16... | Line 18... | ||
16 | } |
18 | return 1; |
17 | 19 | } |
|
18 | int _FoldersHistory::back() |
20 | |
19 | { |
21 | dword _History::back() |
20 | if (history_current==1) return 0; |
22 | { |
21 | history_current--; |
- | |
22 | strcpy(#path, history.get(history_current-1)); |
- | |
23 | debugln(#path); |
23 | if (active==1) return 0; |
Line 24... | Line 24... | ||
24 | return 1; |
24 | active--; |
25 | } |
25 | return items.get(active-1); |
26 | 26 | } |
|
27 | int _FoldersHistory::forward() |
27 | |
28 | { |
28 | dword _History::forward() |
- | 29 | { |
|
- | 30 | if (active==items.count) return 0; |
|
29 | if (history_current==history.count) return 0; |
31 | active++; |
- | 32 | return items.get(active-1); |
|
30 | history_current++; |
33 | } |
31 | strcpy(#path, history.get(history_current-1)); |
34 | |
32 | debugln(#path); |
35 | dword _History::current() |