Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5824 → Rev 5825

/programs/cmm/eolite/Eolite.c
193,12 → 193,12
{
if (mouse.y>=files.y)//&&(mouse.click)
{
id = mouse.y - files.y / files.line_h + files.first;
if (files.current!=id)
id = mouse.y - files.y / files.item_h + files.first;
if (files.cur_y!=id)
{
mouse.clearTime();
if(!mouse.up)&&(id-files.first<files.visible) {
files.current = id;
files.cur_y = id;
List_ReDraw();
}
}
214,7 → 214,7
if (files.MouseOver(mouse.x, mouse.y))
{
files.current = mouse.y - files.y / files.line_h + files.first;
files.cur_y = mouse.y - files.y / files.item_h + files.first;
List_ReDraw();
menu_stak = malloc(4096);
CreateThread(#FileMenu,menu_stak+4092);
457,8 → 457,8
Del_Form();
break;
case SCAN_CODE_INS:
selected_offset = file_mas[files.current]*304 + buf+32 + 7;
if (files.current==0) && (!strncmp(selected_offset+33, "..", 2)) goto _INSERT_END; //do not selec ".." directory
selected_offset = file_mas[files.cur_y]*304 + buf+32 + 7;
if (files.cur_y==0) && (!strncmp(selected_offset+33, "..", 2)) goto _INSERT_END; //do not selec ".." directory
if (ESBYTE[selected_offset])
{
ESBYTE[selected_offset]=0;
476,12 → 476,12
FnProcess(key_scancode-58);
break;
default:
for (i=files.current+1; i<files.count; i++)
for (i=files.cur_y+1; i<files.count; i++)
{
strcpy(#temp, file_mas[i]*304+buf+72);
if (temp[0]==key_ascii) || (temp[0]==key_ascii-32)
{
files.current = i - 1;
files.cur_y = i - 1;
files.KeyDown();
List_ReDraw();
break;
575,7 → 575,7
if (!two_panels)
{
DrawDeviceAndActionsLeftPanel();
files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59, files.line_h);
files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59, files.item_h);
DrawList();
Open_Dir(#path,ONLY_SHOW);
}
590,25 → 590,25
llist_copy(#files, #files_inactive);
strcpy(#path, #inactive_path);
col_selec = 0xCCCccc;
files.SetSizes(Form.cwidth/2, 57+22, Form.cwidth/2 -17, Form.cheight-59-22, files.line_h);
files.SetSizes(Form.cwidth/2, 57+22, Form.cwidth/2 -17, Form.cheight-59-22, files.item_h);
DrawList();
Open_Dir(#path,WITH_REDRAW);
llist_copy(#files, #files_active);
strcpy(#path, #active_path);
col_selec = 0x94AECE;
files.SetSizes(2, 57+22, Form.cwidth/2-2-17, Form.cheight-59-22, files.line_h);
files.SetSizes(2, 57+22, Form.cwidth/2-2-17, Form.cheight-59-22, files.item_h);
DrawList();
Open_Dir(#path,WITH_REDRAW);
}
if (active_panel==2)
{
files.SetSizes(2, 57+22, Form.cwidth/2-2-17, Form.cheight-59-22, files.line_h);
files.SetSizes(2, 57+22, Form.cwidth/2-2-17, Form.cheight-59-22, files.item_h);
DrawList();
Open_Dir(#path,WITH_REDRAW);
llist_copy(#files, #files_active);
strcpy(#path, #active_path);
col_selec = 0x94AECE;
files.SetSizes(Form.cwidth/2, 57+22, Form.cwidth/2 -17, Form.cheight-59-22, files.line_h);
files.SetSizes(Form.cwidth/2, 57+22, Form.cwidth/2 -17, Form.cheight-59-22, files.item_h);
DrawList();
Open_Dir(#path,WITH_REDRAW);
}
619,30 → 619,30
void List_ReDraw()
{
int all_lines_h;
static int old_current, old_first;
static int old_cur_y, old_first;
 
files.CheckDoesValuesOkey(); //prevent some shit
 
if (list_full_redraw) || (old_first != files.first)
{
old_current = files.current;
old_cur_y = files.cur_y;
old_first = files.first;
list_full_redraw = false;
goto _ALL_LIST_REDRAW;
}
if (old_current != files.current)
if (old_cur_y != files.cur_y)
{
if (old_current-files.first<files.visible) Line_ReDraw(0xFFFFFF, old_current-files.first);
Line_ReDraw(col_selec, files.current-files.first);
old_current = files.current;
if (old_cur_y-files.first<files.visible) Line_ReDraw(0xFFFFFF, old_cur_y-files.first);
Line_ReDraw(col_selec, files.cur_y-files.first);
old_cur_y = files.cur_y;
return;
}
 
_ALL_LIST_REDRAW:
 
for (j=0; j<files.visible; j++) if (files.current-files.first!=j) Line_ReDraw(0xFFFFFF, j); else Line_ReDraw(col_selec, files.current-files.first);
for (j=0; j<files.visible; j++) if (files.cur_y-files.first!=j) Line_ReDraw(0xFFFFFF, j); else Line_ReDraw(col_selec, files.cur_y-files.first);
//in the bottom
all_lines_h = j * files.line_h;
all_lines_h = j * files.item_h;
DrawBar(files.x,all_lines_h + files.y,files.w,files.h - all_lines_h,0xFFFFFF);
DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h,system.color.work);
655,14 → 655,14
ext1, attr,
file_offet,
file_name_off,
y=filenum*files.line_h+files.y;
y=filenum*files.item_h+files.y;
BDVK file;
if (filenum==-1) return;
DrawBar(files.x,y,3,files.line_h,bgcol);
DrawBar(files.x+19,y,files.w-19,files.line_h,bgcol);
DrawBar(files.x,y,3,files.item_h,bgcol);
DrawBar(files.x+19,y,files.w-19,files.item_h,bgcol);
DrawBar(files.x+3,y+17,16,1,bgcol);
if (files.line_h>18) DrawBar(files.x+3,y+18,16,files.line_h-18,bgcol);
if (files.line_h>15) DrawBar(files.x+3,y,16,files.line_h-15,bgcol);
if (files.item_h>18) DrawBar(files.x+3,y+18,16,files.item_h-18,bgcol);
if (files.item_h>15) DrawBar(files.x+3,y,16,files.item_h-15,bgcol);
 
file_offet = file_mas[filenum+files.first]*304 + buf+32;
attr = ESDWORD[file_offet];
674,13 → 674,13
{
ext1 = strrchr(file_name_off,'.') + file_name_off;
if (ext1==file_name_off) ext1 = " \0"; //if no extension then show nothing
Put_icon(ext1, files.x+3, files.line_h/2-7+y, bgcol, 0);
Put_icon(ext1, files.x+3, files.item_h/2-7+y, bgcol, 0);
WriteText(7-strlen(ConvertSize(file.sizelo))*6+files.x+files.w - 58, files.text_y + y +1,files.font_type,0,ConvertSize(file.sizelo));
}
else
{
if (!strncmp(file_name_off,"..",3)) ext1=".."; else ext1="<DIR>";
Put_icon(ext1, files.x+3, files.line_h/2-7+y, bgcol, 0);
Put_icon(ext1, files.x+3, files.item_h/2-7+y, bgcol, 0);
}
 
if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
708,11 → 708,11
else
{
font.bg_color = bgcol;
font.prepare(files.x + 23, files.line_h - font.height / 2 + y, file_name_off);
font.prepare(files.x + 23, files.item_h - font.height / 2 + y, file_name_off);
font.show();
}
DrawBar(files.x+files.w-141,y,1,files.line_h,system.color.work); //gray line 1
DrawBar(files.x+files.w-68,y,1,files.line_h,system.color.work); //gray line 2
DrawBar(files.x+files.w-141,y,1,files.item_h,system.color.work); //gray line 1
DrawBar(files.x+files.w-68,y,1,files.item_h,system.color.work); //gray line 2
}
 
 
734,7 → 734,7
}
maxcount = sizeof(file_mas)/sizeof(dword)-1;
if (files.count>maxcount) files.count = maxcount;
if (files.count>0) && (files.current-files.first==-1) files.current=0;
if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
}
if (files.count!=-1)
{
746,7 → 746,7
PathShow_draw stdcall(#PathShow);
}
HistoryPath(ADD_NEW_PATH);
files.visible = files.h / files.line_h;
files.visible = files.h / files.item_h;
if (files.count < files.visible) files.visible = files.count;
if (redraw!=ONLY_SHOW) Sorting();
list_full_redraw = true;
943,7 → 943,7
Open_Dir(#path,ONLY_OPEN);
if (!real_files_names_case) strttl(that_file);
for (ind=files.count-1; ind>=0; ind--;) { if (!strcmp(file_mas[ind]*304+buf+72,that_file)) break; }
files.current = ind - 1;
files.cur_y = ind - 1;
files.KeyDown();
List_ReDraw();
}
983,7 → 983,7
if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
strcpy(#path, #file_path);
if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end
files.first=files.current=0;
files.first=files.cur_y=0;
Open_Dir(#path,WITH_REDRAW);
}
}
/programs/cmm/eolite/include/menu.h
64,7 → 64,7
menu.visible++;
}
menu.w = menu.w + 3 * menu.font_w + 50;
menu.h = menu.count * menu.line_h;
menu.h = menu.count * menu.item_h;
SetEventMask(100111b);
goto _MENU_DRAW;
86,7 → 86,7
case evReDraw: _MENU_DRAW:
if (menu_call_mouse) DefineAndDrawWindow(mouse.x+Form.left+5, mouse.y+Form.top+GetSkinHeight(),menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF);
else DefineAndDrawWindow(Form.left+files.x+15, files.line_h*files.current+files.y+Form.top+30,menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF);
else DefineAndDrawWindow(Form.left+files.x+15, files.item_h*files.cur_y+files.y+Form.top+30,menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF);
GetProcessInfo(#MenuForm, SelfInfo);
DrawRectangle(0,0,menu.w+1,menu.h+2,system.color.work_graph);
DrawBar(1,1,menu.w,1,0xFFFfff);
102,19 → 102,19
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)
DrawBar(1,start_y+2,1,menu.item_h,0xFFFfff);
if (start_y/menu.item_h==menu.cur_y)
{
cur_action_buf = file_captions[index*3+2];
DrawBar(2,start_y+2,menu.w-1,menu.line_h,0xFFFfff);
DrawBar(2,start_y+2,menu.w-1,menu.item_h,0xFFFfff);
}
else
{
DrawBar(2,start_y+2,menu.w-1,menu.line_h,system.color.work);
DrawBar(2,start_y+2,menu.w-1,menu.item_h,system.color.work);
WriteText(8,start_y+menu.text_y+4,menu.font_type,0xf2f2f2,file_captions[index*3]);
}
WriteText(7, start_y + menu.text_y + 3, menu.font_type, system.color.work_text, file_captions[index*3]);
WriteText(-strlen(file_captions[index*3+1])-1*menu.font_w + menu.w, start_y + menu.text_y + 3, menu.font_type, 0x888888, file_captions[index*3+1]);
start_y+=menu.line_h;
start_y+=menu.item_h;
}
}
/programs/cmm/eolite/include/settings.h
43,8 → 43,8
else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
else if (id==22) info_after_copy ^= 1;
else if (id==24) two_panels ^= 1;
else if (id==25) { files.line_h++; files_active.line_h = files_inactive.line_h = files.line_h; }
else if (id==26) && (files.line_h>18) files.line_h--;
else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
else if (id==26) && (files.item_h>18) files.item_h--;
else if (id==27) MOUSE_TIME++;
else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
else if (id==30) { font.size.text++; IF(!font.changeSIZE()) font.size.text--; BigFontsChange(); }
81,7 → 81,7
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels);
MoreLessBox(10, 103, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
MoreLessBox(10, 130, 18, 25, 26, #system.color, files.line_h, LIST_LINE_HEIGHT);
MoreLessBox(10, 130, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
if (font.data) MoreLessBox(10, 157, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
}
 
96,7 → 96,7
ini_get_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", 0); info_after_copy = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 9); font.size.text = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 18); files.line_h = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 18); files.item_h = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX;
112,7 → 112,7
ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font.size.text);
ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.line_h);
ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top);
126,7 → 126,7
{
char error_message[500];
dword ii;
if (files.current>=0) Line_ReDraw(0xFF0000, files.current);
if (files.cur_y>=0) Line_ReDraw(0xFF0000, files.cur_y);
pause(5);
sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
notify(#error_message);
148,9 → 148,9
 
void BigFontsChange()
{
files.line_h = font.size.text + 4;
if (files.line_h<18) files.line_h = 18;
files_active.line_h = files_inactive.line_h = files.line_h;
files.item_h = font.size.text + 4;
if (files.item_h<18) files.item_h = 18;
files_active.item_h = files_inactive.item_h = files.item_h;
}