Rev 2591 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2588 | leency | 1 | //06.04.2012 |
2 | |||
2596 | leency | 3 | #define MAX_HISTORY_NUM 40 |
4 | path_string history_list[MAX_HISTORY_NUM]; |
||
2588 | leency | 5 | int history_num; |
6 | int history_current; |
||
7 | |||
8 | #define add_new_path 1 |
||
9 | #define go_back 2 |
||
2591 | leency | 10 | #define go_forward 3 |
2588 | leency | 11 | |
12 | dword GetCurrentFolder() |
||
13 | { |
||
14 | char cur_fol[4096]; |
||
15 | copystr(#path,#cur_fol); |
||
16 | cur_fol[strlen(#cur_fol)-1]=0x00; //обрезаем последний / |
||
17 | copystr(#cur_fol+find_symbol(#cur_fol,'/'),#cur_fol); |
||
18 | return #cur_fol; |
||
19 | } |
||
20 | |||
21 | void HistoryPath(byte action) |
||
22 | { |
||
23 | if (action==add_new_path) |
||
24 | { |
||
2591 | leency | 25 | if (history_num>0) && (strcmp(#path,#history_list[history_current].Item)==0) return; |
2596 | leency | 26 | |
27 | if (history_current>=MAX_HISTORY_NUM-1) |
||
28 | { |
||
29 | history_current/=2; |
||
30 | for (i=0; i |
||
31 | { |
||
32 | copystr(#history_list[MAX_HISTORY_NUM-i].Item, #history_list[i].Item); |
||
33 | } |
||
34 | } |
||
2591 | leency | 35 | history_current++; |
36 | copystr(#path,#history_list[history_current].Item); |
||
37 | history_num=history_current; |
||
2588 | leency | 38 | } |
39 | |||
40 | if (action==go_back) |
||
41 | { |
||
2591 | leency | 42 | if (history_current<=2) return; |
43 | history_current--; |
||
44 | copystr(#history_list[history_current].Item,#path); |
||
2588 | leency | 45 | } |
46 | |||
2591 | leency | 47 | if (action==go_forward) |
2588 | leency | 48 | { |
2591 | leency | 49 | if (history_current==history_num) return; |
50 | history_current++; |
||
51 | copystr(#history_list[history_current].Item,#path); |
||
2588 | leency | 52 | SelectFile(""); |
53 | } |
||
54 | }=2)> |