2013-04-01 00:25:54 +04:00
|
|
|
|
//Leency 2008-2013
|
|
|
|
|
|
2013-10-10 02:46:17 +04:00
|
|
|
|
//pay attension: >200 this is only file actions, not supported by folders
|
2013-08-04 03:35:59 +04:00
|
|
|
|
#ifdef LANG_RUS
|
2013-10-10 02:46:17 +04:00
|
|
|
|
char *file_captions[] = {
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "Enter",100,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>...", "CrlEnt",201,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ⥪<><E2A5AA>", "F3",202,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> HEX", "F4",203,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "Crl+C",104,
|
|
|
|
|
"<EFBFBD><EFBFBD>१<EFBFBD><EFBFBD><EFBFBD>", "Crl+X",105,
|
|
|
|
|
"<EFBFBD><EFBFBD>⠢<EFBFBD><EFBFBD><EFBFBD>", "Crl+V",106,
|
2013-10-15 03:16:04 +04:00
|
|
|
|
"<EFBFBD><EFBFBD>२<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "F2",207,
|
2013-10-10 02:46:17 +04:00
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "Del",108,
|
2013-10-15 03:16:04 +04:00
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>", "F5",109,
|
2013-10-10 02:46:17 +04:00
|
|
|
|
0, 0, 0};
|
2013-09-24 22:50:05 +04:00
|
|
|
|
#elif LANG_EST
|
2013-10-10 02:46:17 +04:00
|
|
|
|
char *file_captions[] = {
|
|
|
|
|
"Ava", "Enter",100,
|
|
|
|
|
"Ava ...", "CrlEnt",201,
|
|
|
|
|
"Vaata tekstina", "F3",202,
|
|
|
|
|
"Vaata HEX", "F4",203,
|
|
|
|
|
"Kopeeri", "Crl+C",104,
|
|
|
|
|
"L<EFBFBD>ika", "Crl+X",105,
|
|
|
|
|
"Aseta", "Crl+V",106,
|
2013-10-15 03:16:04 +04:00
|
|
|
|
"Nimeta <20>mber", "F2",207,
|
2013-10-10 02:46:17 +04:00
|
|
|
|
"Kustuta", "Del",108,
|
|
|
|
|
"V<EFBFBD>rskenda", "F5",109,
|
|
|
|
|
0, 0, 0};
|
2013-08-04 03:35:59 +04:00
|
|
|
|
#else
|
2013-10-10 02:46:17 +04:00
|
|
|
|
char *file_captions[] = {
|
|
|
|
|
"Open", "Enter",100,
|
|
|
|
|
"Open with...", "CrlEnt",201,
|
|
|
|
|
"View as text", "F3",202,
|
|
|
|
|
"View as HEX", "F4",203,
|
|
|
|
|
"Copy", "Crl+C",104,
|
|
|
|
|
"Cut", "Crl+X",105,
|
|
|
|
|
"Paste", "Crl+V",106,
|
2013-10-15 03:16:04 +04:00
|
|
|
|
"Rename", "F2",207,
|
2013-10-10 02:46:17 +04:00
|
|
|
|
"Delete", "Del",108,
|
|
|
|
|
"Refresh", "F5",109,
|
|
|
|
|
0, 0, 0};
|
2013-08-04 03:35:59 +04:00
|
|
|
|
#endif
|
2013-06-22 02:49:43 +04:00
|
|
|
|
|
2013-10-23 01:34:18 +04:00
|
|
|
|
llist menu;
|
|
|
|
|
int cur_action_buf;
|
2013-04-01 00:25:54 +04:00
|
|
|
|
|
|
|
|
|
void FileMenu()
|
|
|
|
|
{
|
2013-04-01 19:41:17 +04:00
|
|
|
|
mouse mm;
|
2013-10-23 01:34:18 +04:00
|
|
|
|
word slot, key;
|
2013-10-10 02:46:17 +04:00
|
|
|
|
proc_info MenuForm;
|
2013-10-23 01:34:18 +04:00
|
|
|
|
int index;
|
2013-10-17 03:48:20 +04:00
|
|
|
|
|
|
|
|
|
menu.ClearList();
|
2013-10-23 23:03:10 +04:00
|
|
|
|
menu.SetSizes(0,0,10,0,0,18);
|
2013-10-10 02:46:17 +04:00
|
|
|
|
for (index=0; file_captions[index]!=0; index+=3)
|
2013-04-01 00:25:54 +04:00
|
|
|
|
{
|
2013-10-10 02:46:17 +04:00
|
|
|
|
if (itdir) && (file_captions[index+2]>=200) continue;
|
2013-10-17 03:48:20 +04:00
|
|
|
|
if (strlen(file_captions[index])>menu.w) menu.w = strlen(file_captions[index]);
|
|
|
|
|
menu.count++;
|
2013-10-23 01:34:18 +04:00
|
|
|
|
menu.visible++;
|
2013-04-01 00:25:54 +04:00
|
|
|
|
}
|
2013-10-17 03:48:20 +04:00
|
|
|
|
menu.w = menu.w + 3 * 6 + 50;
|
|
|
|
|
menu.h = menu.count*menu.line_h;
|
2013-04-01 00:25:54 +04:00
|
|
|
|
SetEventMask(100111b);
|
|
|
|
|
goto _MENU_DRAW;
|
2013-10-17 03:48:20 +04:00
|
|
|
|
|
2013-04-01 00:25:54 +04:00
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
|
{
|
|
|
|
|
case evMouse:
|
|
|
|
|
slot = GetProcessSlot(MenuForm.ID);
|
|
|
|
|
if (slot != GetActiveProcess()) ExitProcess();
|
2013-04-01 19:41:17 +04:00
|
|
|
|
mm.get();
|
2013-10-23 23:03:10 +04:00
|
|
|
|
if (menu.ProcessMouse(mm.x, mm.y)) MenuListRedraw();
|
2013-10-23 01:34:18 +04:00
|
|
|
|
if (mm.lkm) {action_buf = cur_action_buf; pause(5); ExitProcess(); }
|
2013-04-01 00:25:54 +04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
2013-10-23 01:34:18 +04:00
|
|
|
|
key = GetKey();
|
|
|
|
|
if (key==27) ExitProcess();
|
|
|
|
|
if (key == 13) {action_buf = cur_action_buf; ExitProcess(); }
|
|
|
|
|
if (menu.ProcessKey(key)) MenuListRedraw();
|
2013-04-01 00:25:54 +04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw: _MENU_DRAW:
|
2013-10-23 23:03:10 +04:00
|
|
|
|
DefineAndDrawWindow(m.x+Form.left+5, m.y+Form.top+GetSkinHeight(),menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
GetProcessInfo(#MenuForm, SelfInfo);
|
2013-10-23 21:55:07 +04:00
|
|
|
|
DrawRectangle(0,0,menu.w+1,menu.h+2,sc.work_graph);
|
2013-10-17 03:48:20 +04:00
|
|
|
|
DrawBar(1,1,menu.w,1,0xFFFfff);
|
|
|
|
|
DrawPopupShadow(1,1,menu.w,menu.h,0);
|
2013-10-23 01:34:18 +04:00
|
|
|
|
MenuListRedraw();
|
2013-04-01 00:25:54 +04:00
|
|
|
|
}
|
2013-10-23 01:34:18 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MenuListRedraw()
|
|
|
|
|
{
|
|
|
|
|
int start_y=0;
|
|
|
|
|
int index;
|
|
|
|
|
int texty = menu.line_h/2-4;
|
|
|
|
|
for (index=0; file_captions[index*3]!=0; index++)
|
|
|
|
|
{
|
|
|
|
|
if ((itdir) && (file_captions[index*3+2]>=200)) continue;
|
|
|
|
|
DrawBar(1,start_y+2,1,menu.line_h,0xFFFfff);
|
|
|
|
|
if (start_y/menu.line_h==menu.current)
|
|
|
|
|
{
|
|
|
|
|
cur_action_buf = file_captions[index*3+2];
|
|
|
|
|
DrawBar(2,start_y+2,menu.w-1,menu.line_h,0xFFFfff);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-10-23 21:55:07 +04:00
|
|
|
|
DrawBar(2,start_y+2,menu.w-1,menu.line_h,sc.work);
|
2013-10-23 01:34:18 +04:00
|
|
|
|
WriteText(8,start_y+texty+3,0x80,0xf2f2f2,file_captions[index*3]);
|
|
|
|
|
}
|
2013-10-23 21:55:07 +04:00
|
|
|
|
WriteText(7,start_y+texty+2,0x80,sc.work_text,file_captions[index*3]);
|
2013-10-23 01:34:18 +04:00
|
|
|
|
WriteText(-strlen(file_captions[index*3+1])*6-6+menu.w,start_y+texty+2,0x80,0x888888,file_captions[index*3+1]);
|
|
|
|
|
start_y+=menu.line_h;
|
|
|
|
|
}
|
2013-04-01 00:25:54 +04:00
|
|
|
|
}
|