kolibrios-fun/programs/cmm/eolite/include/menu.h
Kirill Lipatov (Leency) b3571d494b Eolite/KFM2: 'Delete' feature rewritten (thanks IgorA for the report) - now always run in a separate process, other bugfixes
git-svn-id: svn://kolibrios.org@8861 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-06-15 18:22:58 +00:00

166 lines
3.4 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifdef LANG_RUS
char file_actions[]=
"Žâªàëâì |Enter
Žâªàëâì á ¯®¬®éìî |CrlEnt
-
Š®¯¨à®¢ âì |Crl+C
ë१ âì |Crl+X
áâ ¢¨âì |Crl+V
-
<EFBFBD>¥à¥¨¬¥­®¢ âì |F2
¤ «¨âì |Del
¢®©á⢠ |F1";
char folder_actions[]=
"Žâªàëâì |Enter
-
Š®¯¨à®¢ âì |Crl+C
ë१ âì |Crl+X
áâ ¢¨âì |Crl+V
-
¤ «¨âì |Del
¢®©á⢠ |F1";
char empty_folder_actions[]=
"‚áâ ¢¨âì |Crl+V";
char burger_menu_items[] =
"<EFBFBD>®¢®¥ ®ª­®|Ctrl+N
Žâªàëâì ª®­á®«ì|Ctrl+G
Ž¡­®¢¨âì ¯ ¯ªã|Ctrl+R
<EFBFBD> áâனª¨|F10
Ž ¯à®£à ¬¬¥";
#elif LANG_EST
char file_actions[]=
"Ava |Enter
Ava ... |CrlEnt
-
Kopeeri |Crl+C
Lõika |Crl+X
Aseta |Crl+V
-
Nimeta ümber |F2
Kustuta |Del
Properties |F1";
char folder_actions[]=
"Ava |Enter
-
Kopeeri |Crl+C
Lõika |Crl+X
Aseta |Crl+V
-
Kustuta |Del
Properties |F1";
char empty_folder_actions[]=
"Aseta |Crl+V";
char burger_menu_items[] =
"New window|Ctrl+N
Open console here|Ctrl+G
Värskenda|Ctrl+R
Settings|F10
About";
#else
char file_actions[]=
"Open |Enter
Open with... |CrlEnt
-
Copy |Crl+C
Cut |Crl+X
Paste |Crl+V
-
Rename |F2
Delete |Del
Properties |F1";
char folder_actions[]=
"Open |Enter
-
Copy |Crl+C
Cut |Crl+X
Paste |Crl+V
-
Delete |Del
Properties |F1";
char empty_folder_actions[]=
"Paste |Crl+V";
char burger_menu_items[] =
"New window|Ctrl+N
Open console here|Ctrl+G
Refresh folder|Ctrl+R
Settings|F10
About";
#endif
enum { MENU_DIR=1, MENU_FILE, MENU_NO_FILE, MENU_BURGER };
bool active_menu = false;
void EventMenuClick(dword _id)
{
if (active_menu == MENU_NO_FILE) switch(_id) {
case 1: EventPaste(#path); break;
}
if (active_menu == MENU_FILE) switch(_id) {
case 1: EventOpen(0); break;
case 2: ShowOpenWithDialog(); break;
case 3: CopyFilesListToClipboard(COPY); break;
case 4: CopyFilesListToClipboard(CUT); break;
case 5: EventPaste(#path); break;
case 6: FnProcess(2); break;
case 7: Del_Form(); break;
case 8: FnProcess(1); break;
}
if (active_menu == MENU_DIR) switch(_id) {
case 1: EventOpen(0); break;
case 2: CopyFilesListToClipboard(COPY); break;
case 3: CopyFilesListToClipboard(CUT); break;
case 4: EventPaste(#path); break;
case 5: Del_Form(); break;
case 6: FnProcess(1); break;
}
if (active_menu == MENU_BURGER) switch(_id) {
case 1: EventOpenNewEolite(); break;
case 2: EventOpenConsoleHere(); break;
case 3: EventRefreshDisksAndFolders(); break;
case 4: FnProcess(10); break;
case 5: EventShowAbout(); break;
}
active_menu = NULL;
}
void EventShowListMenu()
{
dword text;
pause(3);
if (!files.count) {
text = #empty_folder_actions;
active_menu = MENU_NO_FILE;
} else if (itdir) {
text = #folder_actions;
active_menu = MENU_DIR;
} else {
text = #file_actions;
active_menu = MENU_FILE;
}
open_lmenu(mouse.x, mouse.y+3, MENU_TOP_LEFT, NULL, text);
}
void EventShowBurgerMenu()
{
active_menu = MENU_BURGER;
open_lmenu(Form.cwidth-6, 35, MENU_TOP_RIGHT, NULL, #burger_menu_items);
}
bool GetMenuClick()
{
dword click_id;
if (active_menu) && (click_id = get_menu_click()) {
EventMenuClick(click_id);
return false;
}
return true;
}