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,
|
|
|
|
|
"<EFBFBD><EFBFBD>२<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "F2",107,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "Del",108,
|
|
|
|
|
"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "F5",109,
|
|
|
|
|
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,
|
|
|
|
|
"Nimeta <20>mber", "F2",107,
|
|
|
|
|
"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,
|
|
|
|
|
"Rename", "F2",107,
|
|
|
|
|
"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-04-01 00:25:54 +04:00
|
|
|
|
|
|
|
|
|
void FileMenu()
|
|
|
|
|
{
|
2013-04-01 19:41:17 +04:00
|
|
|
|
mouse mm;
|
2013-10-10 02:46:17 +04:00
|
|
|
|
word id, key, slot, index, start_y;
|
|
|
|
|
proc_info MenuForm;
|
|
|
|
|
int ccount=0, cur=0, newi, linew=10, lineh=18, texty;
|
|
|
|
|
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;
|
|
|
|
|
if (strlen(file_captions[index])>linew) linew = strlen(file_captions[index]);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
ccount++;
|
|
|
|
|
}
|
2013-04-01 19:41:17 +04:00
|
|
|
|
linew = linew + 3 * 6 + 50;
|
2013-04-01 00:25:54 +04:00
|
|
|
|
texty = lineh/2-4;
|
|
|
|
|
SetEventMask(100111b);
|
|
|
|
|
|
|
|
|
|
goto _MENU_DRAW;
|
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
|
{
|
|
|
|
|
case evMouse:
|
|
|
|
|
slot = GetProcessSlot(MenuForm.ID);
|
|
|
|
|
if (slot != GetActiveProcess()) ExitProcess();
|
2013-04-01 19:41:17 +04:00
|
|
|
|
mm.get();
|
|
|
|
|
newi = mm.y - 1 / lineh;
|
2013-04-02 17:33:32 +04:00
|
|
|
|
if (mm.y<=0) || (mm.y>ccount*lineh+5) || (mm.x<0) || (mm.x>linew) newi=-1;
|
2013-04-01 19:41:17 +04:00
|
|
|
|
if (cur<>newi)
|
|
|
|
|
{
|
|
|
|
|
cur=newi;
|
|
|
|
|
goto _ITEMS_DRAW;
|
|
|
|
|
}
|
2013-04-01 00:25:54 +04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evButton:
|
|
|
|
|
id=GetButtonID();
|
|
|
|
|
if (id==100) Open();
|
2013-10-10 02:46:17 +04:00
|
|
|
|
if (id==201) notify("Not compleated yet");
|
|
|
|
|
if (id==202) FnProcess(3); //F3
|
|
|
|
|
if (id==203) FnProcess(4); //F4
|
2013-06-22 02:49:43 +04:00
|
|
|
|
if (id==104) Copy(#file_path, NOCUT);
|
|
|
|
|
if (id==105) Copy(#file_path, CUT);
|
|
|
|
|
if (id==106) CreateThread(#Paste,#copy_stak);
|
|
|
|
|
if (id==107) FnProcess(2);
|
|
|
|
|
if (id==108) Del_Form();
|
|
|
|
|
if (id==109) FnProcess(5);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
ExitProcess();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
|
IF (GetKey()==27) ExitProcess();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw: _MENU_DRAW:
|
2013-04-04 21:07:38 +04:00
|
|
|
|
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+3,ccount*lineh+6,0x01, 0, 0, 0x01fffFFF);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
GetProcessInfo(#MenuForm, SelfInfo);
|
2013-04-01 19:41:17 +04:00
|
|
|
|
DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
|
|
|
|
|
DrawBar(1,1,linew,1,0xFFFfff);
|
2013-10-09 22:10:23 +04:00
|
|
|
|
DrawPopupShadow(1,1,linew,ccount*lineh,0);
|
2013-04-01 00:25:54 +04:00
|
|
|
|
|
2013-04-01 19:41:17 +04:00
|
|
|
|
_ITEMS_DRAW:
|
2013-10-10 02:46:17 +04:00
|
|
|
|
for (index=0, start_y=0; file_captions[index*3]!=0; index++)
|
2013-04-01 00:25:54 +04:00
|
|
|
|
{
|
2013-10-10 02:46:17 +04:00
|
|
|
|
DefineButton(1,start_y+1,linew,lineh-1,file_captions[index*3+2]+BT_HIDE+BT_NOFRAME,0xFFFFFF);
|
|
|
|
|
if ((itdir) && (file_captions[index*3+2]>=200)) continue;
|
|
|
|
|
DrawBar(1,start_y+2,1,lineh,0xFFFfff);
|
|
|
|
|
if (start_y/lineh==cur)
|
2013-06-22 02:49:43 +04:00
|
|
|
|
{
|
2013-10-10 02:46:17 +04:00
|
|
|
|
DrawBar(2,start_y+2,linew-1,lineh,0xFFFfff);
|
2013-06-22 02:49:43 +04:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-10-10 02:46:17 +04:00
|
|
|
|
DrawBar(2,start_y+2,linew-1,lineh,col_work);
|
|
|
|
|
WriteText(8,start_y+texty+3,0x80,0xf2f2f2,file_captions[index*3]);
|
2013-06-22 02:49:43 +04:00
|
|
|
|
}
|
2013-10-10 02:46:17 +04:00
|
|
|
|
WriteText(7,start_y+texty+2,0x80,0x000000,file_captions[index*3]);
|
|
|
|
|
WriteText(-strlen(file_captions[index*3+1])*6-6+linew,start_y+texty+2,0x80,0x888888,file_captions[index*3+1]);
|
|
|
|
|
start_y+=lineh;
|
2013-04-01 00:25:54 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|