Subversion Repositories Kolibri OS

Rev

Rev 8826 | Rev 8861 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4042 leency 1
#ifdef LANG_RUS
7778 leency 2
 
3
char file_actions[]=
4
"Открыть           |Enter
5
Открыть с помощью  |CrlEnt
7796 leency 6
-
7778 leency 7
Копировать         |Crl+C
8
Вырезать           |Crl+X
9
Вставить           |Crl+V
7796 leency 10
-
7778 leency 11
Переименовать      |F2
12
Удалить            |Del
8780 leency 13
Свойства           |F1";
7778 leency 14
char folder_actions[]=
15
"Открыть       |Enter
7796 leency 16
-
7778 leency 17
Копировать     |Crl+C
18
Вырезать       |Crl+X
19
Вставить       |Crl+V
7796 leency 20
-
7778 leency 21
Удалить        |Del
8780 leency 22
Свойства       |F1";
7778 leency 23
char empty_folder_actions[]=
24
"Вставить      |Crl+V";
7813 leency 25
char burger_menu_items[] =
26
"Новое окно|Ctrl+N
27
Открыть консоль|Ctrl+G
8854 leency 28
Обновить папку|Ctrl+R
8764 leency 29
Настройки|F10
30
О программе";
7778 leency 31
 
4042 leency 32
#elif LANG_EST
7778 leency 33
char file_actions[]=
34
"Ava           |Enter
35
Ava ...        |CrlEnt
7796 leency 36
-
7778 leency 37
Kopeeri        |Crl+C
38
Lїika          |Crl+X
39
Aseta          |Crl+V
7796 leency 40
-
7778 leency 41
Nimeta №mber   |F2
42
Kustuta        |Del
8780 leency 43
Properties     |F1";
7778 leency 44
char folder_actions[]=
45
"Ava           |Enter
7796 leency 46
-
7778 leency 47
Kopeeri        |Crl+C
48
Lїika          |Crl+X
49
Aseta          |Crl+V
7796 leency 50
-
7778 leency 51
Kustuta        |Del
8780 leency 52
Properties     |F1";
7778 leency 53
char empty_folder_actions[]=
54
"Aseta         |Crl+V";
7813 leency 55
char burger_menu_items[] =
56
"New window|Ctrl+N
57
Open console here|Ctrl+G
8854 leency 58
Vфrskenda|Ctrl+R
8764 leency 59
Settings|F10
60
About";
7778 leency 61
 
4042 leency 62
#else
7778 leency 63
char file_actions[]=
64
"Open         |Enter
65
Open with...  |CrlEnt
7796 leency 66
-
7778 leency 67
Copy          |Crl+C
68
Cut           |Crl+X
69
Paste         |Crl+V
7796 leency 70
-
7778 leency 71
Rename        |F2
72
Delete        |Del
8780 leency 73
Properties    |F1";
7778 leency 74
char folder_actions[]=
75
"Open        |Enter
7796 leency 76
-
7778 leency 77
Copy         |Crl+C
78
Cut          |Crl+X
79
Paste        |Crl+V
7796 leency 80
-
7778 leency 81
Delete       |Del
8826 leency 82
Properties   |F1";
7778 leency 83
char empty_folder_actions[]=
84
"Paste        |Crl+V";
7813 leency 85
char burger_menu_items[] =
86
"New window|Ctrl+N
87
Open console here|Ctrl+G
8854 leency 88
Refresh folder|Ctrl+R
8764 leency 89
Settings|F10
90
About";
4042 leency 91
#endif
92
 
93
 
7778 leency 94
enum { MENU_DIR=1, MENU_FILE, MENU_NO_FILE, MENU_BURGER };
95
 
96
bool active_menu = false;
97
 
98
void EventMenuClick(dword _id)
4042 leency 99
{
7778 leency 100
	if (active_menu == MENU_NO_FILE) switch(_id) {
8854 leency 101
		case 1: EventPaste(#path); break;
4042 leency 102
	}
7778 leency 103
	if (active_menu == MENU_FILE) switch(_id) {
8417 leency 104
		case 1: EventOpen(0); break;
7778 leency 105
		case 2: ShowOpenWithDialog(); break;
7878 leency 106
		case 3: EventCopy(NOCUT); break;
107
		case 4: EventCopy(CUT); break;
8854 leency 108
		case 5: EventPaste(#path); break;
7778 leency 109
		case 6: FnProcess(2); break;
110
		case 7: Del_Form(); break;
8780 leency 111
		case 8: FnProcess(1); break;
4072 leency 112
	}
7778 leency 113
	if (active_menu == MENU_DIR) switch(_id) {
8417 leency 114
		case 1: EventOpen(0); break;
7878 leency 115
		case 2: EventCopy(NOCUT); break;
116
		case 3: EventCopy(CUT); break;
8854 leency 117
		case 4: EventPaste(#path); break;
7778 leency 118
		case 5: Del_Form(); break;
8780 leency 119
		case 6: FnProcess(1); break;
7778 leency 120
	}
7813 leency 121
	if (active_menu == MENU_BURGER) switch(_id) {
122
		case 1: EventOpenNewEolite(); break;
123
		case 2: EventOpenConsoleHere(); break;
124
		case 3: EventRefreshDisksAndFolders(); break;
8764 leency 125
		case 4: FnProcess(10); break;
8780 leency 126
		case 5: EventShowAbout(); break;
7813 leency 127
	}
7778 leency 128
	active_menu = NULL;
4072 leency 129
}
4042 leency 130
 
7778 leency 131
void EventShowListMenu()
4072 leency 132
{
7778 leency 133
	dword text;
7462 leency 134
 
7778 leency 135
	pause(3);
7462 leency 136
 
7778 leency 137
	if (!files.count) {
138
		text = #empty_folder_actions;
139
		active_menu = MENU_NO_FILE;
140
	} else if (itdir) {
141
		text = #folder_actions;
142
		active_menu = MENU_DIR;
143
	} else {
144
		text = #file_actions;
145
		active_menu = MENU_FILE;
146
	}
8020 leency 147
	open_lmenu(mouse.x, mouse.y+3, MENU_TOP_LEFT, NULL, text);
7778 leency 148
}
149
 
7813 leency 150
void EventShowBurgerMenu()
151
{
152
	active_menu = MENU_BURGER;
8020 leency 153
	open_lmenu(Form.cwidth-6, 35, MENU_TOP_RIGHT, NULL, #burger_menu_items);
7813 leency 154
}
155
 
7778 leency 156
bool GetMenuClick()
157
{
7780 leency 158
	dword click_id;
159
	if (active_menu) && (click_id = get_menu_click()) {
160
		EventMenuClick(click_id);
7778 leency 161
		return false;
162
	}
163
	return true;
164
}
165