Rev 7242 | Rev 7245 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7242 | Rev 7244 | ||
---|---|---|---|
Line 94... | Line 94... | ||
94 | int mouse_dd, sc_slider_h; |
94 | int mouse_dd, sc_slider_h; |
95 | int j, i; |
95 | int j, i; |
96 | int action_buf; |
96 | int action_buf; |
97 | int rand_n; |
97 | int rand_n; |
Line 98... | Line -... | ||
98 | - | ||
99 | //struct t_settings { |
98 | |
100 | char sort_num=2; |
- | |
101 | bool show_dev_name=true, |
- | |
102 | real_files_names_case=true, |
- | |
103 | info_after_copy=false, |
- | |
104 | two_panels=false, |
- | |
105 | show_breadcrumb=false, |
- | |
106 | show_status_bar=true, |
99 | char sort_num=2; |
107 | active_panel=1, |
- | |
108 | big_icons=false; |
- | |
Line 109... | Line 100... | ||
109 | //} settings; |
100 | int active_panel=1; |
110 | 101 | ||
Line 111... | Line 102... | ||
111 | libimg_image icons16_default; |
102 | libimg_image icons16_default; |
Line 308... | Line 299... | ||
308 | if (files.first<0) files.first=0; |
299 | if (files.first<0) files.first=0; |
309 | if (id!=files.first) List_ReDraw(); |
300 | if (id!=files.first) List_ReDraw(); |
310 | break; |
301 | break; |
311 | } |
302 | } |
Line 312... | Line 303... | ||
312 | 303 | ||
313 | if (two_panels) && (mouse.y > files.y) && (mouse.down) { |
304 | if (two_panels.checked) && (mouse.y > files.y) && (mouse.down) { |
314 | if (mouse.x |
305 | if (mouse.x |
315 | { |
306 | { |
316 | if (active_panel!=1) |
307 | if (active_panel!=1) |
317 | { |
308 | { |
Line 415... | Line 406... | ||
415 | { |
406 | { |
416 | case 059...068: |
407 | case 059...068: |
417 | key_scancode -= 59; |
408 | key_scancode -= 59; |
418 | if (key_scancode < SystemDiscs.list.count) |
409 | if (key_scancode < SystemDiscs.list.count) |
419 | { |
410 | { |
420 | if (!two_panels) |
411 | if (!two_panels.checked) |
421 | { |
412 | { |
422 | DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click |
413 | DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click |
423 | pause(7); |
414 | pause(7); |
424 | } |
415 | } |
425 | SystemDiscs.Click(key_scancode); |
416 | SystemDiscs.Click(key_scancode); |
Line 473... | Line 464... | ||
473 | break; |
464 | break; |
474 | case SCAN_CODE_ENTER: |
465 | case SCAN_CODE_ENTER: |
475 | Open(0); |
466 | Open(0); |
476 | break; |
467 | break; |
477 | case SCAN_CODE_TAB: |
468 | case SCAN_CODE_TAB: |
478 | if (!two_panels) break; |
469 | if (!two_panels.checked) break; |
479 | if (active_panel==1) active_panel=2; else active_panel=1; |
470 | if (active_panel==1) active_panel=2; else active_panel=1; |
480 | ChangeActivePanel(); |
471 | ChangeActivePanel(); |
481 | DrawStatusBar(); |
472 | DrawStatusBar(); |
482 | break; |
473 | break; |
483 | case 093: //menu |
474 | case 093: //menu |
Line 555... | Line 546... | ||
555 | DefineButton(x,11,20-2,22-2,61+BT_HIDE+BT_NOFRAME,0); |
546 | DefineButton(x,11,20-2,22-2,61+BT_HIDE+BT_NOFRAME,0); |
556 | } |
547 | } |
Line 557... | Line 548... | ||
557 | 548 | ||
558 | void draw_window() |
549 | void draw_window() |
559 | { |
550 | { |
560 | if (show_status_bar) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; |
551 | if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0; |
561 | DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,NULL,TITLE,0); |
552 | DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,NULL,TITLE,0); |
562 | GetProcessInfo(#Form, SelfInfo); |
553 | GetProcessInfo(#Form, SelfInfo); |
563 | if (Form.status_window>2) return; |
554 | if (Form.status_window>2) return; |
564 | if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; } |
555 | if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; } |
Line 595... | Line 586... | ||
595 | if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18; |
586 | if (sort_num==1) sorting_arrow_x = files.w - 141 / 2 + files.x + 18; |
596 | if (sort_num==2) sorting_arrow_x = files.x + files.w - 90; |
587 | if (sort_num==2) sorting_arrow_x = files.x + files.w - 90; |
597 | if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w; |
588 | if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w; |
598 | WriteText(sorting_arrow_x,files.y-12,0x80,col_graph,"\x19"); |
589 | WriteText(sorting_arrow_x,files.y-12,0x80,col_graph,"\x19"); |
599 | DrawBar(files.x+files.w,files.y,1,files.h,col_graph); |
590 | DrawBar(files.x+files.w,files.y,1,files.h,col_graph); |
600 | if (two_panels) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph); |
591 | if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,col_graph); |
601 | } |
592 | } |
Line 602... | Line 593... | ||
602 | 593 | ||
603 | void DrawStatusBar() |
594 | void DrawStatusBar() |
604 | { |
595 | { |
605 | char status_bar_str[80]; |
596 | char status_bar_str[80]; |
606 | int go_up_folder_exists=0; |
597 | int go_up_folder_exists=0; |
607 | if (!show_status_bar) return; |
598 | if (!show_status_bar.checked) return; |
608 | if (files.count>0) && (strcmp(file_mas[0]*304+buf+72,"..")==0) go_up_folder_exists=1; |
599 | if (files.count>0) && (strcmp(file_mas[0]*304+buf+72,"..")==0) go_up_folder_exists=1; |
609 | DrawBar(1, Form.cheight - status_bar_h-1, Form.cwidth-2, status_bar_h, system.color.work); |
600 | DrawBar(1, Form.cheight - status_bar_h-1, Form.cwidth-2, status_bar_h, system.color.work); |
610 | sprintf(#status_bar_str, STATUS_STR, files.count-go_up_folder_exists, count_dir-go_up_folder_exists, files.count-count_dir, selected_count); |
601 | sprintf(#status_bar_str, STATUS_STR, files.count-go_up_folder_exists, count_dir-go_up_folder_exists, files.count-count_dir, selected_count); |
611 | WriteText(6,Form.cheight - 13,0x80,system.color.work_text,#status_bar_str); |
602 | WriteText(6,Form.cheight - 13,0x80,system.color.work_text,#status_bar_str); |
Line 612... | Line 603... | ||
612 | } |
603 | } |
613 | 604 | ||
614 | void DrawFilePanels() |
605 | void DrawFilePanels() |
615 | { |
606 | { |
616 | int files_y; |
607 | int files_y; |
617 | if (!two_panels) |
608 | if (!two_panels.checked) |
618 | { |
609 | { |
619 | DrawDeviceAndActionsLeftPanel(); |
610 | DrawDeviceAndActionsLeftPanel(); |
620 | files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h); |
611 | files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h); |
Line 799... | Line 790... | ||
799 | if (files.count>maxcount) files.count = maxcount; |
790 | if (files.count>maxcount) files.count = maxcount; |
800 | if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0; |
791 | if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0; |
801 | } |
792 | } |
802 | if (files.count!=-1) |
793 | if (files.count!=-1) |
803 | { |
794 | { |
804 | if(!_not_draw) if (show_breadcrumb) DrawBreadCrumbs(); else DrawPathBar(); |
795 | if(!_not_draw) if (show_breadcrumb.checked) DrawBreadCrumbs(); else DrawPathBar(); |
805 | history.add(#path); |
796 | history.add(#path); |
806 | SystemDiscs.Draw(); |
797 | SystemDiscs.Draw(); |
807 | files.visible = files.h / files.item_h; |
798 | files.visible = files.h / files.item_h; |
808 | if (files.count < files.visible) files.visible = files.count; |
799 | if (files.count < files.visible) files.visible = files.count; |
809 | if (redraw!=ONLY_SHOW) Sorting(); |
800 | if (redraw!=ONLY_SHOW) Sorting(); |
Line 829... | Line 820... | ||
829 | count_dir = k; |
820 | count_dir = k; |
830 | return; |
821 | return; |
831 | } |
822 | } |
832 | for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;) //files | folders |
823 | for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;) //files | folders |
833 | { |
824 | { |
834 | if (!real_files_names_case) strttl(file_off+40); |
825 | if (!show_real_names.checked) strttl(file_off+40); |
835 | if (TestBit(ESDWORD[file_off],4)) //directory? |
826 | if (TestBit(ESDWORD[file_off],4)) //directory? |
836 | { |
827 | { |
837 | file_mas[k]=j; |
828 | file_mas[k]=j; |
838 | k++; |
829 | k++; |
839 | } |
830 | } |
Line 891... | Line 882... | ||
891 | void SelectFileByName(dword that_file) |
882 | void SelectFileByName(dword that_file) |
892 | { |
883 | { |
893 | int ind; |
884 | int ind; |
894 | files.KeyHome(); |
885 | files.KeyHome(); |
895 | Open_Dir(#path,ONLY_OPEN); |
886 | Open_Dir(#path,ONLY_OPEN); |
896 | if (!real_files_names_case) strttl(that_file); |
887 | if (!show_real_names.checked) strttl(that_file); |
897 | for (ind=files.count-1; ind>=0; ind--;) { if (!strcmp(file_mas[ind]*304+buf+72,that_file)) break; } |
888 | for (ind=files.count-1; ind>=0; ind--;) { if (!strcmp(file_mas[ind]*304+buf+72,that_file)) break; } |
898 | files.cur_y = ind - 1; |
889 | files.cur_y = ind - 1; |
899 | files.KeyDown(); |
890 | files.KeyDown(); |
900 | DrawStatusBar(); |
891 | DrawStatusBar(); |
901 | List_ReDraw(); |
892 | List_ReDraw(); |
Line 1077... | Line 1068... | ||
1077 | break; |
1068 | break; |
1078 | case 4: |
1069 | case 4: |
1079 | if (!itdir) RunProgram("/sys/develop/heed", #file_path); |
1070 | if (!itdir) RunProgram("/sys/develop/heed", #file_path); |
1080 | break; |
1071 | break; |
1081 | case 5: //refresh cur dir & devs |
1072 | case 5: //refresh cur dir & devs |
1082 | if (two_panels) |
1073 | if (two_panels.checked) |
1083 | { |
1074 | { |
1084 | DrawFilePanels(); |
1075 | DrawFilePanels(); |
1085 | } |
1076 | } |
1086 | else |
1077 | else |
1087 | { |
1078 | { |