/programs/cmm/eolite/include/about_dialog.h |
---|
14,7 → 14,6 |
id=GetButtonID(); |
IF (id==1) || (id==10) ExitProcess(); |
IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK); |
IF (id==33) RunProgram(EDITOR_PATH, abspath("Eolite.ini")); |
break; |
case evKey: |
33,8 → 32,6 |
WriteText(29,170,0x80,0,"Visit"); |
DrawLink(66,170,0x80,23, "kolibri-n.org"); |
DrawFlatButton(85,190,70,22,10,0xE4DFE1, "Close"); |
DefineButton(20-1,195-1, 16+1,15+1, 33+BT_HIDE, 0); |
PutPaletteImage(8*16*15+#ficons,16,15,20,195,8,#ficons_pal); |
DrawFilledBar(0, 216, 172, 12); |
} |
} |
/programs/cmm/eolite/include/file_menu.h |
---|
0,0 → 1,66 |
//Leency 2008-2013 |
char *captions[] = { |
"Open", "Enter", |
"Open with...", "Ctrl+Ent", |
"View as text", "F3", |
"View as HEX", "F4", |
"Rename", "F2", |
"Delete", "Del", |
0}; |
void FileMenu() |
{ |
proc_info MenuForm; |
word id, key, slot; |
int ccount=0, 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; |
texty = lineh/2-4; |
SetEventMask(100111b); |
goto _MENU_DRAW; |
loop() switch(WaitEvent()) |
{ |
case evMouse: |
slot = GetProcessSlot(MenuForm.ID); |
if (slot != GetActiveProcess()) ExitProcess(); |
break; |
case evButton: |
id=GetButtonID(); |
if (id==100) Open(); |
if (id==101) notify("Not compleated yet"); |
if (id==102) ActionsProcess(3); |
if (id==103) ActionsProcess(4); |
if (id==104) ActionsProcess(2); |
if (id==105) Del_Form(); |
ExitProcess(); |
break; |
case evKey: |
IF (GetKey()==27) ExitProcess(); |
break; |
case evReDraw: _MENU_DRAW: |
DefineAndDrawWindow(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),linew+2,ccount*lineh+2,0x01,0xEEEeee,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); |
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]); |
} |
} |
} |
/programs/cmm/eolite/include/ini.h |
---|
6,25 → 6,6 |
#define PARAM 2 |
#define OPTION 3 |
unsigned char *ERROR_TEXT[]={ |
"Code #0 - No error", |
"Error #1 - Base or partition of a hard disk is not defined", |
"Error #2 - Function isn't supported for this file system", |
"Error #3 - Unknown file system", |
"Error #4 - Reserved, is never returned", |
"Error #5 - File or folder not found", |
"Error #6 - End of file, EOF", |
"Error #7 - Pointer lies outside of application memory", |
"Error #8 - Too less disk space", |
"Error #9 - FAT table is destroyed", |
"Error #10 - Access denied", |
"Error #11 - Device error", |
0, 0, 0, 0, 0, 0, 0, 0, 0, |
0, 0, 0, 0, 0, 0, 0, 0, 0, |
"Error #30 - Not enough memory", |
"Error #31 - File is not executable", |
"Error #32 - Too many processes", |
0}; |
void GetIni(byte onload) |
{ |
61,7 → 42,7 |
case 0x0d: |
InfType=PARAM; |
IF (!strcmp(#parametr,"SelectionColor")) edit2.shift_color=col_selec=StrToCol(#option); |
IF (!strcmp(#parametr,"LineHeight")) BUTTON_HEIGHT=atoi(#option); |
IF (!strcmp(#parametr,"LineHeight")) files.line_h = atoi(#option); |
IF (!strcmp(#parametr,"ShowDeviceName")) show_dev_name=atoi(#option); |
/*if (!strcmp(#section,"UserDirectories")) && (parametr) && (onload) |
94,20 → 75,9 |
void Write_Error(int error_number) |
{ |
char error[256]; |
if (error_number<0) error_number=-1*error_number; |
if (error_number<33) |
strcpy(#error, ERROR_TEXT[error_number]); |
else |
{ |
strcpy(#error, itoa(error_number)); |
strcat(#error, " - Unknown error number O_o"); |
} |
if (curbtn>=0) Line_ReDraw(0xFF0000, curbtn); |
if (files.current>=0) Line_ReDraw(0xFF0000, files.current); |
pause(5); |
notify(#error); |
notify(get_error(error_number)); |
} |
/programs/cmm/eolite/include/left_panel.h |
---|
16,7 → 16,7 |
int disc_num; |
dword devbuf; |
void GetSystemDiscs() |
void SystemDiscsGet() |
{ |
unsigned char dev_name[10], sys_discs[10]; |
unsigned int i1, j1, dev_num, dev_disc_num; |
32,8 → 32,8 |
strcat(#dev_name, i1*304+ devbuf+72); // /rd |
strcat(#dev_name, "/"); // /rd/ |
Open_Dir(#dev_name, ONLY_OPEN); |
dev_disc_num = count; |
//if (count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else |
dev_disc_num = files.count; |
//if (files.count<=0) copystr(#dev_name,#disk_list[disc_num].Item); else |
for (j1=0; j1<dev_disc_num; j1++;) |
{ |
strcpy(#sys_discs, #dev_name); // /rd/ |
46,20 → 46,17 |
} |
void DrawSystemDiscs() |
void SystemDiscsDraw() |
{ |
byte disc_icon; |
char dev_name[10]; |
char disc_name[100]; |
char dev_name[10], disc_name[100]; |
int i, dev_icon; |
Tip(56, "Devices", 78, "="); |
for (i=0; i<20; i++) DeleteButton(100+i); |
//ñïèñîê äèñêîâ |
Tip(56, "Devices", 78, "="); |
for (i=0;i<disc_num;i++) |
{ |
DrawBar(17,i*16+74,160,17,0xFFFFFF); //ôîí |
DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF); //ñîçäà¸ì êíîïêè, à ïîòîì âûâîäèì íàçâàíèÿ äèñêîâ |
DrawBar(17,i*16+74,160,17,0xFFFFFF); |
DefineButton(17,i*16+74,159,16,100+i+BT_HIDE,0xFFFFFF); |
strcpy(#dev_name, #disk_list[i].Item); |
dev_name[strlen(#dev_name)-1]=NULL; |
switch(dev_name[1]) |
107,76 → 104,36 |
} |
} |
void FileMenu() |
{ |
word id, key; |
loop() switch(WaitEvent()) |
{ |
case evButton: |
id=GetButtonID(); |
ExitProcess(); |
break; |
case evKey: |
IF (GetKey()==27) ExitProcess(); |
break; |
case evReDraw: |
DefineAndDrawWindow(m.x+1+Form.left,m.y+Form.top,159,90,0x01,0xEEEeee,0x01fffFFF); |
DrawBar(1,18,160,51,0xFFFFFF); //áåëîå |
_PutImage(1,23, 16,44, #factions); //èêîíêè |
//rename file |
DefineButton(1,18,159,16,80+BT_HIDE,0xE4DFE1); |
WriteText(26,23,0x80,0,"Rename file"); |
WriteText(134,23,0x80,0x999999,"[F2]"); |
//delete file |
DefineButton(1,35,159,16,81+BT_HIDE,0xE4DFE1); |
WriteText(26,40,0x80,0,"Delete file"); |
WriteText(144,40,0x80,0x999999,"[Del]"); |
//create folder |
DefineButton(1,52,159,16,82+BT_HIDE,0xE4DFE1); |
WriteText(26,57,0x80,0,"Create folder"); |
WriteText(134,57,0x80,0x999999,"[F6]"); |
} |
} |
void Actions() |
char *actions[] = { |
57, "New file", "F7", |
56, "New folder", "F6", |
60, "Options", "F10", |
0,0,0 |
}; |
void ActionsDraw() |
{ |
int actions_y=disc_num*16; |
DeleteButton(80); |
DeleteButton(81); |
DeleteButton(82); |
if (!show_actions) |
Tip(actions_y+90, "Actions", 77, "\x18"); |
else |
int actions_y=disc_num*16+108, lineh=16; |
Tip(actions_y-18, "Actions", 77, ""); //çàãîëîâîê |
for (i=0; actions[i*3]!=0; i++, actions_y+=lineh) |
{ |
Tip(actions_y+90, "Actions", 77, "\x19"); //çàãîëîâîê |
DrawBar(17,actions_y+108,160,51,0xFFFFFF); //áåëîå |
_PutImage(21,actions_y+113, 16,44, #factions); //èêîíêè |
//rename file |
DefineButton(17,actions_y+108,159,16,80+BT_HIDE,0xE4DFE1); |
WriteText(42,actions_y+113,0x80,0,"Rename file"); |
WriteText(150,actions_y+113,0x80,0x999999,"[F2]"); |
//delete file |
DefineButton(17,actions_y+125,159,16,81+BT_HIDE,0xE4DFE1); |
WriteText(42,actions_y+130,0x80,0,"Delete file"); |
WriteText(144,actions_y+130,0x80,0x999999,"[Del]"); |
//create folder |
DefineButton(17,actions_y+142,159,16,82+BT_HIDE,0xE4DFE1); |
WriteText(42,actions_y+147,0x80,0,"Create folder"); |
WriteText(150,actions_y+147,0x80,0x999999,"[F6]"); |
DrawBar(17,actions_y,160,lineh,0xFFFFFF); //áåëîå |
DefineButton(17,actions_y,159,lineh,actions[i*3]+BT_HIDE,0xE4DFE1); |
WriteText(45,actions_y+4,0x80,0,actions[i*3+1]); |
WriteText(-strlen(actions[i*3+2])*6+170,actions_y+4,0x80,0x999999,actions[i*3+2]); |
_PutImage(21,actions_y+2, 14,13, i*14*13*3+#factions); |
} |
} |
void LeftPanelBackground() |
void LeftPanelBgDraw() |
{ |
int actions_y=disc_num*16; |
int start_y = show_actions*51+actions_y+108; |
int start_y = actions_y+156; |
DrawBar(2,41,190,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - íàä äåâàéñàìè |
DrawBar(17,actions_y+75,160,15,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ïîä äåâàéñàìè |
PutShadow(17,actions_y+75,160,1,1,2); |
PutShadow(18,actions_y+75+1,158,1,1,1); |
DrawBar(2,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñëåâà |
DrawBar(177,56,15,actions_y+103,col_lpanel); //ñèíèé ïðÿìîóãîëüíèê - ñïðàâà |
if (onTop(start_y, 6) < 268) |
186,13 → 143,15 |
DrawBar(2,start_y,190,onTop(start_y,6+268),col_lpanel); |
PutPaletteImage(#blue_hl, 190, 268, 2, onTop(268,6), 8, #blue_hl_pal); |
} |
PutShadow(17,start_y,160,1,1,2); |
PutShadow(18,start_y+1,158,1,1,1); |
} |
void DrawLeftPanel() |
{ |
DrawSystemDiscs(); |
Actions(); |
LeftPanelBackground(); |
SystemDiscsDraw(); |
ActionsDraw(); |
LeftPanelBgDraw(); |
} |
/programs/cmm/eolite/include/some_code.h |
---|
12,13 → 12,24 |
List_ReDraw(); |
} |
inline fastcall signed int _strrchr( ESI,BL) |
{ |
int jj=0, last=strlen(ESI); |
do{ |
jj++; |
$lodsb |
IF(AL==BL) last=jj; |
} while(AL!=0); |
return last; |
} |
dword col_palette[14] = {0xD2D3D3,0xD4D4D4,0xD6D5D6,0xD8D7D8,0xDAD8D9,0xDCDADB, |
0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1}; |
inline fastcall void TVScroll() { //Ïðîêðóòêà |
inline fastcall void Scroll() { //Ïðîêðóòêà |
dword on_y, i; |
if (count<=0) |
if (files.count<=0) |
{ |
on_y = 57; |
scroll_size = onTop(22,58); |
25,10 → 36,10 |
} |
else |
{ |
on_y = za_kadrom * onTop(22,57) / count +57; |
scroll_size=onTop(22,57) * f_visible - f_visible / count; |
on_y = files.first * onTop(22,57) / files.count +57; |
scroll_size=onTop(22,57) * files.visible - files.visible / files.count; |
if (scroll_size<20) scroll_size = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà |
if (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+f_visible>=count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà |
if (scroll_size>onTop(22,57)-on_y+56) || (files.first+files.visible>=files.count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà |
} |
DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,-1,"");//ïîëçóíîê |
if (!scroll_used) for (i=0; i<13; i++) DrawBar(onLeft(25-i,0), on_y+2, 1, scroll_size-3, col_palette[13-i]); |