Rev 8871 | Rev 8881 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8871 | Rev 8872 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2021 |
1 | //Leency, Veliant, Punk_Joker, PavelYakov & KolibriOS Team 2008-2021 |
2 | //GNU GPL license. |
2 | //GNU GPL license. |
Line 3... | Line 3... | ||
3 | 3 | ||
Line 4... | Line 4... | ||
4 | // 70.5 - get volume info and label |
4 | // 70.5 - get volume info and label |
5 | 5 | ||
6 | #define ABOUT_TITLE "EOLITE 5 Beta4" |
6 | #define ABOUT_TITLE "EOLITE 5 Beta5" |
Line 7... | Line 7... | ||
7 | #define TITLE_EOLITE "Eolite File Manager 5 Beta4" |
7 | #define TITLE_EOLITE "Eolite File Manager 5 Beta5" |
8 | #define TITLE_KFM "Kolibri File Manager 2 Beta4"; |
8 | #define TITLE_KFM "Kolibri File Manager 2 Beta5"; |
9 | 9 | ||
Line 57... | Line 57... | ||
57 | RENAME_ITEM |
57 | RENAME_ITEM |
58 | }; |
58 | }; |
Line 59... | Line 59... | ||
59 | 59 | ||
60 | //OpenDir options |
60 | //OpenDir options |
61 | enum { |
- | |
62 | ONLY_SHOW, |
61 | enum { |
63 | WITH_REDRAW, |
62 | WITH_REDRAW, |
64 | ONLY_OPEN |
63 | ONLY_OPEN |
Line 65... | Line 64... | ||
65 | }; |
64 | }; |
Line 92... | Line 91... | ||
92 | bool active_about = false; |
91 | bool active_about = false; |
93 | bool active_settings = false; |
92 | bool active_settings = false; |
94 | bool _not_draw = false; |
93 | bool _not_draw = false; |
95 | bool dir_at_fat16 = NULL; |
94 | bool dir_at_fat16 = NULL; |
Line 96... | Line 95... | ||
96 | 95 | ||
Line 97... | Line 96... | ||
97 | bool dev_popin_active_on_panel=0; |
96 | bool disk_popin_active_on_panel=0; |
98 | 97 | ||
Line 99... | Line 98... | ||
99 | dword about_thread_id; |
98 | dword about_thread_id; |
Line 247... | Line 246... | ||
247 | llist_copy(#files_inactive, #files); |
246 | llist_copy(#files_inactive, #files); |
248 | SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
247 | SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); |
249 | loop() switch(@WaitEventTimeout(80)) |
248 | loop() switch(@WaitEventTimeout(80)) |
250 | { |
249 | { |
251 | case evMouse: |
250 | case evMouse: |
252 | if (del_active) || (dev_popin_active_on_panel) || (Form.status_window>2) break; |
251 | if (del_active) || (disk_popin_active_on_panel) || (Form.status_window>2) break; |
253 | if (new_element_active) |
252 | if (new_element_active) |
254 | { |
253 | { |
255 | edit_box_mouse stdcall(#new_file_ed); |
254 | edit_box_mouse stdcall(#new_file_ed); |
256 | break; |
255 | break; |
257 | } |
256 | } |
Line 321... | Line 320... | ||
321 | } |
320 | } |
322 | DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,sc.work_light,sc.work_dark); |
321 | DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,sc.work_light,sc.work_dark); |
323 | } |
322 | } |
Line 324... | Line 323... | ||
324 | 323 | ||
- | 324 | //Scrooll |
|
325 | //Scrooll |
325 | if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) |
326 | if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y |
326 | && (mouse.y |
Line 327... | Line 327... | ||
327 | if (scroll_used) && (!mouse.key&MOUSE_LEFT) { scroll_used=false; Scroll(); } |
327 | if (scroll_used) && (!mouse.key&MOUSE_LEFT) { scroll_used=false; Scroll(); } |
328 | 328 | ||
329 | if (scroll_used) |
329 | if (scroll_used) |
Line 337... | Line 337... | ||
337 | if (id!=files.first) List_ReDraw(); |
337 | if (id!=files.first) List_ReDraw(); |
338 | break; |
338 | break; |
339 | } |
339 | } |
Line 340... | Line 340... | ||
340 | 340 | ||
341 | if (efm) && (mouse.y > files.y) && (mouse.down) { |
341 | if (efm) && (mouse.y > files.y) && (mouse.down) { |
342 | if (mouse.x |
- | |
343 | { |
342 | if (mouse.x |
344 | if (active_panel!=1) { |
- | |
345 | active_panel = 1; |
- | |
346 | ChangeActivePanel(); |
- | |
347 | } |
343 | if (active_panel!=1) ChangeActivePanel(); |
348 | } else { |
344 | } else { |
349 | if (active_panel!=2) { |
- | |
350 | active_panel = 2; |
- | |
351 | ChangeActivePanel(); |
- | |
352 | } |
345 | if (active_panel!=2) ChangeActivePanel(); |
353 | } |
346 | } |
354 | } |
347 | } |
355 | break; |
348 | break; |
356 | //Button pressed----------------------------------------------------------------------------- |
349 | //Button pressed----------------------------------------------------------------------------- |
357 | case evButton: |
350 | case evButton: |
Line -... | Line 351... | ||
- | 351 | id = GetButtonID(); |
|
- | 352 | ||
- | 353 | if (id==CLOSE_BTN) { |
|
- | 354 | KillProcess(about_thread_id); |
|
- | 355 | SaveIniSettings(); |
|
- | 356 | ExitProcess(); |
|
358 | id = GetButtonID(); |
357 | } |
359 | 358 | ||
360 | if (new_element_active) || (del_active) || (dev_popin_active_on_panel) { |
359 | if (new_element_active) || (del_active) || (disk_popin_active_on_panel) { |
361 | if (POPUP_BTN1==id) && (del_active) EventDelete(); |
360 | if (POPUP_BTN1==id) && (del_active) EventDelete(); |
362 | if (POPUP_BTN1==id) && (new_element_active) NewElement(); |
361 | if (POPUP_BTN1==id) && (new_element_active) NewElement(); |
363 | if (POPUP_BTN2==id) EventClosePopinForm(); |
362 | if (POPUP_BTN2==id) EventClosePopinForm(); |
364 | if (dev_popin_active_on_panel) { |
363 | if (disk_popin_active_on_panel) { |
365 | if (id>=100) && (id<=120) EventDriveClick(id); |
364 | if (id>=100) && (id<=120) EventDriveClick(id); |
366 | else EventClosePopinForm(); |
365 | else EventClosePopinForm(); |
367 | } |
366 | } |
Line 368... | Line 367... | ||
368 | break; |
367 | break; |
369 | } |
368 | } |
370 | - | ||
371 | switch(id) |
- | |
372 | { |
- | |
373 | case CLOSE_BTN: |
- | |
374 | KillProcess(about_thread_id); |
369 | |
375 | SaveIniSettings(); |
370 | switch(id) |
376 | ExitProcess(); |
371 | { |
377 | case PATH_BTN: |
372 | case PATH_BTN: |
378 | notify(COPY_PATH_STR); |
373 | notify(COPY_PATH_STR); |
379 | Clipboard__CopyText(#path); |
374 | Clipboard__CopyText(#path); |
380 | break; |
375 | break; |
381 | case KFM_DEV_DROPDOWN_1: |
- | |
382 | case KFM_DEV_DROPDOWN_1+1: |
- | |
383 | dev_popin_active_on_panel = 1; |
376 | case KFM_DEV_DROPDOWN_1: |
384 | DefineHiddenButton(0,0,5000,3000,9999+BT_NOFRAME); |
377 | case KFM_DEV_DROPDOWN_1+1: |
385 | SystemDiscs.DrawOptions(Form.cwidth/2-DDW, 8+DEV_H_HOR+3); |
378 | EventOpenDiskPopin(1); |
386 | break; |
379 | break; |
387 | case KFM_DEV_DROPDOWN_2: |
- | |
388 | case KFM_DEV_DROPDOWN_2+1: |
- | |
389 | dev_popin_active_on_panel = 2; |
380 | case KFM_DEV_DROPDOWN_2: |
390 | DefineHiddenButton(0,0,5000,3000,9999+BT_NOFRAME); |
381 | case KFM_DEV_DROPDOWN_2+1: |
391 | SystemDiscs.DrawOptions(Form.cwidth-DDW-2, 8+DEV_H_HOR+3); |
382 | EventOpenDiskPopin(2); |
392 | break; |
- | |
393 | case BACK_BTN...PASTE_BTN: |
- | |
394 | if (active_panel==2) { |
- | |
395 | active_panel = 1; |
383 | break; |
396 | ChangeActivePanel(); |
384 | case BACK_BTN...PASTE_BTN: |
397 | } |
385 | if (active_panel==2) ChangeActivePanel(); |
398 | EventToolbarButtonClick(id); |
386 | EventToolbarButtonClick(id); |
399 | break; |
- | |
400 | case BACK_BTN+100...PASTE_BTN+100: |
- | |
401 | if (active_panel==1) { |
- | |
402 | active_panel = 2; |
387 | break; |
403 | ChangeActivePanel(); |
388 | case BACK_BTN+100...PASTE_BTN+100: |
404 | } |
389 | if (active_panel==1) ChangeActivePanel(); |
405 | EventToolbarButtonClick(id-100); |
390 | EventToolbarButtonClick(id-100); |
406 | break; |
391 | break; |
Line 429... | Line 414... | ||
429 | case evKey: |
414 | case evKey: |
430 | GetKeys(); |
415 | GetKeys(); |
Line 431... | Line 416... | ||
431 | 416 | ||
Line 432... | Line 417... | ||
432 | if (Form.status_window>2) break; |
417 | if (Form.status_window>2) break; |
433 | 418 | ||
434 | if (new_element_active) || (del_active) || (dev_popin_active_on_panel) |
419 | if (new_element_active) || (del_active) || (disk_popin_active_on_panel) |
Line 435... | Line 420... | ||
435 | { |
420 | { |
436 | if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm(); |
421 | if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm(); |
Line 444... | Line 429... | ||
444 | edit_box_key stdcall (#new_file_ed); |
429 | edit_box_key stdcall (#new_file_ed); |
445 | } |
430 | } |
446 | break; |
431 | break; |
447 | } |
432 | } |
Line -... | Line 433... | ||
- | 433 | ||
- | 434 | if (key_modifier&KEY_LALT) || (key_modifier&KEY_RALT) { |
|
- | 435 | if (key_scancode == SCAN_CODE_F1) EventOpenDiskPopin(1); |
|
- | 436 | if (key_scancode == SCAN_CODE_F2) EventOpenDiskPopin(2); |
|
- | 437 | break; |
|
448 | 438 | } |
|
Line 449... | Line 439... | ||
449 | if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) { |
439 | if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) { |
450 | 440 | ||
451 | if (key_scancode == SCAN_CODE_ENTER) { |
441 | if (key_scancode == SCAN_CODE_ENTER) { |
Line 499... | Line 489... | ||
499 | RunProgram("/sys/media/kiv", #temp); |
489 | RunProgram("/sys/media/kiv", #temp); |
500 | break; |
490 | break; |
501 | case SCAN_CODE_KEY_N: |
491 | case SCAN_CODE_KEY_N: |
502 | EventOpenNewEolite(); |
492 | EventOpenNewEolite(); |
503 | break; |
493 | break; |
504 | case SCAN_CODE_KEY_M: |
- | |
505 | Open_Dir(#inactive_path,WITH_REDRAW); |
- | |
506 | break; |
- | |
507 | case SCAN_CODE_KEY_R: |
494 | case SCAN_CODE_KEY_R: |
508 | EventRefresh(); |
495 | EventRefresh(); |
509 | break; |
496 | break; |
510 | case SCAN_CODE_ENTER: |
497 | case SCAN_CODE_ENTER: |
511 | if (!itdir) ShowOpenWithDialog(); |
498 | if (!itdir) ShowOpenWithDialog(); |
Line 529... | Line 516... | ||
529 | case SCAN_CODE_ENTER: |
516 | case SCAN_CODE_ENTER: |
530 | EventOpen(0); |
517 | EventOpen(0); |
531 | break; |
518 | break; |
532 | case SCAN_CODE_TAB: |
519 | case SCAN_CODE_TAB: |
533 | if (!efm) break; |
520 | if (!efm) break; |
534 | if (active_panel==1) active_panel=2; else active_panel=1; |
- | |
535 | ChangeActivePanel(); |
521 | ChangeActivePanel(); |
536 | DrawFilePanels(); |
- | |
537 | break; |
522 | break; |
538 | case SCAN_CODE_MENU: |
523 | case SCAN_CODE_MENU: |
539 | mouse.x = files.x+15; |
524 | mouse.x = files.x+15; |
540 | mouse.y = files.cur_y - files.first * files.item_h + files.y + 5; |
525 | mouse.y = files.cur_y - files.first * files.item_h + files.y + 5; |
541 | EventShowListMenu(); |
526 | EventShowListMenu(); |
542 | break; |
527 | break; |
543 | case SCAN_CODE_DEL: |
528 | case SCAN_CODE_DEL: |
544 | Del_Form(); |
529 | Del_Form(); |
545 | break; |
530 | break; |
- | 531 | case SCAN_CODE_SPACE: |
|
- | 532 | EventChooseFile(files.cur_y); |
|
- | 533 | DrawStatusBar(); |
|
- | 534 | Line_ReDraw(col.selec, files.cur_y); |
|
- | 535 | break; |
|
546 | case SCAN_CODE_INS: |
536 | case SCAN_CODE_INS: |
547 | EventChooseFile(files.cur_y); |
537 | EventChooseFile(files.cur_y); |
548 | files.KeyDown(); |
538 | files.KeyDown(); |
549 | DrawStatusBar(); |
539 | DrawStatusBar(); |
550 | List_ReDraw(); |
540 | List_ReDraw(); |
Line 565... | Line 555... | ||
565 | action_buf=0; |
555 | action_buf=0; |
566 | } |
556 | } |
567 | break; |
557 | break; |
568 | default: |
558 | default: |
569 | if (Form.status_window<=2) EventRefreshDisksAndFolders(); |
559 | if (Form.status_window<=2) EventRefreshDisksAndFolders(); |
- | 560 | //sprintf(#param, "/tmp0/1/%i", random(99999)); //for testing purpose |
|
- | 561 | //CreateFile(0, 0, #param); |
|
570 | } |
562 | } |
Line 571... | Line 563... | ||
571 | 563 | ||
572 | if(cmd_free) |
564 | if(cmd_free) |
573 | { |
565 | { |
Line 581... | Line 573... | ||
581 | void draw_window() |
573 | void draw_window() |
582 | { |
574 | { |
583 | dword i=0; |
575 | dword i=0; |
584 | incn x; |
576 | incn x; |
585 | dword title; |
577 | dword title; |
586 | if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; |
578 | if (show_status_bar.checked) { |
- | 579 | status_bar_h = STATUS_BAR_H; |
|
- | 580 | } else { |
|
- | 581 | status_bar_h = 0; |
|
- | 582 | } |
|
587 | if (efm) title = TITLE_KFM; else title = TITLE_EOLITE; |
583 | if (efm) title = TITLE_KFM; else title = TITLE_EOLITE; |
588 | DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0); |
584 | DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0); |
589 | GetProcessInfo(#Form, SelfInfo); |
585 | GetProcessInfo(#Form, SelfInfo); |
590 | if (Form.status_window>2) return; |
586 | if (Form.status_window>2) return; |
591 | if (Form.height < 356) { MoveSize(OLD,OLD,OLD,356); return; } |
587 | if (Form.height < 356) { MoveSize(OLD,OLD,OLD,356); return; } |
Line 631... | Line 627... | ||
631 | llist_copy(#files_active, #files); |
627 | llist_copy(#files_active, #files); |
632 | strcpy(#active_path, #path); |
628 | strcpy(#active_path, #path); |
633 | DrawStatusBar(); |
629 | DrawStatusBar(); |
634 | if (!selected_count) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001] |
630 | if (!selected_count) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001] |
635 | DrawFilePanels(); |
631 | DrawFilePanels(); |
636 | dev_popin_active_on_panel = 0; |
632 | disk_popin_active_on_panel = 0; |
637 | } |
633 | } |
Line 638... | Line 634... | ||
638 | 634 | ||
639 | void DrawList() |
635 | void DrawButtonsAroundList() |
640 | { |
636 | { |
641 | word sorting_arrow_x; |
637 | word sorting_arrow_x; |
642 | dword sorting_arrow_t = "\x19"; |
638 | dword sorting_arrow_t = "\x19"; |
643 | if (sort_desc) sorting_arrow_t = "\x18"; |
639 | if (sort_desc) sorting_arrow_t = "\x18"; |
Line 684... | Line 680... | ||
684 | int h2; |
680 | int h2; |
685 | if (!efm) |
681 | if (!efm) |
686 | { |
682 | { |
687 | DrawDeviceAndActionsLeftPanel(); |
683 | DrawDeviceAndActionsLeftPanel(); |
688 | files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h); |
684 | files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h); |
689 | DrawList(); |
685 | DrawButtonsAroundList(); |
690 | Open_Dir(#path,ONLY_SHOW); |
686 | List_ReDraw(); |
691 | } |
687 | } |
692 | else |
688 | else |
693 | { |
689 | { |
694 | //SystemDiscs.Get(); |
- | |
695 | llist_copy(#files, #files_inactive); |
690 | llist_copy(#files, #files_inactive); |
696 | strcpy(#path, #inactive_path); |
691 | strcpy(#path, #inactive_path); |
697 | col.selec = col.selec_inactive; |
- | |
698 | SystemDiscs.Draw(); |
- | |
699 | files_y = files.y; |
692 | files_y = files.y; |
700 | h2 = Form.cheight-files_y-2 - status_bar_h; |
693 | h2 = Form.cheight-files_y-2 - status_bar_h; |
- | 694 | col.selec = col.selec_inactive; //this is a bad code: need to use some var to set inactive panel for DrawButtonsAroundList(); |
|
Line 701... | Line 695... | ||
701 | 695 | ||
702 | if (active_panel==1) |
696 | if (active_panel==1) |
703 | { |
- | |
704 | llist_copy(#files, #files_inactive); |
- | |
705 | strcpy(#path, #inactive_path); |
- | |
706 | col.selec = col.selec_inactive; //this is a bad code: need to use some var to set inactive panel for DrawList(); |
697 | { |
707 | files.SetSizes(Form.cwidth/2, files_y, w2-17, h2, files.item_h); |
698 | files.SetSizes(Form.cwidth/2, files_y, w2-17, h2, files.item_h); |
708 | DrawList(); |
699 | DrawButtonsAroundList(); |
709 | Open_Dir(#path,WITH_REDRAW); |
700 | Open_Dir(#path,WITH_REDRAW); |
710 | llist_copy(#files, #files_active); |
701 | llist_copy(#files, #files_active); |
711 | strcpy(#path, #active_path); |
702 | strcpy(#path, #active_path); |
712 | col.selec = col.selec_active; |
703 | col.selec = col.selec_active; |
713 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
704 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
714 | DrawList(); |
705 | DrawButtonsAroundList(); |
715 | Open_Dir(#path,WITH_REDRAW); |
706 | Open_Dir(#path,WITH_REDRAW); |
716 | } |
707 | } |
717 | if (active_panel==2) |
708 | if (active_panel==2) |
718 | { |
709 | { |
719 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
710 | files.SetSizes(2, files_y, Form.cwidth/2-2-17, h2, files.item_h); |
720 | DrawList(); |
711 | DrawButtonsAroundList(); |
721 | Open_Dir(#path,WITH_REDRAW); |
712 | Open_Dir(#path,WITH_REDRAW); |
722 | llist_copy(#files, #files_active); |
713 | llist_copy(#files, #files_active); |
723 | strcpy(#path, #active_path); |
714 | strcpy(#path, #active_path); |
724 | col.selec = col.selec_active; |
715 | col.selec = col.selec_active; |
725 | files.SetSizes(Form.cwidth/2, files_y, w2 -17, h2, files.item_h); |
716 | files.SetSizes(Form.cwidth/2, files_y, w2 -17, h2, files.item_h); |
726 | DrawList(); |
717 | DrawButtonsAroundList(); |
727 | Open_Dir(#path,WITH_REDRAW); |
718 | Open_Dir(#path,WITH_REDRAW); |
728 | } |
719 | } |
729 | } |
720 | } |
Line 730... | Line -... | ||
730 | } |
- | |
731 | 721 | } |
|
732 | 722 | ||
733 | void List_ReDraw() |
723 | void List_ReDraw() |
734 | { |
724 | { |
735 | int all_lines_h; |
725 | int all_lines_h; |
736 | dword j; |
726 | dword j; |
Line 737... | Line 727... | ||
737 | static int old_cur_y, old_first; |
727 | static int old_cur_y, old_first; |
- | 728 | dword separator_color; |
|
Line 738... | Line 729... | ||
738 | dword separator_color; |
729 | |
739 | 730 | files.CheckDoesValuesOkey(); //prevent some shit |
|
740 | files.CheckDoesValuesOkey(); //prevent some shit |
731 | if (files.count < files.visible) files.visible = files.count; |
741 | 732 | ||
Line 887... | Line 878... | ||
887 | } |
878 | } |
Line 888... | Line 879... | ||
888 | 879 | ||
889 | 880 | ||
890 | void Open_Dir(dword dir_path, redraw){ |
- | |
891 | int errornum; |
881 | void Open_Dir(dword dir_path, redraw){ |
892 | if (redraw!=ONLY_SHOW) |
882 | int errornum; |
893 | { |
883 | |
894 | selected_count = 0; |
884 | selected_count = 0; |
895 | if (buf) free(buf); |
885 | if (buf) free(buf); |
896 | errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT); |
886 | errornum = GetDir(#buf, #files.count, dir_path, DIRS_NOROOT); |
Line 900... | Line 890... | ||
900 | EventHistoryGoBack(); |
890 | EventHistoryGoBack(); |
901 | Write_Error(errornum); |
891 | Write_Error(errornum); |
902 | return; |
892 | return; |
903 | } |
893 | } |
904 | if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0; |
894 | if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0; |
905 | } |
895 | |
906 | if (files.count!=-1) |
896 | if (files.count!=-1) |
907 | { |
897 | { |
908 | if(!_not_draw) DrawPathBar(); |
898 | if(!_not_draw) DrawPathBar(); |
909 | history.add(#path); |
899 | history.add(#path); |
910 | SystemDiscs.Draw(); |
900 | SystemDiscs.Draw(); |
911 | files.visible = files.h / files.item_h; |
901 | files.visible = files.h / files.item_h; |
912 | if (files.count < files.visible) files.visible = files.count; |
902 | if (files.count < files.visible) files.visible = files.count; |
913 | if (!strncmp(dir_path, "/rd/1/",5)) || (!strncmp(dir_path, "/sys/",4)) |
903 | if (!strncmp(dir_path, "/rd/1/",5)) || (!strncmp(dir_path, "/sys/",4)) |
914 | dir_at_fat16 = true; else dir_at_fat16 = false; |
904 | dir_at_fat16 = true; else dir_at_fat16 = false; |
915 | if (redraw!=ONLY_SHOW) Sorting(); |
905 | Sorting(); |
916 | list_full_redraw = true; |
906 | list_full_redraw = true; |
917 | if (redraw!=ONLY_OPEN)&&(!_not_draw) {DrawStatusBar(); List_ReDraw();} |
907 | if (redraw!=ONLY_OPEN)&&(!_not_draw) {DrawStatusBar(); List_ReDraw();} |
918 | SetCurDir(dir_path); |
908 | SetCurDir(dir_path); |
919 | } |
909 | } |
920 | if (files.count==-1) && (redraw!=ONLY_OPEN) |
910 | if (files.count==-1) && (redraw!=ONLY_OPEN) |
Line 1232... | Line 1222... | ||
1232 | } |
1222 | } |
1233 | } |
1223 | } |
Line 1234... | Line 1224... | ||
1234 | 1224 | ||
1235 | void ChangeActivePanel() |
1225 | void ChangeActivePanel() |
- | 1226 | { |
|
1236 | { |
1227 | if (active_panel==1) active_panel=2; else active_panel=1; |
1237 | llist_copy(#files_active, #files_inactive); |
1228 | llist_copy(#files_active, #files_inactive); |
1238 | llist_copy(#files_inactive, #files); |
1229 | llist_copy(#files_inactive, #files); |
1239 | strcpy(#active_path, #inactive_path); |
1230 | strcpy(#active_path, #inactive_path); |
1240 | strcpy(#inactive_path, #path); |
1231 | strcpy(#inactive_path, #path); |
Line 1285... | Line 1276... | ||
1285 | } |
1276 | } |
1286 | if(efm) |
1277 | if(efm) |
1287 | { |
1278 | { |
1288 | if(GetRealFileCountInFolder(#inactive_path) != files_inactive.count) { |
1279 | if(GetRealFileCountInFolder(#inactive_path) != files_inactive.count) { |
1289 | ChangeActivePanel(); |
1280 | ChangeActivePanel(); |
1290 | Open_Dir(#path,WITH_REDRAW); |
- | |
1291 | ChangeActivePanel(); |
1281 | ChangeActivePanel(); |
1292 | } |
1282 | } |
1293 | if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW); |
- | |
1294 | } else { |
- | |
1295 | if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW); |
- | |
1296 | } |
1283 | } |
- | 1284 | if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW); |
|
1297 | } |
1285 | } |
Line 1298... | Line 1286... | ||
1298 | 1286 | ||
1299 | void EventSort(dword id) |
1287 | void EventSort(dword id) |
1300 | { |
1288 | { |
1301 | char selected_filename[256]; |
1289 | char selected_filename[256]; |
1302 | if (sort_type == id) sort_desc ^= 1; |
1290 | if (sort_type == id) sort_desc ^= 1; |
1303 | else sort_type = id; |
1291 | else sort_type = id; |
1304 | strcpy(#selected_filename, #file_name); |
1292 | strcpy(#selected_filename, #file_name); |
1305 | DrawList(); |
1293 | DrawButtonsAroundList(); |
1306 | Open_Dir(#path,WITH_REDRAW); |
1294 | Open_Dir(#path,WITH_REDRAW); |
1307 | SelectFileByName(#selected_filename); |
1295 | SelectFileByName(#selected_filename); |
Line 1308... | Line 1296... | ||
1308 | } |
1296 | } |
Line 1381... | Line 1369... | ||
1381 | 1369 | ||
1382 | void EventClosePopinForm() |
1370 | void EventClosePopinForm() |
1383 | { |
1371 | { |
1384 | del_active = 0; |
1372 | del_active = 0; |
1385 | new_element_active = 0; |
1373 | new_element_active = 0; |
1386 | dev_popin_active_on_panel = 0; |
1374 | disk_popin_active_on_panel = 0; |
1387 | draw_window(); |
1375 | draw_window(); |
Line 1388... | Line 1376... | ||
1388 | } |
1376 | } |
1389 | 1377 | ||
Line 1440... | Line 1428... | ||
1440 | } |
1428 | } |
1441 | } |
1429 | } |
Line 1442... | Line 1430... | ||
1442 | 1430 | ||
1443 | void EventDriveClick(int __id) |
1431 | void EventDriveClick(int __id) |
1444 | { |
1432 | { |
1445 | if (dev_popin_active_on_panel != active_panel) { |
- | |
1446 | if (active_panel == 1) active_panel=2; else active_panel=1; |
1433 | if (disk_popin_active_on_panel != active_panel) { |
1447 | ChangeActivePanel(); |
1434 | ChangeActivePanel(); |
Line 1448... | Line 1435... | ||
1448 | } |
1435 | } |
1449 | 1436 | ||
1450 | SystemDiscs.Click(__id-100); |
1437 | SystemDiscs.Click(__id-100); |
1451 | if (efm) { |
1438 | if (efm) { |
1452 | draw_window(); |
1439 | draw_window(); |
Line -... | Line 1440... | ||
- | 1440 | } |
|
- | 1441 | } |
|
- | 1442 | ||
- | 1443 | void EventOpenDiskPopin(int panel_n) |
|
- | 1444 | { |
|
- | 1445 | DefineHiddenButton(0,0,5000,3000,9999+BT_NOFRAME); |
|
- | 1446 | disk_popin_active_on_panel = panel_n; |
|
- | 1447 | SystemDiscs.Get(); |
|
- | 1448 | if (disk_popin_active_on_panel==1) { |
|
- | 1449 | SystemDiscs.DrawOptions(Form.cwidth/2-DDW, 8+DEV_H_HOR+3); |
|
- | 1450 | } else { |
|
- | 1451 | SystemDiscs.DrawOptions(Form.cwidth-DDW-2, 8+DEV_H_HOR+3); |
|
1453 | } |
1452 | } |