Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3438 → Rev 3439

/programs/cmm/eolite/include/file_menu.h
2,7 → 2,7
 
char *captions[] = {
"Open", "Enter",
"Open with...", "Ctrl+Ent",
"Open with...", "CrlEnt",
"View as text", "F3",
"View as HEX", "F4",
"Rename", "F2",
12,14 → 12,15
void FileMenu()
{
proc_info MenuForm;
mouse mm;
word id, key, slot;
int ccount=0, linew=10, lineh=18, texty;
int ccount=0, cur, newi, linew=10, lineh=18, texty;
for (i=0; captions[i]!=0; i+=2)
{
ccount++;
if (strlen(captions[i])>linew) linew = strlen(captions[i]);
}
linew = linew + 3 * 6 + 70;
linew = linew + 3 * 6 + 50;
texty = lineh/2-4;
SetEventMask(100111b);
 
29,6 → 30,14
case evMouse:
slot = GetProcessSlot(MenuForm.ID);
if (slot != GetActiveProcess()) ExitProcess();
mm.get();
newi = mm.y - 1 / lineh;
//if (m.y<0) || (newi+1>items_num) || (m.x<0) || (m.x>ITEM_WIDTH) break;
if (cur<>newi)
{
cur=newi;
goto _ITEMS_DRAW;
}
break;
 
case evButton:
47,20 → 56,22
break;
case evReDraw: _MENU_DRAW:
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+2,ccount*lineh+2,0x01,0xEEEeee,0x01fffFFF);
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+2,ccount*lineh+5,0x01, 0, 0, 0x01fffFFF);
GetProcessInfo(#MenuForm, SelfInfo);
/* _PutImage(1,23, 16,44, #factions); //èêîíêè */
DrawRectangle(0,0,linew+1,ccount*lineh+1,col_border);
PutShadow(linew+2,1,1,ccount*lineh+1,0,1);
PutShadow(1,ccount*lineh+2,linew+1,1,0,1);
DrawRectangle(0,0,linew+1,ccount*lineh+2,col_border);
DrawBar(1,1,linew,1,0xFFFfff);
PutShadow(linew+2,1,1,ccount*lineh+2,0,1);
PutShadow(1,ccount*lineh+3,linew+2,1,0,1);
 
_ITEMS_DRAW:
for (i=0; captions[i*2]!=0; i++)
{
DefineButton(1,i*lineh,linew,lineh-1,i+100+BT_HIDE,0xFFFFFF);
DrawBar(1,i*lineh+1,1,lineh,0xFFFfff);
DrawBar(2,i*lineh+1,linew-1,lineh,col_work);
WriteText(6,i*lineh+texty+1,0x80,0x000000,captions[i*2]);
WriteText(-strlen(captions[i*2+1])*6-7+linew,i*lineh+texty+1,0x80,0x999999,captions[i*2+1]);
DefineButton(1,i*lineh+1,linew,lineh-1,i+100+BT_HIDE+BT_NOFRAME,0xFFFFFF);
DrawBar(1,i*lineh+2,1,lineh,0xFFFfff);
if (i==cur) DrawBar(2,i*lineh+2,linew-1,lineh,0xFFFfff); else DrawBar(2,i*lineh+2,linew-1,lineh,col_work);
WriteText(7,i*lineh+texty+2,0x80,0x000000,captions[i*2]);
WriteText(-strlen(captions[i*2+1])*6-6+linew,i*lineh+texty+2,0x80,0x999999,captions[i*2+1]);
}
}
}