Eolite/KFM2: global refactoring, use proper multi-panes PATH variable

git-svn-id: svn://kolibrios.org@8949 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-06-27 09:28:59 +00:00
parent c213c7fdf5
commit 5bb70bb219
17 changed files with 354 additions and 358 deletions

View File

@ -27,7 +27,6 @@ img_files = {
{"NOTIFY3.PNG", "common/notify3.png"},
{"UNIMG", PROGS .. "/fs/unimg/unimg"},
{"3D/HOUSE.3DS", "common/3d/house.3ds"},
{"File Managers/KFM2", "common/File Managers/kfm2"},
{"File Managers/ICONS.INI", "common/File Managers/icons.ini"},
{"File Managers/KFM.INI", "common/File Managers/kfm.ini"},
{"File Managers/FNAV/ABOUT.TXT", "common/File Managers/fNav/About.txt"},
@ -656,6 +655,7 @@ tup.append_table(img_files, {
{"DEVELOP/MENU", PROGS .. "/cmm/menu/menu.com"},
{"DEVELOP/PIPET", PROGS .. "/cmm/misc/pipet.com"},
{"File Managers/EOLITE", PROGS .. "/cmm/eolite/Eolite.com"},
{"File Managers/KFM2", PROGS .. "/cmm/misc/kfm2.com"},
{"KF_VIEW", PROGS .. "/cmm/kf_font_viewer/font_viewer.com"},
{"DEVELOP/DIFF", PROGS .. "/cmm/diff/diff.com"},
{"GAMES/CLICKS", PROGS .. "/games/clicks/trunk/clicks.com"},

Binary file not shown.

View File

@ -3,9 +3,9 @@
// 70.5 - get volume info and label
#define ABOUT_TITLE "EOLITE 5 Beta8"
#define TITLE_EOLITE "Eolite File Manager 5 Beta8"
#define TITLE_KFM "Kolibri File Manager 2 Beta8";
#define ABOUT_TITLE "EOLITE 5 Beta9"
#define TITLE_EOLITE "Eolite File Manager 5 Beta9"
#define TITLE_KFM "Kolibri File Manager 2 Beta9";
#define MEMSIZE 1024 * 250
#include "../lib/clipboard.h"
@ -74,8 +74,7 @@ bool list_full_redraw;
collection_int items=0;
int selected_count;
int folder_count;
//dword path;
char path[4096];
dword path;
//Sselected element data
byte file_path[4096];
@ -93,13 +92,10 @@ bool list_full_redraw;
int status_bar_h;
int icon_size = 18;
int active_panel=0;
int disk_popin_active_on_panel=0;
#define PANES_COUNT 2
unsigned char location[PANES_COUNT];
char active_path[4096], inactive_path[4096];
dword location[PANES_COUNT];
dword about_stak=0,properties_stak=0,settings_stak=0;
byte cmd_free=0;
@ -134,11 +130,7 @@ void handle_param()
//-v : paste files/folder from clipboard
int i;
dword p = #param;
if (param[0]=='\\') && (param[1]=='E') && (param[2]=='F') && (param[3]=='M') {
efm = true;
p += 4;
if (param[4]==' ') p++;
}
if (streq(#program_path+strrchr(#program_path,'/'), "KFM")) efm = true;
LoadIniSettings();
@ -146,7 +138,7 @@ void handle_param()
location[i] = malloc(4096);
strcpy(location[i], #path_start);
}
//path = location[0];
path = location[0];
if (ESBYTE[p]=='\0') return;
@ -157,31 +149,29 @@ void handle_param()
itdir = dir_exists(#file_path);
strcpy(#file_name, p + strrchr(p, '/'));
ESBYTE[strrchr(p, '/')+p-1] = '\0';
strcpy(#path, p + 3);
strcpy(path, p + 3);
properties_dialog();
ExitProcess();
case 'd':
strcpy(#path, p + 3);
strcpy(path, p + 3);
DeleteThread();
ExitProcess();
case 'v':
cut_active = ESBYTE[p+2] - '0';
strcpy(#path, p + 4);
strcpy(path, p + 4);
PasteThread();
ExitProcess();
}
ESBYTE[0] = NULL;
if (param[strlen(#param)-1]=='/') ESBYTE[strlen(#param)-1]=NULL; //no "/" at the end
if (dir_exists(p)) {
strcpy(#path, p);
strcpy(path, p);
} else {
if (file_exists(p)) {
ESBYTE[strrchr(p, '/')+p-1] = '\0';
strcpy(#path, p);
SelectFileByName(p+strlen(#path)+1);
strcpy(path, p);
SelectFileByName(p+strlen(path)+1);
} else {
notify(T_NOTIFY_APP_PARAM_WRONG);
}
@ -200,11 +190,8 @@ void main()
SetAppColors();
handle_param();
ESBYTE[0] = NULL;
SystemDiscs.Get();
Open_Dir(#path,ONLY_OPEN);
strcpy(#inactive_path, #path);
Open_Dir(path,ONLY_OPEN);
llist_copy(#files_inactive, #files);
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
loop() switch(@WaitEventTimeout(100))
@ -333,7 +320,7 @@ void main()
{
case PATH_BTN:
notify(COPY_PATH_STR);
Clipboard__CopyText(#path);
Clipboard__CopyText(path);
break;
case KFM_DEV_DROPDOWN_1:
case KFM_DEV_DROPDOWN_1+1:
@ -359,7 +346,7 @@ void main()
FnProcess(id-50);
break;
case 61: // Set path as default
SetDefaultPath(#path);
SetDefaultPath(path);
break;
case 100...120:
EventDriveClick(id);
@ -444,7 +431,7 @@ void main()
EventOpenConsoleHere();
break;
case SCAN_CODE_KEY_V:
EventPaste(#path);
EventPaste(path);
break;
case SCAN_CODE_KEY_D: //set image as bg
strlcpy(#temp, "\\S__",4);
@ -588,9 +575,8 @@ void draw_window()
for (i=0; i<6; i++) DrawBar(0, 34+i, Form.cwidth, 1, MixColors(sc.work_dark, sc.work, i*10));
for (i=0; i<6; i++) DrawBar(0, 5-i, Form.cwidth, 1, MixColors(sc.work_light, sc.work, i*10));
llist_copy(#files_active, #files);
strcpy(#active_path, #path);
DrawStatusBar();
if (!selected_count) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001]
if (!selected_count) Open_Dir(path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001]
DrawFilePanels();
disk_popin_active_on_panel = 0;
}
@ -610,7 +596,9 @@ void DrawButtonsAroundList()
if (sort_type==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
WriteText(sorting_arrow_x,files.y-12,0x80, sc.work_text, sorting_arrow_t);
DrawBar(files.x+files.w,files.y,1,files.h,sc.work_graph);
if (efm) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,sc.work_graph);
if (efm) && (files.x<5) {
DrawBar(files.x+files.w+16,files.y,1,files.h,EDX); //line between panel
}
}
void DrawFuncButtonsInKfm()
@ -621,6 +609,7 @@ void DrawFuncButtonsInKfm()
for (i=0; i<10; i++) {
len = strlen(kfm_func[i])+2*6 + padding;
if (i==9) len = Form.cwidth - x - 3;
DrawBar(x, Form.cheight - 19, 1, 17, sc.work);
DrawFuncButton(x+1, Form.cheight - 19, len, i+KFM_FUNC_ID+1, i+1, kfm_func[i]);
x += len + 2;
}
@ -632,7 +621,9 @@ void DrawStatusBar()
int go_up_folder_exists=0;
if (efm) {
DrawBar(0, Form.cheight - status_bar_h+15, Form.cwidth, status_bar_h-15, sc.work);
DrawBar(0, Form.cheight - status_bar_h+15, Form.cwidth, 3, sc.work);
DrawBar(0, Form.cheight - 2, Form.cwidth, 2, sc.work);
DrawBar(Form.cwidth-1, Form.cheight - 19, 1, 17, sc.work);
DrawFuncButtonsInKfm();
DrawPathBar();
return;
@ -652,9 +643,9 @@ void DrawStatusBar()
void DrawFilePanels()
{
int files_y;
int files_y = files.y;
int w2 = -Form.cwidth-1/2+Form.cwidth;
int h2;
int h2 = Form.cheight-files_y-2 - status_bar_h;
if (!efm)
{
DrawDeviceAndActionsLeftPanel();
@ -664,37 +655,33 @@ void DrawFilePanels()
}
else
{
llist_copy(#files_active, #files);
llist_copy(#files, #files_inactive);
strcpy(#path, #inactive_path);
files_y = files.y;
h2 = Form.cheight-files_y-2 - status_bar_h;
col.selec = col.selec_inactive; //this is a bad code: need to use some var to set inactive panel for DrawButtonsAroundList();
path = location[active_panel^1];
if (active_panel==0)
{
files.SetSizes(Form.cwidth/2, files_y, w2-17, h2, files.item_h);
DrawButtonsAroundList();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
files_inactive.count = files.count;
llist_copy(#files, #files_active);
strcpy(#path, #active_path);
col.selec = col.selec_active;
path = location[active_panel];
files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h);
DrawButtonsAroundList();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
}
if (active_panel==1)
{
files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h);
DrawButtonsAroundList();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
files_inactive.count = files.count;
llist_copy(#files, #files_active);
strcpy(#path, #active_path);
col.selec = col.selec_active;
path = location[active_panel];
files.SetSizes(Form.cwidth/2, files_y, w2 -17, h2, files.item_h);
DrawButtonsAroundList();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
}
}
}
@ -745,7 +732,6 @@ void List_ReDraw()
void Line_ReDraw(dword bgcol, filenum){
dword text_col=col.list_gb_text,
ext1, attr,
file_offet,
file_name_off,
file_size=0,
y=filenum*files.item_h+files.y,
@ -753,9 +739,15 @@ void Line_ReDraw(dword bgcol, filenum){
BDVK file;
char full_path[4096];
dword separator_color;
bool current_inactive = false;
char label_file_name[4096];
if (filenum==-1) return;
if (bgcol==col.selec) && (files.x==files_inactive.x) {
bgcol = col.list_bg;
current_inactive = true;
}
DrawBar(files.x,y,4,files.item_h,bgcol);
DrawBar(files.x+4,y,icon_size,icon_y-y,bgcol);
if (files.item_h>icon_size) DrawBar(files.x+4,icon_y+icon_size-1,icon_size,y+files.item_h-icon_y-icon_size+1,bgcol);
@ -769,39 +761,40 @@ void Line_ReDraw(dword bgcol, filenum){
DrawBar(files.x+files.w-141,y,1,files.item_h, separator_color);
DrawBar(files.x+files.w-68,y,1,files.item_h, separator_color);
file_offet = items.get(filenum+files.first)*304 + buf+32;
attr = ESDWORD[file_offet];
file.selected = ESBYTE[file_offet+7];
file.sizelo = ESDWORD[file_offet+32];
file.sizehi = ESDWORD[file_offet+36];
file_name_off = file_offet+40;
ESI = items.get(filenum+files.first)*304 + buf+32;
attr = ESDWORD[ESI];
file.selected = ESBYTE[ESI+7];
file.sizelo = ESDWORD[ESI+32];
file.sizehi = ESDWORD[ESI+36];
file_name_off = ESI+40;
sprintf(#full_path,"%s/%s",path,file_name_off);
if (! attr & ATR_FOLDER) //file or folder?
if (attr&ATR_FOLDER)
{
if (!strcmp(file_name_off,"..")) ext1="<up>"; else {
ext1="<DIR>";
WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
}
if (chrnum(path, '/')==1) && (streq(path, "/kolibrios")==false) file_size = GetDeviceSize(#full_path);
}
else
{
ext1 = strrchr(file_name_off,'.') + file_name_off;
if (ext1==file_name_off) ext1 = NULL; //if no extension then show nothing
file_size = ConvertSize64(file.sizelo, file.sizehi);
if (ext1) && (strlen(ext1)<9) WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
}
else
{
if (!strcmp(file_name_off,"..")) ext1="<up>"; else {
ext1="<DIR>";
WriteTextCenter(files.x+files.w-140, files.text_y+y+1, 72, col.list_gb_text, ext1);
}
if (chrnum(#path, '/')==1) && (streq(#path, "/kolibrios")==false) file_size = GetDeviceSizeLabel(#full_path);
}
if (file_size) WriteText(7-strlen(file_size)*6+files.x+files.w-58,
files.text_y+y+1, files.font_type, col.list_gb_text, file_size);
if (attr&2) || (attr&4) text_col=col.list_text_hidden; //system or hiden?
if (attr&ATR_HIDDEN) || (attr&ATR_SYSTEM) text_col=col.list_text_hidden;
if (bgcol==col.selec)
{
file_name_is_8_3(file_name_off);
itdir = attr & ATR_FOLDER;
strcpy(#file_name, file_name_off);
if (!strcmp(#path,"/")) sprintf(#file_path,"%s%s",#path,file_name_off);
else sprintf(#file_path,"%s/%s",#path,file_name_off);
if (streq(path,"/")) sprintf(#file_path,"%s%s",path,file_name_off);
else sprintf(#file_path,"%s/%s",path,file_name_off);
if (text_col==col.list_text_hidden) {
text_col=MixColors(col.selec_text, col.list_text_hidden, 65);
} else text_col=col.selec_text;
@ -822,6 +815,7 @@ void Line_ReDraw(dword bgcol, filenum){
}
else
{
//that shit must be it a library
strcpy(#label_file_name, file_name_off);
if (kfont.getsize(kfont.size.pt, #label_file_name) + 141 + 26 > files.w)
{
@ -833,10 +827,8 @@ void Line_ReDraw(dword bgcol, filenum){
kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y,
bgcol, text_col, kfont.size.pt, #label_file_name);
}
if (bgcol == col.selec_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, col.selec_active);
sprintf(#full_path,"%s/%s",#path,file_name_off);
DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
if (current_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, col.selec_active);
}
@ -848,24 +840,24 @@ void Open_Dir(dword dir_path, redraw){
errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT);
if (errornum)
{
history.add(#path);
history.add(path);
EventHistoryGoBack();
Write_Error(errornum);
return;
}
if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
history.add(#path);
SystemDiscs.Draw();
files.visible = files.h / files.item_h;
if (files.count < files.visible) files.visible = files.count;
if (!strncmp(dir_path, "/rd/1/",5)) || (!strncmp(dir_path, "/sys/",4))
if (!strncmp(dir_path, "/rd/1",5)) || (!strncmp(dir_path, "/sys/",4))
dir_at_fat16 = true; else dir_at_fat16 = false;
Sorting();
list_full_redraw = true;
SetCurDir(dir_path);
DrawPathBar();
if (redraw!=ONLY_OPEN) {
history.add(path);
List_ReDraw();
DrawStatusBar();
}
@ -879,7 +871,7 @@ inline Sorting()
items.drop();
if (!strcmp(#path,"/")) //do not sort root folder
if (streq(path,"/")) //do not sort root folder
{
for(d=1;d<files.count;d++;) items.set(d, d);
folder_count = d;
@ -952,7 +944,7 @@ void SelectFileByName(dword that_file)
{
int ind;
files.KeyHome();
Open_Dir(#path,ONLY_OPEN);
Open_Dir(path,ONLY_OPEN);
if (dir_at_fat16) && (file_name_is_8_3(that_file)) strttl(that_file);
for (ind=files.count-1; ind>=0; ind--;) { if (!strcmpi(items.get(ind)*304+buf+72,that_file)) break; }
files.cur_y = ind - 1;
@ -966,11 +958,11 @@ void Dir_Up()
{
int iii;
char old_folder_name[4096];
iii=strlen(#path)-1;
iii=strlen(path)-1;
if (iii==0) return;
iii = strrchr(#path, '/');
strcpy(#old_folder_name, #path+iii);
if (iii>1) path[iii-1]=NULL; else path[iii]=NULL;
iii = strrchr(path, '/');
strcpy(#old_folder_name, path+iii);
if (iii>1) ESBYTE[path+iii-1]=NULL; else ESBYTE[path+iii]=NULL;
SelectFileByName(#old_folder_name);
}
@ -980,7 +972,7 @@ void EventOpenSelected()
for (i=0; i<files.count; i++) if (getElementSelectedFlag(i)) {
EDX = items.get(i)*304 + buf+32;
if (ESDWORD[EDX]&ATR_FOLDER) continue; //is foder
sprintf(#param,"%s/%s",#path, EDX+40);
sprintf(#param,"%s/%s",path, EDX+40);
RunProgram("/sys/@open", #param);
}
}
@ -1002,18 +994,18 @@ void EventOpen(byte _new_window)
else
{
if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; }
strcpy(#path, #file_path);
strcpy(path, #file_path);
files.first=files.cur_y=0;
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
}
}
inline fastcall void EventHistoryGoBack()
{
char cur_folder[4096];
strcpy(#cur_folder, #path);
strcpy(#cur_folder, path);
if (history.back()) {
strcpy(#path, history.current());
strcpy(path, history.current());
SelectFileByName(#cur_folder+strrchr(#cur_folder,'/'));
}
}
@ -1030,7 +1022,7 @@ void NewElement()
BDVK element_info;
byte copy_result, info_result;
sprintf(#temp,"%s/%s",#path,new_file_ed.text);
sprintf(#temp,"%s/%s",path,new_file_ed.text);
info_result = GetFileInfo(#temp, #element_info);
switch(new_element_active)
{
@ -1078,7 +1070,7 @@ void NewElement()
}
}
}
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
SelectFileByName(new_file_ed.text);
EventClosePopinForm();
}
@ -1126,7 +1118,7 @@ void FnProcess(byte N)
case 5:
if (efm) {
CopyFilesListToClipboard(COPY);
EventPaste(#inactive_path);
EventPaste(location[active_panel^1]);
} else {
EventManualFolderRefresh();
}
@ -1134,7 +1126,7 @@ void FnProcess(byte N)
case 6:
if (efm) {
CopyFilesListToClipboard(CUT);
EventPaste(#inactive_path);
EventPaste(location[active_panel^1]);
}
break;
case 7:
@ -1147,15 +1139,11 @@ void FnProcess(byte N)
NewElement_Form(CREATE_FILE, T_NEW_FILE);
break;
case 10: //F10
if (!active_settings)
{
if (active_settings) {
ActivateWindow(GetProcessSlot(settings_window));
} else {
settings_stak = malloc(4096);
settings_window = CreateThread(#settings_dialog, settings_stak+4092);
break;
}
else
{
ActivateWindow(GetProcessSlot(settings_window));
}
break;
}
@ -1167,8 +1155,8 @@ void SetActivePanel(int _active)
active_panel = _active;
llist_copy(#files_active, #files_inactive);
llist_copy(#files_inactive, #files);
strcpy(#active_path, #inactive_path);
strcpy(#inactive_path, #path);
llist_copy(#files, #files_active);
path = location[active_panel];
DrawFilePanels();
}
}
@ -1189,13 +1177,13 @@ void EventSelectFileByKeyPress()
}
}
dword GetDeviceSizeLabel(dword path)
dword GetDeviceSize(dword p)
{
BDVK bdvk;
if (ESBYTE[path+1] == '/') path++;
if (ESBYTE[path+1] == 'c') && (ESBYTE[path+2] == 'd')
&& (ESBYTE[path+4] == 0) return 0;
GetFileInfo(path, #bdvk);
if (ESBYTE[p+1] == '/') p++;
if (ESBYTE[p+1] == 'c') && (ESBYTE[p+2] == 'd')
&& (ESBYTE[p+4] == 0) return 0;
GetFileInfo(p, #bdvk);
return ConvertSize64(bdvk.sizelo, bdvk.sizehi);
}
@ -1213,7 +1201,7 @@ int GetRealFileCountInFolder(dword folder_path)
void EventRefreshDisksAndFolders()
{
if(efm) {
if (GetRealFileCountInFolder(#inactive_path) != files_inactive.count) {
if (GetRealFileCountInFolder(location[active_panel^1]) != files_inactive.count) {
DrawFilePanels();
return;
}
@ -1223,7 +1211,7 @@ void EventRefreshDisksAndFolders()
DrawDeviceAndActionsLeftPanel();
}
}
if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
if(GetRealFileCountInFolder(path) != files.count) Open_Dir(path,WITH_REDRAW);
}
void EventManualFolderRefresh()
@ -1241,27 +1229,27 @@ void EventSort(dword id)
else sort_type = id;
strcpy(#selected_filename, #file_name);
DrawButtonsAroundList();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
SelectFileByName(#selected_filename);
}
void EventHistoryGoForward()
{
if (history.forward()) {
strcpy(#path, history.current());
strcpy(path, history.current());
files.KeyHome();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
}
}
void EventOpenNewEolite()
{
RunProgram(I_Path, #path);
RunProgram(I_Path, path);
}
void EventOpenConsoleHere()
{
sprintf(#param, "pwd cd %s", #path);
sprintf(#param, "pwd cd %s", path);
RunProgram("/sys/shell", #param);
}
@ -1374,7 +1362,7 @@ void EventToolbarButtonClick(int _btid)
case GOUP_BTN: Dir_Up(); break;
case COPY_BTN: CopyFilesListToClipboard(CUT); break;
case CUT_BTN: CopyFilesListToClipboard(COPY); break;
case PASTE_BTN:EventPaste(#path); break;
case PASTE_BTN:EventPaste(path); break;
}
}
@ -1391,10 +1379,10 @@ void EventOpenDiskPopin(int panel_n)
DefineHiddenButton(0,0,5000,3000,9999+BT_NOFRAME);
if (panel_n==0) {
disk_popin_active_on_panel = 1;
SystemDiscs.DrawOptions(Form.cwidth/2-DDW, 8+DEV_H_HOR+3);
SystemDiscs.DrawOptions(Form.cwidth/2-DDW);
} else {
disk_popin_active_on_panel = 2;
SystemDiscs.DrawOptions(Form.cwidth-DDW-2, 8+DEV_H_HOR+3);
SystemDiscs.DrawOptions(Form.cwidth-DDW-2);
}
}

View File

@ -3,4 +3,4 @@ if tup.getconfig("LANG") == "ru"
then C_LANG = "LANG_RUS"
else C_LANG = "LANG_ENG" -- this includes default case without config
end
tup.rule("Eolite.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "Eolite.com")
tup.rule("Eolite.c", "c-- /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "Eolite.com")

View File

@ -6,7 +6,7 @@
//===================================================//
char work_area_pointer[1024];
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x000000, 0xFFFFCC, #path, #work_area_pointer, 0};
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x000000, 0xFFFFCC, NULL, #work_area_pointer, 0};
void DrawPathBar()
{
if (efm) {
@ -19,6 +19,7 @@ void DrawPathBar()
return;
}
PathShow.text_pointer = location[0];
PathShow.start_x = 250;
PathShow.start_y = 17;
PathShow.area_size_x = Form.cwidth-300;
@ -47,35 +48,27 @@ void DrawPathBarKfm()
bgc = 0xFFFFCC;
PathShow.font_color = 0x222222;
}
if (active_panel==0) PathShow.text_pointer = #path; else PathShow.text_pointer = #inactive_path;
PathShow.start_x = 4;
PathShow.area_size_x = Form.cwidth/2-8;
PathShow.start_y = Form.cheight - status_bar_h+2;
_DRAW_BAR:
DrawBar(PathShow.start_x-2,PathShow.start_y-3,PathShow.area_size_x+5,14,bgc);
DrawRectangle(PathShow.start_x-3,PathShow.start_y-4,PathShow.area_size_x+6,15,sc.work_graph);
PathShow_prepare stdcall(#PathShow);
PathShow_draw stdcall(#PathShow);
i++;
if (i<2) {
if (active_panel==0) PathShow.text_pointer = #inactive_path; else PathShow.text_pointer = #path;
PathShow.start_x = 4;
PathShow.area_size_x = Form.cwidth/2-8;
do {
DrawBar(PathShow.start_x-2,PathShow.start_y-3,PathShow.area_size_x+5,14,bgc);
DrawRectangle(PathShow.start_x-3,PathShow.start_y-4,PathShow.area_size_x+6,15,sc.work_graph);
PathShow.text_pointer = location[i];
PathShow_prepare stdcall(#PathShow);
PathShow_draw stdcall(#PathShow);
PathShow.start_x = Form.cwidth/2 + 2;
PathShow.area_size_x = Form.cwidth - PathShow.start_x - 5;
goto _DRAW_BAR;
}
PathShow.area_size_x = Form.cwidth - PathShow.start_x - 5;
i++;
} while (i<2);
DrawBar(0,PathShow.start_y-2,1,15,sc.work);
DrawBar(Form.cwidth-1,PathShow.start_y-2,1,15,sc.work);
DrawBar(1,PathShow.start_y+12,Form.cwidth-2,1,sc.work_light);
}
void DrawPathBarKfm_Line()
{
}
//===================================================//
// //
// BREADCRUMBS //
@ -89,7 +82,7 @@ void DrawBreadCrumbs()
int i;
unsigned text_line;
{
strcat(#PathShow_path, #path);
strcat(#PathShow_path, path);
for (i=0; i<50; i++) DeleteButton(i+BREADCRUMB_ID);
breadCrumb.drop();
for (i=0; (PathShow_path[i]) && (i<sizeof(PathShow_path)-1); i++)
@ -118,12 +111,12 @@ void DrawBreadCrumbs()
void ClickOnBreadCrumb(unsigned clickid)
{
int i, slashpos = #path;
int i, slashpos = path;
for (i=0; i!=clickid+2; i++) {
slashpos=strchr(slashpos,'/')+1;
}
ESBYTE[slashpos-1] = NULL;
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
}

View File

@ -1,31 +1,37 @@
#ifdef LANG_RUS
?define T_FILE "” ©«"
?define T_TYPE "’¨¯"
?define T_SIZE "<EFBFBD> §¬¥à"
?define T_NEW_FOLDER "<EFBFBD>®¢ ï ¯ ¯ª "
?define T_NEW_FILE "<EFBFBD>®¢ë© ä ©«"
?define T_DELETE_FILE "‚ë ¤¥©á⢨⥫쭮 å®â¨â¥ 㤠«¨âì"
?define T_YES "„ "
?define T_NO "<EFBFBD>¥â"
?define T_CANCEL "Žâ¬¥­ "
?define T_CREATE "‘®§¤ âì"
?define T_RENAME "<EFBFBD>¥à¥­ §¢ âì"
?define FS_ITEM_ALREADY_EXISTS "'<27>«¥¬¥­â á â ª¨¬ ¨¬¥­¥¬ 㦥 áãé¥áâ¢ã¥â' -E"
?define NOT_CREATE_FOLDER "'<27>¥ 㤠«®áì ᮧ¤ âì ¯ ¯ªã.' -E"
?define NOT_CREATE_FILE "'<27>¥ 㤠«®áì ᮧ¤ âì ä ©«.' -E"
?define T_NOTIFY_APP_PARAM_WRONG "'<27> à ¬¥âà ¤«ï § ¯ã᪠ Eolite ­¥ ¢¥à¥­: ¯ ¯ª  ­¥ áãé¥áâ¢ã¥â!' -E"
?define T_COPY_WINDOW_TITLE "Š®¯¨àãî..."
?define T_MOVE_WINDOW_TITLE "<EFBFBD>¥à¥¬¥é î..."
?define T_DELETE_WINDOW_TITLE "“¤ «ïî..."
?define T_ABORT_WINDOW_BUTTON "<EFBFBD>à¥à¢ âì"
?define T_SELECT_APP_TO_OPEN_WITH "‚ë¡¥à¨â¥ ¯à®£à ¬¬ã ¤«ï ®âªàëâ¨ï ä ©« "
?define DEL_MORE_FILES_1 "¢ë¡à ­­ë¥ í«¥¬¥­âë ("
?define DEL_MORE_FILES_2 " èâ.)?"
?define T_STATUS_EVEMENTS "<EFBFBD> ¯®ª: %d ” ©«®¢: %d"
?define T_STATUS_SELECTED "‚뤥«¥­­®: %d"
?define COPY_PATH_STR "'<27>ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ­ ¢ ¡ãä¥à ®¡¬¥­ ' -I"
?define T_ABOUT "Ž ¯à®£à ¬¬¥"
?define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥­­ë¥ ä ©«ë.' -I"
//===================================================//
// //
// CYRILLIC //
// //
//===================================================//
#define T_FILE "” ©«"
#define T_TYPE "’¨¯"
#define T_SIZE "<22> §¬¥à"
#define T_NEW_FOLDER "<22>®¢ ï ¯ ¯ª "
#define T_NEW_FILE "<22>®¢ë© ä ©«"
#define T_DELETE_FILE "‚ë ¤¥©á⢨⥫쭮 å®â¨â¥ 㤠«¨âì"
#define T_YES "„ "
#define T_NO "<22>¥â"
#define T_CANCEL "Žâ¬¥­ "
#define T_CREATE "‘®§¤ âì"
#define T_RENAME "<22>¥à¥­ §¢ âì"
#define FS_ITEM_ALREADY_EXISTS "'<27>«¥¬¥­â á â ª¨¬ ¨¬¥­¥¬ 㦥 áãé¥áâ¢ã¥â' -E"
#define NOT_CREATE_FOLDER "'<27>¥ 㤠«®áì ᮧ¤ âì ¯ ¯ªã.' -E"
#define NOT_CREATE_FILE "'<27>¥ 㤠«®áì ᮧ¤ âì ä ©«.' -E"
#define T_NOTIFY_APP_PARAM_WRONG "'<27> à ¬¥âà ¤«ï § ¯ã᪠ Eolite ­¥ ¢¥à¥­: ¯ ¯ª  ­¥ áãé¥áâ¢ã¥â!' -E"
#define T_COPY_WINDOW_TITLE "Š®¯¨àãî..."
#define T_MOVE_WINDOW_TITLE "<22>¥à¥¬¥é î..."
#define T_DELETE_WINDOW_TITLE "“¤ «ïî..."
#define T_ABORT_WINDOW_BUTTON "<22>à¥à¢ âì"
#define T_SELECT_APP_TO_OPEN_WITH "‚ë¡¥à¨â¥ ¯à®£à ¬¬ã ¤«ï ®âªàëâ¨ï ä ©« "
#define DEL_MORE_FILES_1 "¢ë¡à ­­ë¥ í«¥¬¥­âë ("
#define DEL_MORE_FILES_2 " èâ.)?"
#define T_STATUS_EVEMENTS "<22> ¯®ª: %d ” ©«®¢: %d"
#define T_STATUS_SELECTED "‚뤥«¥­­®: %d"
#define COPY_PATH_STR "'<27>ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ­ ¢ ¡ãä¥à ®¡¬¥­ ' -I"
#define T_ABOUT "Ž ¯à®£à ¬¬¥"
#define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥­­ë¥ ä ©«ë.' -I"
char *kfm_func = {
"ˆ­ä®",
"<EFBFBD>¥à¥¨¬¥­.",
@ -38,35 +44,59 @@ char *kfm_func = {
"” ©«",
" <20> áâனª¨"
};
#define T_DEVICES "“áâனá⢠"
#define T_ACTIONS "„¥©á⢨ï"
char *actions[] = {
59, "<EFBFBD>®¢ë© ä ©«", "F9",
57, "<EFBFBD>®¢ ï ¯ ¯ª ", "F7",
60, "<EFBFBD> áâனª¨", "F10",
0,0,0
};
#define T_PROG "<22>ணࠬ¬ë "
#define T_SYS "‘¨á⥬  "
#define T_CD "CD-ROM "
#define T_FD "„¨áª¥â  "
#define T_HD "†¥á⪨© ¤¨áª "
#define T_SATA "SATA ¤¨áª "
#define T_USB "USB ¤¨áª "
#define T_RAM "RAM ¤¨áª "
#define T_UNC "<22>¥¨§¢¥áâ­® "
#else
?define T_FILE "File"
?define T_TYPE "Type"
?define T_SIZE "Size"
?define T_NEW_FOLDER "New folder"
?define T_NEW_FILE "New file"
?define T_DELETE_FILE "Do you really want to delete"
?define T_YES "Yes"
?define T_NO "No"
?define T_CANCEL "Cancel"
?define T_CREATE "Create"
?define T_RENAME "Rename"
?define FS_ITEM_ALREADY_EXISTS "'An item with that name already exists' -E"
?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
?define NOT_CREATE_FOLDER "'Folder can not be created.' -E"
?define NOT_CREATE_FILE "'File can not be created.' -E"
?define T_NOTIFY_APP_PARAM_WRONG "'Eolite param is wrong: directory does not exist!' -E"
?define T_COPY_WINDOW_TITLE "Copying..."
?define T_MOVE_WINDOW_TITLE "Moving..."
?define T_DELETE_WINDOW_TITLE "Deleting..."
?define T_ABORT_WINDOW_BUTTON "Abort"
?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
?define DEL_MORE_FILES_1 "selected items("
?define DEL_MORE_FILES_2 " pcs.)?"
?define T_STATUS_EVEMENTS "Dirs: %d Files: %d"
?define T_STATUS_SELECTED "Selected: %d"
?define COPY_PATH_STR "'Directory path copied to clipboard' -I"
?define T_ABOUT "About"
?define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I"
//===================================================//
// //
// ENGLISH //
// //
//===================================================//
#define T_FILE "File"
#define T_TYPE "Type"
#define T_SIZE "Size"
#define T_NEW_FOLDER "New folder"
#define T_NEW_FILE "New file"
#define T_DELETE_FILE "Do you really want to delete"
#define T_YES "Yes"
#define T_NO "No"
#define T_CANCEL "Cancel"
#define T_CREATE "Create"
#define T_RENAME "Rename"
#define FS_ITEM_ALREADY_EXISTS "'An item with that name already exists' -E"
#define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
#define NOT_CREATE_FOLDER "'Folder can not be created.' -E"
#define NOT_CREATE_FILE "'File can not be created.' -E"
#define T_NOTIFY_APP_PARAM_WRONG "'Eolite param is wrong: directory does not exist!' -E"
#define T_COPY_WINDOW_TITLE "Copying..."
#define T_MOVE_WINDOW_TITLE "Moving..."
#define T_DELETE_WINDOW_TITLE "Deleting..."
#define T_ABORT_WINDOW_BUTTON "Abort"
#define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
#define DEL_MORE_FILES_1 "selected items("
#define DEL_MORE_FILES_2 " pcs.)?"
#define T_STATUS_EVEMENTS "Dirs: %d Files: %d"
#define T_STATUS_SELECTED "Selected: %d"
#define COPY_PATH_STR "'Directory path copied to clipboard' -I"
#define T_ABOUT "About"
#define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I"
char *kfm_func = {
"Info",
"Rename",
@ -79,8 +109,45 @@ char *kfm_func = {
"File",
" Settings"
};
#define T_DEVICES "Devices"
#define T_ACTIONS "Actions"
char *actions[] = {
59, "New file", "F9",
57, "New folder", "F7",
60, "Settings", "F10",
0,0,0
};
#define T_PROG "Programs "
#define T_SYS "System "
#define T_CD "CD-ROM "
#define T_FD "Floppy disk "
#define T_HD "Hard disk "
#define T_SATA "SATA disk "
#define T_USB "USB disk "
#define T_RAM "RAM disk "
#define T_UNC "Unknown "
#endif
//===================================================//
// //
// GLOBAL //
// //
//===================================================//
char *devinfo = {
"r", 0, T_SYS,
"k", 1, T_PROG,
"f", 2, T_FD,
"c", 3, T_CD,
"h", 4, T_HD,
"b", 4, T_HD,
"s", 4, T_SATA,
"t", 5, T_RAM,
"u", 6, T_USB,
0
};
//Button IDs
enum {
PATH_BTN = 10,

View File

@ -70,7 +70,7 @@ void CopyFilesListToClipboard(bool _cut_active)
for (i=0; i<files.count; i++)
{
if (getElementSelectedFlag(i) == true) {
sprintf(#copy_t,"%s/%s",#path,items.get(i)*304+buf+72);
sprintf(#copy_t,"%s/%s",path,items.get(i)*304+buf+72);
path_len = strlen(#copy_t);
size_buf += path_len + 1;
}
@ -83,7 +83,7 @@ void CopyFilesListToClipboard(bool _cut_active)
for (i=0; i<files.count; i++)
{
if (getElementSelectedFlag(i) == true) {
sprintf(copy_buf_offset,"%s/%s",#path,items.get(i)*304+buf+72);
sprintf(copy_buf_offset,"%s/%s",path,items.get(i)*304+buf+72);
copy_buf_offset += strlen(copy_buf_offset) + 1;
if (cut_active) {
@ -123,7 +123,7 @@ void PasteThread()
if (cut_active) {
for (j = 0; j < paste_elements_count; j++) {
sprintf(#copy_to, "%s/%s", #path, path_offset+strrchr(path_offset,'/'));
sprintf(#copy_to, "%s/%s", path, path_offset+strrchr(path_offset,'/'));
slash_count = 0;
for (i=0; i<=10; i++) {
if (copy_to[i]=='/') slash_count++;
@ -148,11 +148,11 @@ _DIFFERENT_DRIVES:
for (j = 0; j < paste_elements_count; j++) {
strcpy(#copy_from, path_offset);
if (!copy_from) DialogExit();
sprintf(#copy_to, "%s/%s", #path, #copy_from+strrchr(#copy_from,'/'));
sprintf(#copy_to, "%s/%s", path, #copy_from+strrchr(#copy_from,'/'));
if (streq(#copy_from,#copy_to))
{
if (cut_active) continue;
sprintf(#copy_to, "%s/NEW_%s", #path, #copy_from+strrchr(#copy_from,'/'));
sprintf(#copy_to, "%s/NEW_%s", path, #copy_from+strrchr(#copy_from,'/'));
}
if (strstr(#copy_to, #copy_from))
{

View File

@ -12,13 +12,15 @@ void DrawScroll(bool _scroll_used) {
{
sc_slider_y = sc_y - 1;
sc_slider_h = sc_h + 1;
}
else
{
} else {
sc_slider_y = files.first * sc_h / files.count + sc_y - 1;
sc_slider_h = sc_h * files.visible - files.visible / files.count + 2;
if (sc_slider_h < 20) sc_slider_h = 20; //minimal scroll height
if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= sc_y + sc_h - sc_slider_h; //äëÿ áîëüøîãî ñïèñêà
if (sc_slider_h < 20) {
sc_slider_h = 20; //set minimal scroll height
}
if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) {
sc_slider_y= sc_y + sc_h - sc_slider_h; //fix for the very long list
}
}
//slider
DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,sc.work_graph);

View File

@ -1,42 +1,4 @@
#ifdef LANG_RUS
?define T_DEVICES "“áâனá⢠"
?define T_ACTIONS "„¥©á⢨ï"
char *actions[] = {
59, "<EFBFBD>®¢ë© ä ©«", "F9",
57, "<EFBFBD>®¢ ï ¯ ¯ª ", "F7",
60, "<EFBFBD> áâனª¨", "F10",
0,0,0
};
?define T_PROG "<EFBFBD>ணࠬ¬ë "
?define T_SYS "‘¨á⥬  "
?define T_UNC "<EFBFBD>¥¨§¢¥áâ­® "
?define T_CD "CD-ROM "
?define T_FD "„¨áª¥â  "
?define T_HD "†¥á⪨© ¤¨áª "
?define T_SATA "SATA ¤¨áª "
?define T_USB "USB ¤¨áª "
?define T_RAM "RAM ¤¨áª "
#else
?define T_DEVICES "Devices"
?define T_ACTIONS "Actions"
char *actions[] = {
59, "New file", "F9",
57, "New folder", "F7",
60, "Settings", "F10",
0,0,0
};
?define T_PROG "Programs "
?define T_SYS "System "
?define T_UNC "Unknown "
?define T_CD "CD-ROM "
?define T_FD "Floppy disk "
?define T_HD "Hard disk "
?define T_SATA "SATA disk "
?define T_USB "USB disk "
?define T_RAM "RAM disk "
#endif
struct _SystemDiscs
{
collection list;
@ -48,51 +10,6 @@ struct _SystemDiscs
void Click();
} SystemDiscs=0;
#define DEV_H 17
#define DEV_H_HOR 20
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, disc_name)
{
switch(disk_first_letter)
{
case 'r':
ESBYTE[dev_icon]=0;
strcpy(disc_name, T_SYS);
break;
case 'k':
ESBYTE[dev_icon]=1;
strcpy(disc_name, T_PROG);
break;
case 'f':
ESBYTE[dev_icon]=2;
strcpy(disc_name, T_FD);
break;
case 'c':
ESBYTE[dev_icon]=3;
strcpy(disc_name, T_CD);
break;
case 'h':
case 'b':
ESBYTE[dev_icon]=4;
strcpy(disc_name, T_HD);
break;
case 's':
ESBYTE[dev_icon]=4;
strcpy(disc_name, T_SATA);
break;
case 't':
ESBYTE[dev_icon]=5;
strcpy(disc_name, T_RAM);
break;
case 'u':
ESBYTE[dev_icon]=6;
strcpy(disc_name, T_USB);
break;
default:
ESBYTE[dev_icon]=5;
}
}
void _SystemDiscs::Get()
{
bool kolibrios_exists=false;
@ -126,23 +43,35 @@ void _SystemDiscs::Get()
free(diskbuf);
}
void GetDiskIconAndName(char disk_first_letter, dword dev_icon, dword disc_name)
{
int i;
for (i=0; devinfo[i]!=0; i+=3) {
if (disk_first_letter == ESBYTE[devinfo[i]]) {
ESBYTE[dev_icon] = devinfo[i+1];
strcpy(disc_name, devinfo[i+2]);
return;
}
}
ESBYTE[dev_icon]=5;
strcpy(disc_name, T_UNC);
}
#define DEV_H 17
#define DDW 120
#define KFM2_DEVH 20
void _SystemDiscs::Draw()
{
char dev_name[15], disc_name[100], i, dev_icon, is_active=0;
char dev_name[15], disc_name[100], i, dev_icon;
bool is_active=0;
int draw_y, draw_x;
for (i=0; i<30; i++) DeleteButton(100+i);
if (efm) {
if (active_panel==0) {
DrawSelect(Form.cwidth/2-DDW, 10, #path, KFM_DEV_DROPDOWN_1);
DrawSelect(Form.cwidth-DDW-2, 10, #inactive_path, KFM_DEV_DROPDOWN_2);
} else {
DrawSelect(Form.cwidth/2-DDW, 10, #inactive_path, KFM_DEV_DROPDOWN_1);
DrawSelect(Form.cwidth-DDW-2, 10, #path, KFM_DEV_DROPDOWN_2);
}
DrawSelect(Form.cwidth/2-DDW, KFM_DEV_DROPDOWN_1, location[0]);
DrawSelect(Form.cwidth-DDW-2, KFM_DEV_DROPDOWN_2, location[sizeof(dword)]);
files.y = 40 + 17;
} else {
draw_y = 74;
@ -150,11 +79,11 @@ void _SystemDiscs::Draw()
for (i=0;i<list.count;i++) {
strcpy(#dev_name, list.get(i));
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
if (strstr(#path, #dev_name)==#path) is_active=true; else is_active=false;
if (strstr(path, #dev_name)==path) is_active=true; else is_active=false;
DrawBar(draw_x,draw_y,6,DEV_H+1,0xFFFFFF);
DrawBar(draw_x+6+18,draw_y,160-6-18,DEV_H+1,0xFFFFFF);
DefineButton(draw_x,draw_y,159,16,100+i+BT_HIDE,0xFFFFFF);
DefineHiddenButton(draw_x,draw_y,159,16,100+i);
if (show_dev_name.checked)
{
strcat(#disc_name, #dev_name);
@ -174,59 +103,59 @@ void _SystemDiscs::Draw()
}
}
void _SystemDiscs::DrawSelect(int draw_x, draw_y, path1, btid)
void _SystemDiscs::DrawSelect(int draw_x, btid, dword _path)
{
char dev_name[15], disc_name[100], i, dev_icon, is_active=0;
if (ESBYTE[path1+1]=='\0') {
#define SELECTY 10
char dev_name[15], disc_name[100], i, dev_icon;
if (ESBYTE[_path+1]=='\0') {
strcpy(#dev_name, "/root");
dev_icon = 0;
} else if (chrnum(path1, '/')==1) {
strcpy(#dev_name, path1);
} else if (chrnum(_path, '/')==1) {
strcpy(#dev_name, _path);
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
} else for (i=0;i<list.count;i++) {
strcpy(#dev_name, list.get(i));
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
if (strstr(path1, #dev_name)-path1==0) break;
if (strstr(_path, #dev_name)-_path==0) break;
}
DrawRectangle(draw_x-1, draw_y-1, DDW+2-DEV_H_HOR, DEV_H_HOR+1, sc.work_graph);
DrawBar(draw_x, draw_y, DDW+1-DEV_H_HOR, DEV_H_HOR, 0xFFFFFF);
_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
kfont.WriteIntoWindow(draw_x + 24, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1);
DefineButton(draw_x, draw_y, DDW-1, DEV_H_HOR-1, btid+1+BT_HIDE,0xFFFFFF);
DrawFlatButtonSmall(draw_x+DDW-DEV_H_HOR+1, draw_y-1, DEV_H_HOR-1, DEV_H_HOR+1, btid, "\x19");
draw_x += DDW + 1;
//DrawBar(draw_x, draw_y, Form.cwidth - draw_x - 2, DEV_H_HOR, sc.work);
DrawRectangle(draw_x-1, SELECTY-1, DDW+2-KFM2_DEVH, KFM2_DEVH+1, sc.work_graph);
DrawBar(draw_x, SELECTY, DDW+1-KFM2_DEVH, KFM2_DEVH, 0xFFFFFF);
_PutImage(draw_x + 5, SELECTY+2, 18,17, dev_icon*17*18*3+#devices);
kfont.WriteIntoWindow(draw_x + 24, math.max(KFM2_DEVH-kfont.height/2+SELECTY,0), 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1);
DefineHiddenButton(draw_x, SELECTY, DDW-1, KFM2_DEVH-1, btid+1);
DrawFlatButtonSmall(draw_x+DDW-KFM2_DEVH+1, SELECTY-1, KFM2_DEVH-1, KFM2_DEVH+1, btid, "\x19");
}
void _SystemDiscs::DrawOptions(int draw_x, draw_y)
void _SystemDiscs::DrawOptions(int draw_x)
{
int optionsy = SELECTY+KFM2_DEVH+1;
char dev_name[15], disc_name[100], i, dev_icon, is_active=0;
for (i=0; i<30; i++) DeleteButton(100+i);
DrawPopup(draw_x, draw_y, DDW, list.count*DEV_H_HOR, 1, -1, sc.work_graph);
DrawPopup(draw_x, optionsy, DDW, list.count*KFM2_DEVH, 1, -1, sc.work_graph);
for (i=0;i<list.count;i++) {
strcpy(#dev_name, list.get(i));
GetDiskIconAndName(dev_name[1], #dev_icon, #disc_name);
if (strstr(#path, #dev_name)!=0) is_active=true; else is_active=false;
if (strstr(path, #dev_name)!=0) is_active=true; else is_active=false;
DrawBar(draw_x, draw_y, DDW, DEV_H_HOR, 0xFFFFFF);
DefineButton(draw_x, draw_y, DDW, DEV_H_HOR-1, 100+i+BT_HIDE,0xFFFFFF);
_PutImage(draw_x + 5, draw_y+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
DrawBar(draw_x, optionsy, DDW, KFM2_DEVH, 0xFFFFFF);
DefineButton(draw_x, optionsy, DDW, KFM2_DEVH-1, 100+i+BT_HIDE,0xFFFFFF);
_PutImage(draw_x + 5, optionsy+2, 18,17, is_active*7+dev_icon*17*18*3+#devices);
if (is_active) kfont.bold = true;
kfont.WriteIntoWindow(draw_x + 24, draw_y+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1);
kfont.WriteIntoWindow(draw_x + 24, optionsy+2, 0xFFFfff, 0x000000, kfont.size.pt, #dev_name+1);
kfont.bold = false;
draw_y += DEV_H_HOR;
optionsy += KFM2_DEVH;
}
}
void _SystemDiscs::Click(int n)
{
strcpy(#path, list.get(n));
strcpy(path, list.get(n));
files.KeyHome();
Open_Dir(#path,WITH_REDRAW);
Open_Dir(path,WITH_REDRAW);
}
@ -285,12 +214,10 @@ void DrawLeftPanelBg()
int actions_y = SystemDiscs.list.count*DEV_H;
int start_y = actions_y+159;
int area_h;
DrawBar(2,41,190,15,waves_pal[0]); //above devices block
DrawBar(17,actions_y+75,160,15,waves_pal[0]); //below devices block
PutShadow(17,actions_y+75,160,1,1,3);
PutShadow(18,actions_y+75+1,158,1,1,1);
DrawBar(2,56,15,actions_y+103,waves_pal[0]); //on the left
DrawBar(177,56,15,actions_y+103,waves_pal[0]); //on the right
DrawBar(2,41,190,15,waves_pal[0]); //above devices block
DrawBar(17,actions_y+75,160,15,EDX); //below devices block
DrawBar(2,56,15,actions_y+103,EDX); //on the left
DrawBar(177,56,15,actions_y+103,EDX); //on the right
area_h = Form.cheight-start_y-2 - status_bar_h;
if (area_h < 268){
PutPaletteImage(#blue_hl, 190, area_h, 2, start_y, 8, #waves_pal);
@ -298,6 +225,8 @@ void DrawLeftPanelBg()
DrawBar(2,start_y,190, area_h-268, waves_pal[0]);
PutPaletteImage(#blue_hl, 190, 268, 2, Form.cheight-270-status_bar_h, 8, #waves_pal);
}
PutShadow(17,actions_y+75,160,1,1,3);
PutShadow(18,actions_y+75+1,158,1,1,1);
PutShadow(17,start_y,160,1,1,3);
PutShadow(18,start_y+1,158,1,1,1);
}

View File

@ -115,7 +115,7 @@ void SetProperties(int mode)
{
if (getElementSelectedFlag(i) == true)
{
sprintf(#pcur_file,"%s/%s",#path,items.get(i)*304+buf+72);
sprintf(#pcur_file,"%s/%s",path,items.get(i)*304+buf+72);
SetPropertiesFile(#pcur_file, #file_info_general);
if (SET_PROPERTIES_ALL_SUBFOLDER == mode) {
if (dir_exists(#pcur_file)) SetPropertiesDir(#pcur_file);
@ -131,7 +131,7 @@ void SetProperties(int mode)
}
cmd_free=3;
Open_Dir(#path,ONLY_OPEN);
Open_Dir(path,ONLY_OPEN);
ExitProcess();
}
@ -177,7 +177,7 @@ void properties_dialog()
if (selected_count)
{
more_files_count.get(NULL);
GetSizeMoreFiles(#path);
GetSizeMoreFiles(path);
ch_read_only.checked = 0;
ch_hidden.checked = 0;
ch_system.checked = 0;
@ -191,7 +191,7 @@ void properties_dialog()
ch_hidden.checked = file_info_general.hidden;
ch_system.checked = file_info_general.system;
}
edit_box_set_text stdcall (#path_to_file_ed, #path);
edit_box_set_text stdcall (#path_to_file_ed, path);
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
loop() switch(WaitEvent())
@ -293,7 +293,7 @@ void DrawPropertiesWindow()
if ( file_info_general.isfolder )
PropertiesDrawIcon(NULL, "<DIR>");
else {
sprintf(#temp_path,"%s/%s",#path,#file_name2);
sprintf(#temp_path,"%s/%s",path,#file_name2);
ext1 = strrchr(#file_name2,'.');
if (ext1) ext1 += #file_name2;
PropertiesDrawIcon(#temp_path, ext1);

View File

@ -68,9 +68,9 @@ void settings_dialog()
}
else if (id==6)
{
strcpy(#path_start,#path);
strcpy(#path_start,path);
path_start_ed.size = path_start_ed.pos = strlen(#path_start);
ini.SetString("DefaultPath", #path, strlen(#path));
ini.SetString("DefaultPath", path, strlen(path));
edit_box_draw stdcall (#path_start_ed);
break;
}
@ -103,7 +103,7 @@ void settings_dialog()
case evReDraw:
DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400,
365+skin_height,0x34,sc.work,TITLE_SETT,0);
-efm*62+365+skin_height,0x34,sc.work,TITLE_SETT,0);
GetProcessInfo(#Settings, SelfInfo);
DrawSettingsCheckBoxes();
}
@ -125,9 +125,11 @@ void DrawSettingsCheckBoxes()
#define FRX 26
#define XXX 11
y.n = 0;
show_dev_name.draw(XXX, y.inc(14));
show_status_bar.draw(XXX, y.inc(25));
show_breadcrumb.draw(XXX, y.inc(25));
if (!efm) {
show_dev_name.draw(XXX, y.inc(14));
show_status_bar.draw(XXX, y.inc(25));
show_breadcrumb.draw(XXX, y.inc(25));
}
big_icons.draw(XXX, y.inc(25));
colored_lines.draw(XXX, y.inc(25));
font_size.draw(XXX, y.inc(31));
@ -160,7 +162,6 @@ void LoadIniSettings()
Form.top = ini.GetInt("WinY", 30);
Form.width = ini.GetInt("WinW", efm*170+550);
Form.height = ini.GetInt("WinH", efm*100+517);
ini.GetString("DefaultPath", #path, 4096, "/rd/1");
ini.GetString("DefaultPath", #path_start, 4096, "/rd/1");
path_start_ed.size = path_start_ed.pos = strlen(#path_start);
kfont.init(DEFAULT_FONT);

View File

@ -40,7 +40,12 @@
dword sizehi;
char name[518];
};
#define ATR_READONLY 1
#define ATR_HIDDEN 2
#define ATR_SYSTEM 4
#define ATR_VOL_LABEL 8
#define ATR_FOLDER 0x10
#define ATR_NONARH 0x20
:dword GetFileInfo(dword file_path, bdvk_struct)
@ -203,7 +208,7 @@ inline fastcall void GetCurDir( ECX, EDX)
$int 0x40
}
void read_file(dword path1, buf, size)
:void read_file(dword path1, buf, size)
{
EAX = 68;
EBX = 27;

View File

@ -53,17 +53,17 @@
:void DrawWideRectangle(dword x,y,w,h,boder,color1)
{
DrawBar(x, y, w, boder, color1);
DrawBar(x, y+h-boder, w, boder, color1);
DrawBar(x, y+boder, boder, h-boder-boder, color1);
DrawBar(x+w-boder, y+boder, boder, h-boder-boder, color1);
DrawBar(x, y+h-boder, w, boder, EDX);
DrawBar(x, y+boder, boder, h-boder-boder, EDX);
DrawBar(x+w-boder, y+boder, boder, h-boder-boder, EDX);
}
:void DrawRectangle3D(dword x,y,w,h,color1,color2)
{
DrawBar(x,y,w+1,1,color1);
DrawBar(x,y+1,1,h-1,color1);
DrawBar(x,y+1,1,h-1,EDX);
DrawBar(x+w,y+1,1,h,color2);
DrawBar(x,y+h,w,1,color2);
DrawBar(x,y+h,w,1,EDX);
}
:void DrawCaptButton(dword x,y,w,h,id,color_b, color_t,text)
@ -220,7 +220,7 @@
{
DrawRectangle(x,y,w,h,col_border);
DrawBar(x+1,y+1,w-1,1,0xFFFfff);
DrawBar(x+1,y+2,1,h-2,0xFFFfff);
DrawBar(x+1,y+2,1,h-2,EDX);
if (col_work!=-1) DrawBar(x+2,y+2,w-2,h-2,col_work);
DrawPopupShadow(x,y,w,h-1,skinned);
}
@ -289,9 +289,9 @@
DrawBar(x+w+1, y+2, 1, h-2, right);
PutPixel(x, y, dots);
PutPixel(x+w+1, y+h+1, dots);
PutPixel(x, y+h+1, dots);
PutPixel(x+w+1, y, dots);
PutPixel(x+w+1, y+h+1, EDX);
PutPixel(x, y+h+1, EDX);
PutPixel(x+w+1, y, EDX);
PutPixel(x, y+h, dark);
PutPixel(x+w+1, y+1, light);
@ -300,15 +300,13 @@
:bool skin_is_dark()
{
dword gray;
dword color_image = #sc.work;
ESI = #sc.work;
gray = DSBYTE[color_image]*DSBYTE[color_image];
gray += DSBYTE[color_image+1]*DSBYTE[color_image+1];
gray += DSBYTE[color_image+2]*DSBYTE[color_image+2];
gray = sqrt(gray) / 3;
EDI = DSBYTE[ESI]*DSBYTE[ESI];
EDI += DSBYTE[ESI+1]*DSBYTE[ESI+1];
EDI += DSBYTE[ESI+2]*DSBYTE[ESI+2];
if (gray < 65) {
if (sqrt(EDI) / 3 < 65) {
return true;
} else {
return false;

View File

@ -18,7 +18,7 @@
#define ENTRY_POINT #______INIT______
#endif
char os_name[8] = {'M','E','N','U','E','T','0','1'};
char os_name[] = "MENUET01"n;
dword os_version = 0x00000001;
dword start_addr = ENTRY_POINT;
dword final_addr = #______STOP______+32;

View File

@ -11,4 +11,5 @@ tup.rule("notify.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_
tup.rule("osupdate.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "osupdate.com")
tup.rule("pipet.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "pipet.com")
tup.rule("software_widget.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "software_widget.com")
tup.rule("kfm2.c", "c-- %f" .. tup.getconfig("KPACK_CMD"), "kfm2.com")

12
programs/cmm/misc/kfm2.c Normal file
View File

@ -0,0 +1,12 @@
#define MEMSIZE 1024*20
#define ENTRY_POINT #main
#include "../lib/fs.h"
void main()
{
RenameMove("KFM", abspath("EOLITE"));
RunProgram(abspath("KFM"), #param);
RenameMove("EOLITE", abspath("KFM"));
ExitProcess();
}

View File

@ -162,7 +162,7 @@ void main()
void draw_window()
{
sc.get();
DefineAndDrawWindow(screen.width-600/2,100,640,600+skin_height,0x73,sc.work,T_WINDOW_HEADER,0);
DefineAndDrawWindow(screen.width-600/2,100,640,600,0x73,sc.work,T_WINDOW_HEADER,0);
GetProcessInfo(#Form, SelfInfo);
IF (Form.status_window&ROLLED_UP) return;
if (Form.width < 270) { MoveSize(OLD,OLD,270,OLD); return; }