150,18 → 150,22 |
#include "include\properties.h" |
#include "include\breadcrumbs.h" |
|
void load_libraries() |
{ |
load_dll(boxlib, #box_lib_init,0); |
load_dll(libini, #lib_init,1); |
load_dll(libio, #libio_init,1); |
load_dll(libimg, #libimg_init,1); |
} |
|
void main() |
{ |
dword id; |
byte count_sl = 0; |
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; |
char stats; |
|
rand_n = random(40); |
|
load_dll(boxlib, #box_lib_init,0); |
load_dll(libini, #lib_init,1); |
load_dll(libio, #libio_init,1); |
load_dll(libimg, #libimg_init,1); |
load_libraries(); |
|
SetAppColors(); |
LoadIniSettings(); |
182,12 → 186,9 |
{ |
if (strlen(#param)>1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end |
|
if (dir_exists(#param)==true) |
{ |
if (dir_exists(#param)) { |
strcpy(#path, #param); |
} |
else |
{ |
} else { |
notify(T_NOTIFY_APP_PARAM_WRONG); |
} |
} |
196,8 → 197,7 |
strcpy(#inactive_path, #path); |
llist_copy(#files_inactive, #files); |
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
loop(){ |
switch(WaitEventTimeout(50)) |
loop() switch(WaitEventTimeout(50)) |
{ |
case evMouse: |
if (del_active) || (Form.status_window>2) break; |
209,47 → 209,8 |
|
mouse.get(); |
|
if (!mouse.mkm) && (stats>0) stats = 0; |
if (mouse.mkm) && (!stats) |
{ |
x_old = mouse.x; |
y_old = mouse.y; |
stats = 1; |
} |
if (mouse.mkm) && (stats==1) |
{ |
dif_x = mouse.x-x_old; |
dif_y = mouse.y-y_old; |
adif_x = fabs(dif_x); |
adif_y = fabs(dif_y); |
ProceedMouseGestures(); |
|
if (adif_x>adif_y) |
{ |
if (dif_x > 150) |
{ |
if (history.forward()) |
{ |
strcpy(#path, history.current()); |
files.KeyHome(); |
Open_Dir(#path,WITH_REDRAW); |
} |
stats = 0; |
} |
if (dif_x < -150) |
{ |
GoBack(); |
stats = 0; |
} |
} |
else |
{ |
if (dif_y < -100) |
{ |
Dir_Up(); |
stats = 0; |
} |
} |
} |
if (files.MouseOver(mouse.x, mouse.y)) |
{ |
//select file |
361,15 → 322,10 |
Clipboard__CopyText(#path); |
break; |
case 21: //Back |
GoBack(); |
EventHistoryGoBack(); |
break; |
case 22: //Forward |
if (history.forward()) |
{ |
strcpy(#path, history.current()); |
files.KeyHome(); |
Open_Dir(#path,WITH_REDRAW); |
} |
EventHistoryGoForward(); |
break; |
case 23: |
Dir_Up(); |
486,7 → 442,7 |
switch (key_scancode) |
{ |
case SCAN_CODE_BS: |
//GoBack(); |
//EventHistoryGoBack(); |
Dir_Up(); |
break; |
case SCAN_CODE_ENTER: |
546,7 → 502,6 |
cmd_free = false; |
} |
} |
} |
|
void draw_window() |
{ |
817,7 → 772,7 |
if (errornum) |
{ |
history.add(#path); |
GoBack(); |
EventHistoryGoBack(); |
Write_Error(errornum); |
return; |
} |
973,7 → 928,7 |
} |
} |
|
inline fastcall void GoBack() |
inline fastcall void EventHistoryGoBack() |
{ |
char cur_folder[4096]; |
strcpy(#cur_folder, #path); |
1091,26 → 1046,22 |
switch(N) |
{ |
case 1: |
if (!active_about) |
{ |
if (!active_about) { |
about_stak = malloc(4096); |
about_thread_id = CreateThread(#about_dialog,about_stak+4092); |
break; |
} |
else |
{ |
} else { |
ActivateWindow(GetProcessSlot(about_thread_id)); |
} |
break; |
case 2: |
if (!files.count) break; |
NewElement_Form(RENAME_ITEM, #file_name); |
if (files.count) NewElement_Form(RENAME_ITEM, #file_name); |
break; |
case 3: |
if (!itdir) RunProgram("/sys/tinypad", #file_path); |
if (files.count) && (!itdir) RunProgram("/sys/tinypad", #file_path); |
break; |
case 4: |
if (!itdir) RunProgram("/sys/develop/heed", #file_path); |
if (files.count) && (!itdir) RunProgram("/sys/develop/heed", #file_path); |
break; |
case 5: //refresh cur dir & devs |
if (two_panels.checked) |
1238,4 → 1189,49 |
SelectFileByName(#selected_filename); |
} |
|
void EventHistoryGoForward() |
{ |
if (history.forward()) { |
strcpy(#path, history.current()); |
files.KeyHome(); |
Open_Dir(#path,WITH_REDRAW); |
} |
} |
|
void ProceedMouseGestures() |
{ |
char stats; |
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; |
if (!mouse.mkm) && (stats>0) stats = 0; |
if (mouse.mkm) && (!stats) |
{ |
x_old = mouse.x; |
y_old = mouse.y; |
stats = 1; |
} |
if (mouse.mkm) && (stats==1) |
{ |
dif_x = mouse.x-x_old; |
dif_y = mouse.y-y_old; |
adif_x = fabs(dif_x); |
adif_y = fabs(dif_y); |
|
if (adif_x>adif_y) { |
if (dif_x > 150) { |
EventHistoryGoForward(); |
stats = 0; |
} |
if (dif_x < -150) { |
EventHistoryGoBack(); |
stats = 0; |
} |
} else { |
if (dif_y < -100) { |
Dir_Up(); |
stats = 0; |
} |
} |
} |
} |
|
stop: |