home *** CD-ROM | disk | FTP | other *** search
- (*
- ┌────────────────[ File Information Report ]────────────────┐
- │ │
- │ Sourcefile for The Fast Commander, V3.51 and higher. │
- │ All material is protected and licensed. │
- │ (C) Copyright 1992 by EUROCON PANATIONAL CORPORATION. │
- │ Written exclusively by Floor Naaijkens for │
- │ UltiHouse Software / The ECO Group All Rights Reserved. │
- │ See various documentory files for further information │
- │ on how to handle these files. │
- │ │
- │ Filename: ECO_FILE.PAS │
- │ Version: 3.51 │
- │ Last change: March 3rd MCMXCIII 11:16 │
- │ Dependencies: CRT, DOS, ECO_LIB │
- │ │
- └───────────────────────────────────────────────────────────┘
- *)
-
-
- {$A-,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V-}
- unit eco_file;
-
- interface
-
- uses
- dos, crt, eco_lib
-
- ;
-
-
- type
- readwrite = (readfile, writefile, readconfig, writeconfig);
- str6 = string[6];
- str12 = string[12];
-
- searchrecord = record
- {fill : array[1..21] of byte; we don't need that!}
- attr : byte;
- time : longint;
- size : longint;
- name : string[12];
- tagged : boolean;
- end;
-
-
- filtagar = array[0..511] of boolean;
- {filtagar = array[0..63] of byte; bits are booleans! }
- far = array[0..511] of searchrecord;
- filtagarptr = ^filtagar;
- farptr = ^far;
-
-
-
- filespanelobj = object { data must not be altered directly }
- showpath,
- fullwide : boolean;
- x1, y1, x2, y2,
- boxtype,
- panel_f, panel_b,
- header_f, header_b : byte;
- footer_f, footer_b : byte;
- showscan : boolean;
- x3, y3, x4, y4,
- popup_f, popup_b,
- tagcsr_f, tagcsr_b,
- tagnocsr_f, tagnocsr_b,
- scrollbar_f, scrollbar_b,
- curactbar_f, curactbar_b : byte;
-
- {==================================}
- filarray : ^far;
- filenumber,
- tagnum, filoff, pc,
- filescursor : word;
- wild : filestr;
- scnlen,
- oldfil, oldoff,
- scan : byte;
- newfiloff : boolean;
- tagbytes : longint;
- sum : longint;
-
- sort : byte; { sort: 1 name }
- { 2 ext }
- show_r_o : boolean; { 3 date & time }
- show_hid : boolean; { 4 size }
- show_sys : boolean; { condition sort: 5 name }
- show_arc : boolean; { 6 ext }
- show_vol : boolean; { 7 date & time }
- show_non : boolean; { 8 size }
- show_dir : boolean; { condition: if less than maxforsort }
- maxforsort : byte; { entries found then sort else skip. }
-
- {==================================}
- procedure init;
- procedure done;
- procedure draw;
- procedure readfiles(_doscurpath: pathstr);
- procedure startsorting;
- function walk_files_(
- returnkeys: pointer; nroffileskeys: byte;
- var pl: boolean; var retkey: word
- ): string;
- function __tm2ststr(hour, minute: word): str6;
- function __xfrstr(sourc: string; xfrin, xfrout: char): string;
- function chnam(s: searchrecord; plain, bar: boolean): string;
- function anytagged(var nr: word): boolean;
- procedure retagfiles(option: readwrite; files: filtagarptr);
- procedure getoptions(
- var
- filesfullwide , filesshowpath : boolean;
- var
- bt,
- filesx1, filesy1, filesx2, filesy2,
- filespanel_f, filespanel_b,
- filesheader_f, filesheader_b : byte;
- filesfooter_f, filesfooter_b : byte;
- var
- filesshowscan : boolean;
- var
- filesx3, filesy3, filesx4, filesy4,
- filespopup_f, filespopup_b,
- filestagnocsr_f, filestagnocsr_b,
- filestagcsr_f, filestagcsr_b,
- filesscrollbar_f, filesscrollbar_b,
- filescuractbar_f, filescuractbar_b : byte
- );
- procedure setoptions(
- filesfullwide , filesshowpath : boolean;
- bt,
- filesx1, filesy1, filesx2, filesy2,
- filespanel_f, filespanel_b,
- filesheader_f, filesheader_b : byte;
- filesfooter_f, filesfooter_b : byte;
- filesshowscan : boolean;
- filesx3, filesy3, filesx4, filesy4,
- filespopup_f, filespopup_b,
- filestagnocsr_f, filestagnocsr_b,
- filestagcsr_f, filestagcsr_b,
- filesscrollbar_f, filesscrollbar_b,
- filescuractbar_f, filescuractbar_b : byte
- );
- end; { filespanelobj }
-
-
-
- const
- _c_v = $2f16;
- shellfile : string = 'C:\SHELL.ECO';
-
-
- var
- hours, mins, secs,
- tics, year, month,
- day : word;
- plain : boolean;
- atri : searchrec;
-
-
-
-
- implementation
-
-
-
- procedure smallbeep;
- begin
- end;
-
-
-
- {$F+}
- function det(d1, d2: searchrecord): byte;
- begin
- if (
- (d1.attr and volumeid)>0) and not((d2.attr and volumeid)>0
- ) then det := 1 else if not(
- (d1.attr and volumeid)>0) and ((d2.attr and volumeid)>0
- ) then det := 0 else if (
- (d1.attr and directory)>0) and not((d2.attr and directory)>0
- ) then det := 1 else if not(
- (d1.attr and directory)>0) and ((d2.attr and directory)>0
- ) then det := 0 else if (
- (d1.attr and directory)>0) and ((d2.attr and directory)>0
- ) then if (d1.name < d2.name) then det := 1 else det := 0 else det := 2;
- end; { det }
-
-
-
- function sortfactorname(var data1, data2): boolean;
- var dd: byte;
- begin
- dd := det(searchrecord(data1),searchrecord(data2));
- if dd = 0 then sortfactorname := false else
- if dd = 1 then sortfactorname := true else
- sortfactorname := (searchrecord(data1).name < searchrecord(data2).name);
- end; { sortfactorname }
-
-
-
-
- function sortfactorext(var data1, data2): boolean;
- var
- st1, st2: string[3];
- in1, in2: integer;
- dd : byte;
-
- begin
- dd := det(searchrecord(data1),searchrecord(data2));
- if dd = 0 then sortfactorext := false else
- if dd = 1 then sortfactorext := true else begin { by extension }
- in1 := pos('.', searchrecord(data1).name);
- if in1<>0 then
- st1 := __juststr(copy(searchrecord(data1).name, in1+1, 3),
- ' ', 3, _left_just_str) else st1 := ' ';
- in2 := pos('.', searchrecord(data2).name);
- if in2<>0 then
- st2 := __juststr(copy(searchrecord(data2).name, in2+1, 3),
- ' ', 3, _left_just_str) else st2 := ' ';
- if (st1=' ') and (st2<>' ') then sortfactorext := true else
- if (st1<>' ') and (st2=' ') then sortfactorext := false else
- if (st1<>' ') and (st2<>' ') and (st1<>st2)
- then sortfactorext := st1<st2
- else sortfactorext := { now by name, ext did not give result }
- (searchrecord(data1).name < searchrecord(data2).name);
- end;
- end; { sortfactorext }
-
-
-
-
-
- function sortfactortime(var data1, data2): boolean;
- var
- dt1, dt2: datetime;
- li1, li2: longint;
- dd : byte;
-
- begin
- dd := det(searchrecord(data1),searchrecord(data2));
- if dd = 0 then sortfactortime := false else
- if dd = 1 then sortfactortime := true else begin { by date and time }
- unpacktime(searchrecord(data1).time, dt1);
- unpacktime(searchrecord(data2).time, dt2);
- li1 := __dt2jlutl(dt1.year, dt1.month, dt1.day);
- li2 := __dt2jlutl(dt2.year, dt2.month, dt2.day);
- if li1<>li2 then sortfactortime := { by date & time } li1<li2
- else begin
- li1 := dt1.hour*10000 + dt1.min*100 + dt1.sec;
- li2 := dt2.hour*10000 + dt2.min*100 + dt2.sec;
- sortfactortime := li1<li2
- end;
- end;
- end; { sortfactortime }
-
-
-
-
- function sortfactorsize(var data1, data2): boolean;
- var dd: byte;
- begin
- dd := det(searchrecord(data1),searchrecord(data2));
- if dd = 0 then sortfactorsize := false else
- if dd = 1 then sortfactorsize := true else
- sortfactorsize := (searchrecord(data1).size < searchrecord(data2).size);
- end; { sortfactorsize }
- {$F-}
-
-
-
-
- procedure filespanelobj.init;
- begin
- newfiloff := false; tagbytes := 0; sum := 0; filenumber := 0;
- tagnum := 0; filoff := 0; pc := 3; sort := 1;
- boxtype := bt_single;
- show_r_o := true; show_hid := true; show_sys := true;
- show_arc := true; show_vol := true; show_non := true;
- show_dir := true; maxforsort := 100; new(filarray);
- getdir(0, _doscurpath); wild := '*.*';
- end;
-
-
-
-
- procedure filespanelobj.done;
- begin
- if filarray<>nil then dispose(filarray);
- filenumber := 0; filoff := 0; filescursor := 0;
- end;
-
-
-
-
- procedure filespanelobj.setoptions(
- filesfullwide , filesshowpath : boolean;
- bt,
- filesx1, filesy1, filesx2, filesy2,
- filespanel_f, filespanel_b,
- filesheader_f, filesheader_b : byte;
- filesfooter_f, filesfooter_b : byte;
- filesshowscan : boolean;
- filesx3, filesy3, filesx4, filesy4,
- filespopup_f, filespopup_b,
- filestagnocsr_f, filestagnocsr_b,
- filestagcsr_f, filestagcsr_b,
- filesscrollbar_f, filesscrollbar_b,
- filescuractbar_f, filescuractbar_b : byte
- );
-
- begin
- fullwide := filesfullwide; showpath := filesshowpath;
- boxtype := bt;
- x1 := filesx1; y1 := filesy1; x2 := filesx2; y2 := filesy2;
- panel_f := filespanel_f; panel_b := filespanel_b;
- header_f := filesheader_f; header_b := filesheader_b;
- footer_f := filesfooter_f; footer_b := filesfooter_b;
- showscan := filesshowscan;
- x3 := filesx3; y3 := filesy3; x4 := filesx4; y4 := filesy4;
- popup_f := filespopup_f; popup_b := filespopup_b;
- tagnocsr_f := filestagnocsr_f; tagnocsr_b := filestagnocsr_b;
- tagcsr_f := filestagcsr_f; tagcsr_b := filestagcsr_b;
- scrollbar_f := filesscrollbar_f; scrollbar_b := filesscrollbar_b;
- curactbar_f := filescuractbar_f; curactbar_b := filescuractbar_b;
- end;
-
-
-
- procedure filespanelobj.getoptions(
- var
- filesfullwide , filesshowpath : boolean;
- var
- bt,
- filesx1, filesy1, filesx2, filesy2,
- filespanel_f, filespanel_b,
- filesheader_f, filesheader_b : byte;
- filesfooter_f, filesfooter_b : byte;
- var
- filesshowscan : boolean;
- var
- filesx3, filesy3, filesx4, filesy4,
- filespopup_f, filespopup_b,
- filestagnocsr_f, filestagnocsr_b,
- filestagcsr_f, filestagcsr_b,
- filesscrollbar_f, filesscrollbar_b,
- filescuractbar_f, filescuractbar_b : byte
- );
-
- begin
- filesfullwide := fullwide; filesshowpath := showpath;
- bt := boxtype;
- filesx1 := x1; filesy1 := y1; filesx2 := x2; filesy2 := y2;
- filespanel_f := panel_f; filespanel_b := panel_b;
- filesheader_f := header_f; filesheader_b := header_b;
- filesfooter_f := footer_f; filesfooter_b := footer_b;
- filesshowscan := showscan;
- filesx3 := x3; filesy3 := y3; filesx4 := x4; filesy4 := y4;
- filespopup_f := popup_f; filespopup_b := popup_b;
- filestagnocsr_f := tagnocsr_f; filestagnocsr_b := tagnocsr_b;
- filestagcsr_f := tagcsr_f; filestagcsr_b := tagcsr_b;
- filesscrollbar_f := scrollbar_f; filesscrollbar_b := scrollbar_b;
- filescuractbar_f := curactbar_f; filescuractbar_b := curactbar_b;
- end;
-
-
-
- procedure filespanelobj.draw;
- const
- onlyshow : word = $0000;
-
- var
- dkey : word;
- ds : string;
-
- begin
- newfiloff := true;
- ds := walk_files_(@onlyshow, 1, showscan, dkey);
- end;
-
-
-
-
-
-
- procedure filespanelobj.readfiles(_doscurpath: pathstr);
- type
- filterenum = (r_o, hid, sys, vol, dir, arc, bit6, bit7);
- fs = set of filterenum;
-
- var
- filter: fs;
-
- begin
- filenumber := 0; tagbytes := 0; sum := 0; tagnum := 0;
- filter := []; { construct filter }
- if show_r_o then filter := filter + [r_o];
- if show_hid then filter := filter + [hid];
- if show_sys then filter := filter + [sys];
- if show_vol then filter := filter + [vol];
- if show_dir then filter := filter + [dir];
- if show_arc then filter := filter + [arc];
- if _doscurpath[length(_doscurpath)] = '\' then findfirst('\*.*', anyfile, atri) else
- findfirst(_doscurpath + '\*.*', anyfile, atri);
- findfirst('*.*', anyfile, atri);
-
- while doserror = 0 do begin
- if (atri.name<>'.') and (fs(atri.attr) <= filter) and
- (show_non or (atri.attr<>0)) then begin
- with filarray^[filenumber] do begin
- {fill := atri.fill;}
- attr := atri.attr;
- time := atri.time;
- size := atri.size;
- name := atri.name; { need upper? }
- tagged := false; {gets through...}
- inc(sum, atri.size);
- end; inc(filenumber);
- end; findnext(atri)
- end; dec(filenumber);
- end; { readfiles }
-
-
-
-
- procedure filespanelobj.startsorting;
- begin
- if sort<>0 then case sort of
- 1: __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactorname
- );
- 2: __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactorext
- );
- 3: __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactortime
- );
- 4: __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactorsize
- );
- 5: if filenumber<maxforsort then
- __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactorname
- );
- 6: if filenumber<maxforsort then
- __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactorext
- );
- 7: if filenumber<maxforsort then
- __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactortime
- );
- 8: if filenumber<maxforsort then
- __qsortsrt(
- @filarray^, filenumber+1, sizeof(searchrecord), @sortfactorsize
- );
- else ; { no sorting }
- end; { case }
- end; { startsorting }
-
-
-
-
- function filespanelobj.__tm2ststr(hour, minute: word): str6;
- var st: string;
- begin
- st := __juststr(__num(hour), ' ', 2, _right_just_str) + ':' +
- __juststr(__num(minute), '0', 2, _right_just_str);
- __tm2ststr := st;
- end; { __tm2ststr }
-
-
-
- function filespanelobj.__xfrstr(sourc: string; xfrin, xfrout: char): string;
- var i: byte;
- begin
- for i := 1 to length(sourc) do if sourc[i]=xfrin then sourc[i] := xfrout;
- __xfrstr := sourc;
- end; { __xfrstr }
-
-
-
-
- function filespanelobj.chnam(s: searchrecord; plain,bar: boolean): string;
- var
- siz: string[9];
- st: string;
- t : datetime;
-
- begin
- if ((s.attr and directory)>0) and (copy(s.name, 1, 1)<>'.') and
- (pos('.', s.name)<>0) then
- st:=__juststr(copy(s.name,1, pos('.', s.name)-1),' ',9,_left_just_str) +
- __juststr(copy(s.name,pos('.', s.name)+1, 3),' ',3,_left_just_str) else
- if ((s.attr and directory)>0) or (pos('.', s.name)=0) then
- st := __juststr(s.name, ' ', 12, _left_just_str) else
- if ((s.attr and directory)>0) then
- st := __juststr(s.name, ' ', 12, _left_just_str) else
- if ((s.attr and volumeid)>0) then
- st := __juststr(copy(s.name, 1, pos('.', s.name)-1) +
- copy(s.name, pos('.', s.name)+1, 3), ' ', 12,
- _left_just_str) else
- if not bar then st := __juststr(copy(s.name, 1, pos('.',s.name)-1),
- ' ',8,_left_just_str)+' '+__juststr(copy(s.name,pos('.', s.name)+
- 1, 3), ' ', 3,_left_just_str) else
- st := __juststr(__cvtstr(s.name, _to_lowcase_str), ' ', 12,
- _left_just_str);
- if ((s.attr and directory)>0) then begin
- { keuze voor . notatie of niet, maar dan ook in tree }
- st := __juststr(__cvtstr(st, _to_upcase_str + _rem_white_str),
- ' ', 12, _left_just_str
- );
- end else st := __cvtstr(st, _to_lowcase_str);
- if not bar then begin
- if ((s.attr and readonly)>0) then st[1] := upcase(st[1]);
- if ((s.attr and sysfile )>0) then st[2] := upcase(st[2]);
- if ((s.attr and hidden )>0) then st[9] := '▒';
- end;
-
- if not(plain) then begin
- unpacktime(s.time, t);
- if ((s.attr and directory)>0) and (s.name='..') then
- siz := chr(16)+'UP--DIR'+chr(17) else
- if ((s.attr and directory)>0) and (s.name<>'..') then
- siz := chr(16)+'SUB-DIR'+chr(17) else
- if ((s.attr and volumeid)>0) then
- siz := chr(16)+'VOLUMID'+chr(17) else
- if s.size=0 then siz := chr(16)+'NULFILE'+chr(17) else
- if s.size<99999999 then
- siz := __juststr(__pntstr(s.size), ' ', 9, _right_just_str) else
- siz := __juststr(__num(s.size), ' ', 9, _right_just_str);
- st := st + '│' + siz + '│' +
- __juststr(
- __dt2ststr(t.year, t.month, t.day, _euro_dt_str), ' ', 8, _left_just_str
- ) + '│ ' +
- __tm2ststr(t.hour, t.min);
- end; chnam := st;
- end; { chnam }
-
-
-
-
-
- function filespanelobj.anytagged(var nr: word): boolean;
- var
- i,n : word;
-
- begin
- n := 0; sum := 0;
- for i := 0 to filenumber do begin
- inc(sum, filarray^[i].size);
- if filarray^[i].tagged then inc(n)
- end; nr := n; anytagged := (n>0)
- end;
-
-
-
-
-
- procedure filespanelobj.retagfiles(option: readwrite; files: filtagarptr);
- var
- f : file of boolean;
- i : word;
-
- begin
- i := 0;
- case option of
- writefile : begin
- assign(f, shellfile); rewrite(f);
- for i := 0 to filenumber do write(f, filarray^[i].tagged);
- close(f);
- end;
-
- readfile : begin
- i := 0; assign(f, shellfile); reset(f);
- while not(eof(f) or (i>511)) do begin
- read(f, files^[i]); filarray^[i].tagged := files^[i]; inc(i)
- end;
- close(f);
- end;
-
- writeconfig : begin
- for i := 0 to 511 do files^[i] := false;
- for i := 0 to filenumber do files^[i] := filarray^[i].tagged;
- end;
-
- readconfig : begin
- for i := 0 to 511 do filarray^[i].tagged := false;
- for i := 0 to filenumber do filarray^[i].tagged := files^[i];
- end;
- end; { option }
- end;
-
-
-
-
-
- {@}
- function filespanelobj.walk_files_(
- returnkeys: pointer; nroffileskeys: byte;
- var pl: boolean; var retkey: word
- ): string;
-
- type
- arr = array[1..128] of word;
- ar = ^arr;
-
- var
- i, j, page, dd,
- key : word;
- retkeypressed : boolean;
- statusbits : longint;
- statusflags : _keystatus;
-
-
-
- {sub}procedure filesscreen(
- x1, y1, x2, y2, bx,
- fg, bg, head_f, head_b,
- tagnocsr_f, tagnocsr_b: byte;
- first: word; pl: boolean;
- filesonly: boolean;
- _doscurpath: string);
-
- var
- i, xoff: word;
-
- begin
- {_hidemouse := false; if __hidemou(true)=_ok_mou then ;}
- if pl then begin
- if not(filesonly) then begin
- __clrscn(x1, y1, x2, y2, fg, bg, ' ');
- __boxscn(x1, y1, x2, y2, bx, fg, bg);
- if bx = bt_double then __write(
- x1, y2-2, panel_f, panel_b, '╟'+__rep(x2-x1-1, '─')+'╢'
- ) else __write(x1, y2-2, fg, bg, '├' + __rep(x2-x1-1, '─') +'┤');
- if bx = bt_double then __write(x1+13, y1, fg, bg, '╤') else
- __write(x1+13, y1, fg, bg, '┬');
- __write(x1+13, y2-2, fg, bg, '┴');
- if fullwide then begin
- if bx = bt_double then __write(x1+26, y1, fg, bg, '╤') else
- __write(x1+26, y1, fg, bg, '┬');
- __vert(x1+26, y1+1, fg, bg, __rep(y2-y1-3, '│'));
- __write(x1+26, y2-2, fg, bg, '┴');
- end;
-
- __vert(x1+13, y1+1, fg, bg, __rep(y2-y1-3, '│'));
- __write(x1+5, y1+1, head_f, head_b, 'Name');
- __write(x1+18, y1+1, head_f, head_b, 'Name');
- if fullwide then __write(x1+31, y1+1, head_f, head_b, 'Name');
-
- __betwscn(x1, x2, y1, bg, fg, ' ' +
- __slashfil(
- __packfil(
- __cvtstr(
- __xlatestr(__backrem(_doscurpath), '.', ' '),
- _rem_white_str
- ),
- x2-x1-1-2
- )
- ) +
- ' '
- );
-
- end;
- { display all those files in filarray }
- i := 0; xoff := 0;
- while ((i < pc*(y2-y1-1-2-1)) and (i<=filenumber)) do begin
- if not filarray^[i+first].tagged then
- __write(x1+1+xoff, i+y1+2-((xoff div 13)*(y2-y1-1-2-1)),
- fg, bg, chnam(filarray^[i+first], pl, false)) else
- __write(x1+1+xoff, i+y1+2-((xoff div 13)*(y2-y1-1-2-1)),
- tagnocsr_f,tagnocsr_b,chnam(filarray^[i+first],pl, false));
- inc(i);
- if (i >= (y2-y1-1-2-1)) and (i <= 2*(y2-y1-1-2-1)-1) then xoff := 13
- else if (i >= 2*(y2-y1-1-2-1)) and fullwide then xoff := 26;
- end;
- end else begin { attibutes are wanted }
- if not(filesonly) then begin
- __clrscn(x1,y1,x2,y2,fg,bg, ' ');
- __boxscn(x1, y1, x2, y2, bx, fg, bg);
- if bx = bt_double then
- __write(x1+00, y2-2, fg, bg, '╟' + __rep(x2-x1-1, '─')+'╢') else
- __write(x1+00, y2-2, fg, bg, '├' + __rep(x2-x1-1, '─')+'┤');
- if bx = bt_double then
- __write(x1+13, y1, fg, bg, '╤') else
- __write(x1+13, y1, fg, bg, '┬');
- __write(x1+13, y2-2, fg, bg, '┴');
- if bx = bt_double then
- __write(x1+23, y1-0, fg, bg, '╤') else
- __write(x1+23, y1-0, fg, bg, '┬');
- __write(x1+23, y2-2, fg, bg, '┴');
- __vert(x1+13, y1+1, fg, bg, __rep(y2-y1-3, '│'));
- __vert(x1+23, y1+1, fg, bg, __rep(y2-y1-3, '│'));
-
- __betwscn(x1, x2, y1, bg, fg, ' ' +
- __slashfil(
- __packfil(
- __cvtstr(
- __xlatestr(__backrem(_doscurpath), '.', ' '),
- _rem_white_str
- ),
- x2-x1-1-2
- )
- ) +
- ' '
- );
-
- __write(x1+05, y1+1, head_f, head_b, 'Name');
- __write(x1+17, y1+1, head_f, head_b, 'Size');
- if fullwide then begin
- if bx = bt_double then
- __write(x1+32, y1, fg, bg, '╤') else
- __write(x1+32, y1, fg, bg, '┬');
- __write(x1+32, y2-2, fg, bg, '┴');
- __vert(x1+32, y1+1, fg, bg, __rep(y2-y1-3, '│'));
- __write(x1+26, y1+1, head_f, head_b, 'Date');
- __write(x1+34, y1+1, head_f, head_b, 'Time');
- end;
-
- end; i := 0;
- while (i < (y2-y1-1-2-1)) and (i<=filenumber) do begin
- if not filarray^[i+first].tagged then
- __write(x1+1,y1+2+i,fg,bg,
- copy(chnam(filarray^[i+first], pl, false), 1, scnlen)) else
- __write(x1+1,y1+2+i,tagnocsr_f,tagnocsr_b,
- copy(chnam(filarray^[i+first], pl, false), 1, scnlen));
- inc(i);
- end;
- end;
- {_hidemouse := __equipmou=_ok_mou; if __hidemou(false)=_ok_mou then ;}
- end; { filesscreen }
-
-
-
-
- {sub}procedure tagbar(aa,fg,bg: word);
- begin
- if pl then __attrib(
- x1+1+13*(aa div page), y1+1+01+(aa mod page),
- x1+1+13*(aa div page) + 11, y1+1+01+(aa mod page),
- fg, bg
- ) else __attrib(x1+1, y1+2+aa, x2-1, y1+2+aa, fg, bg);
- end; { tagbar }
-
-
-
- procedure oldtags(
- var a1, b1: byte; fg, bg, tag_f, tag_b: byte; removeoldtag: boolean
- );
- begin
- if removeoldtag then begin
- if filarray^[a1+b1].tagged then tagbar(a1, tag_f, tag_b) else
- tagbar(a1, fg, bg)
- end;
- a1 := filescursor; b1 := filoff;
- end;
-
-
-
-
- {sub}procedure last1;
- begin
- if filoff <= filenumber - page then newfiloff := true;
- if filenumber >= page then filoff := filenumber - page + 1 else
- filoff := 0;
- if filenumber < page then filescursor := filenumber else
- filescursor := page - 1
- end; { last1 }
-
-
- {sub}procedure last3;
- begin
- if filoff <= filenumber - pc * page then newfiloff := true;
- if filenumber >= pc * page then begin
- filoff := filenumber - pc * page + 1;
- filescursor := pc * page - 1
- end else filescursor := filenumber;
- end; { last3 }
-
-
- {sub}procedure swaptag(var item: searchrecord);
- begin
- if not(
- ((item.attr and directory)>0) or ((item.attr and volumeid)>0)
- ) then begin
- item.tagged := not item.tagged;
- if item.tagged then begin
- inc(tagnum); inc(tagbytes, item.size)
- end else begin
- dec(tagnum); dec(tagbytes, item.size)
- end;
- end;
- end;
-
-
- {sub}procedure swaptagged;
- var i: word;
- begin
- for i := 0 to filenumber do swaptag(filarray^[i]); newfiloff := true;
- end;
-
-
-
-
- {sub}procedure tagfiles(tag: boolean);
- var
- errorcode : word;
- fieldctrl2 : _editctrl;
- sstt : string;
- nam1, nam2 : namestr;
- ext1, ext2 : extstr;
- j,i : integer;
- check,
- anymatch, ok : boolean;
- tmpscn : _scnimageptr;
-
- begin
- tagbar(filescursor, curactbar_f, curactbar_b);
- new(tmpscn); __savscn(tmpscn); anymatch := false;
- __bandwin(true, 33, 9, 48, 10, popup_f, popup_b, sh_default, 2);
- if tag then sstt := ' Select ' else sstt := ' Unselect ';
- __betwscn(34, 48, 8, popup_f, popup_b, sstt);
- __betwscn(34, 48, 9, popup_f, popup_b, ' Match: ');
- fillchar(fieldctrl2, sizeof(fieldctrl2), 0);
- with fieldctrl2 do begin
- _viewx1 := 35;
- _viewx2 := 47;
- _viewy1 := 10;
- _vscnfore := popup_f;
- _vscnback := popup_b;
- _vscncols := 12;
- {_editmode := _leftjust_edt + _to_upcase_str + _mergemask_edt;
- _mask := '';
- }
- end;
-
- if __editline(wild, fieldctrl2) then begin
- __resscn(tmpscn);
- newfiloff := true;
- for i := 0 to filenumber do begin
- if (
- (tag and not(filarray^[i].tagged)) or
- (not(tag) and filarray^[i].tagged)
- ) and not (
- ((filarray^[i].attr and directory) >0) or
- ((filarray^[i].attr and volumeid) >0)
- ) then begin
- ok := true; __parsefil(wild, nam1, ext1);
- __parsefil(filarray^[i].name, nam2, ext2);
- nam1 := __up(nam1); nam2 := __up(nam2);
- ext1 := __up(ext1); ext2 := __up(ext2);
- j := 1;
- while (j <= length(nam1)) and ok do begin
- if nam1[j] = '*' then j := 9 else
- if not(nam1[j] in ['?', nam2[j]]) then ok := false;
- inc(j);
- end; { while1 }
- if (
- ok and (j = length(nam1)+1) and (length(nam2)>length(nam1))
- ) then ok := false;
- { if j <> length(nam1)+1 then mismatch or a * found }
-
- j := 1;
- while (j <= length(ext1)) and ok do begin
- if ext1[j] = '*' then j := 4 else
- if not(ext1[j] in ['?', ext2[j]]) then ok := false;
- inc(j);
- end; { while2 }
- if (
- ok and (j=length(ext1)+1) and (length(ext2) > length(ext1))
- ) then ok := false;
- { if j <> length(ext1)+1 then mismatch or a * found }
-
- if not(filarray^[i].tagged) and tag and ok then begin
- filarray^[i].tagged := true;
- inc(tagnum); inc(tagbytes, filarray^[i].size)
- end;
- if filarray^[i].tagged and not(tag) and ok then begin
- filarray^[i].tagged := false;
- dec(tagnum); dec(tagbytes, filarray^[i].size)
- end;
- anymatch := anymatch or ok;
- end; { something may happen }
- end; { while, check all the files }
-
- if not anymatch then begin
- __savscn(tmpscn);
- __bandwin(true, 24, 8, 57, 11, popup_f, popup_b, sh_default, 2);
- if anytagged(dd) then
- __betwscn(26, 55, 09, popup_f, popup_b,
- 'No extra matches found with:') else
- __betwscn(26, 55, 09, popup_f, popup_b,
- 'No match found using filter:');
- __betwscn(26, 55, 10, popup_f, popup_b, wild);
- if tag then sstt := ' Select ' else sstt := ' Unselect ';
- __betwscn(26, 55, 08, popup_f, popup_b, sstt);
- delay(3000); __resscn(tmpscn);
- end;
-
- end; { user not escaped }
- __resscn(tmpscn); dispose(tmpscn);
- end; { tagfiles }
-
-
-
-
-
- function __kpntstr(l: longint; b: byte): string;
- begin
- if b=3 then __kpntstr := __pntstr(l) else
- if ((l div 1024) div 1024) > 0 then
- __kpntstr := __num((l div 1024) div 1024) + 'M' else
- __kpntstr := __num(__max(l, 1024) div 1024) + 'K';
- end;
-
-
-
- begin
- retkeypressed := false; page := y2 - y1 - 1 - 2 - 1;
- if fullwide then pc := 3 else pc := 2;
- scnlen := x2-x1-1;
-
- if word((ar(returnkeys))^[1]) = $0000 then begin
- filesscreen(x1, y1, x2, y2, boxtype,
- panel_f, panel_b, header_f, header_b,
- tagnocsr_f, tagnocsr_b, 0, pl, false, _doscurpath);
- if pl then __write(x1+1,y2-1,footer_f,footer_b, copy(
- __xfrstr(chnam(filarray^[filoff+filescursor], false, true), '│', ' '),
- 1, scnlen)
- );
- { !!! checken voor klok }
- __betwscn(x1, x2, y1, panel_f, panel_b, ' ' +
- __slashfil(
- __packfil(
- __cvtstr(
- __xlatestr(__backrem(_doscurpath), '.', ' '),
- _rem_white_str
- ),
- x2-x1-1-2
- )
- ) +
- ' '
- );
- tagbar(filescursor, curactbar_f, curactbar_b); exit
- { just getting a nice picture and leave }
- end;
-
- __betwscn(x1, x2, y1, panel_b, panel_f, ' ' +
- __slashfil(
- __packfil(
- __cvtstr(
- __xlatestr(__backrem(_doscurpath), '.', ' '),
- _rem_white_str
- ),
- x2-x1-1-2
- )
- ) +
- ' '
- );
-
- repeat
- if newfiloff then begin
- newfiloff := false;
- filesscreen(x1, y1, x2, y2, boxtype,
- panel_f, panel_b, header_f, header_b,
- tagnocsr_f, tagnocsr_b, filoff, pl, false, _doscurpath
- );
- end;
-
- if pl then begin { more rows, no attrs }
-
- if fullwide then pc := 3 else pc := 2;
- if anytagged(dd) then __write(x1+1,y2-1, footer_f, footer_b,
- __juststr(copy(
- 'F ' + __num(filenumber)+' ('+ __kpntstr(sum,pc) + ')' + ' ' +
- 'T ' + __num(tagnum) +' ('+ __kpntstr(tagbytes,pc) + ')',1,x2-x1-1),
- ' ', x2-x1-1, _left_just_str)
- ) else __write(x1+1,y2-1, footer_f, footer_b, copy(
- __xfrstr(chnam(filarray^[filoff+filescursor], false, true), '│',' '),
- 1, scnlen)
- );
-
-
- oldtags(oldfil, oldoff, panel_f, panel_b, tagnocsr_f, tagnocsr_b,true);
- if filarray^[filoff+filescursor].tagged then
- tagbar(filescursor, tagcsr_f, tagcsr_b) else
- tagbar(filescursor, scrollbar_f, scrollbar_b);
-
- if retkey=$0000 then key := __retkey else key := retkey;
- statusbits := __statkey(statusflags); retkey := $0000;
- oldtags(oldfil,oldoff, panel_f, panel_b, tagnocsr_f, tagnocsr_b,false);
-
-
- case key of
-
- _up, _padup: begin
- if statusflags._scrollstate then begin
- if statusflags._capsstate then begin
- if (y1>1) then begin
- __copyscn(x1,y1,x2,y2,x1,y1-1);
- {__partscn(scn4, x1, y2, x2, y2, true);}
- dec(y1); dec(y2);
- end else smallbeep;
- end else begin
- if y2 > y1+6 then begin
- dec(y2); newfiloff := true; dec(page);
- filoff := 0; filescursor := 0;
- {__partscn(scn4,x1,y2+1,x2,y2+2, true);}
- end else smallbeep;
- end;
- end else begin
- if filescursor>0 then dec(filescursor) else
- if filoff>0 then begin
- { if not filarray^[oldoff+oldfil].tagged then
- __attrib(x1+1, y1+2+1, x1+12, y1+2+1, panel_f, panel_b) else
- __attrib(x1+1, y1+2+1, x1+12, y1+2+1, tagnocsr_f, tagnocsr_b);
- }
- dec(filoff); inc(oldfil);
- __flushkey;
- if fullwide then begin
- { y1+2 since last must scroll off }
- __copyscn(x1+27, y1+2, x1+38, y2-1-3, x1+27, y1+3);
- { get last of 2nd column as first of 3rd }
- __copyscn(x1+14, y2-1-2, x1+25, y2-1-2, x1+27, y1+2);
- end;
- { y1+2 since last one must scroll off }
- __copyscn(x1+14, y1+2, x1+25, y2-1-3, x1+14, y1+3);
- { get last of 1st column as first of 2nd }
- __copyscn(x1+01, y2-1-2, x1+12, y2-1-2, x1+14, y1+2);
- { y1+3 since first must scroll off }
- __copyscn(x1+01, y1+2, x1+12, y2-1-3, x1+1, y1+3);
- { write new filename as last item on scn }
- __write(x1+01, y1+2, panel_f, panel_b,
- chnam(filarray^[filoff], pl, false)
- );
- end;
- end; { status }
- end;
-
-
- _down, _paddown, _c_v, _ins, _padins: begin
- case key of
- _ins, _padins, _c_v: begin
- swaptag(filarray^[filoff+filescursor]);
- if filarray^[filoff+filescursor].tagged then
- tagbar(filescursor, tagnocsr_f, tagnocsr_b) else
- tagbar(filescursor, panel_f, panel_b);
- end; else ;
- end;
- if statusflags._scrollstate then begin
- if statusflags._capsstate then begin
- if (y2<_currows-2) then begin
- __copyscn(x1,y1,x2,y2,x1,y1+1);
- {__partscn(scn4, x1, y1, x2, y1, true);}
- inc(y1); inc(y2);
- end else smallbeep;
- end else begin
- if y2 < _currows - 2 then begin
- inc(y2); newfiloff := true; inc(page);
- filoff := 0; filescursor := 0;
- end{ else smallbeep;}
- end;
- end else begin
- if (filescursor < pc*page-1) and
- (filescursor < filenumber) then inc(filescursor) else
- if filoff+pc*page <= filenumber then begin
- {
- if not filarray^[oldoff+oldfil].tagged then
- __attrib(x1+27-(3-pc)*13, y1+2+1,
- x1+38-(3-pc)*13, y1+2+1, panel_f, panel_b) else
- __attrib(x1+27-(3-pc)*13, y1+2+1,
- x1+38-(3-pc)*13, y1+2+1, tagnocsr_f, tagnocsr_b);
- }
- __flushkey; inc(filoff); dec(oldfil);
- { y1+3 since first must scroll off }
- __copyscn(x1+01, y1+3, x1+12, y2-1-2, x1+1, y1+2);
- { get first of 2nd column as last of 1st }
- __copyscn(x1+14, y1+2, x1+25, y1+2, x1+1, y2-1-2);
- { y1+3 since first must scroll off }
- __copyscn(x1+14, y1+3, x1+25, y2-1-2, x1+14, y1+2);
- { get first of 3nd column as last of 2nd }
- if fullwide then begin
- __copyscn(x1+27, y1+2, x1+38, y1+2, x1+14, y2-1-2);
- { y1+3 since first must scroll off }
- __copyscn(x1+27, y1+3, x1+38, y2-1-2, x1+27, y1+2);
- { write new filename as last item on scn }
- end;
- if fullwide then __write(x1+27, y2-1-2, panel_f, panel_b,
- chnam(filarray^[filoff + 3*page-1], pl, false)) else
- __write(x1+14, y2-1-2, panel_f, panel_b,
- chnam(filarray^[filoff + 2*page-1], pl, false));
- end;
- end; { status }
- end;
-
-
- _left, _padleft: begin
- if statusflags._scrollstate then begin
- if statusflags._capsstate then begin
- if (x1>1) then begin
- __copyscn(x1,y1,x2,y2,x1-1,y1);
- {__partscn(scn4, x2, y1, x2, y2, true);}
- dec(x1); dec(x2);
- end{ else smallbeep;}
- end else begin
- if not fullwide then begin
- fullwide := true; {smallbeep;}
- if x1 > 13 then dec(x1, 13) else begin
- x1 := 1; x2 := 40
- end;
- pc := 3; newfiloff := true; filoff := 0; filescursor := 0;
- scnlen := x2-x1-1;
- end else smallbeep;
- end;
- end else begin
- if (filescursor div page) > 0 then
- dec(filescursor, page) else begin
- if filoff<page then begin
- if filescursor>0 then newfiloff := true;
- filoff := 0; filescursor := 0;
- end else begin
- __flushkey; dec(filoff,page); inc(oldfil, page);
- if not filarray^[oldoff+oldfil].tagged then
- __attrib(x1+1, y1+2+(filescursor mod page),
- x1+12, y1+2+(filescursor mod page), panel_f, panel_b) else
- __attrib(x1+1, y1+2+(filescursor mod page),
- x1+12, y1+2+(filescursor mod page),
- tagnocsr_f, tagnocsr_b
- );
- if fullwide then
- __copyscn(x1+14, y1+2, x1+25, y2-1-2, x1+27, y1+2);
- __copyscn(x1+01, y1+2, x1+12, y2-1-2, x1+14, y1+2);
- for i := 0 to page-1 do
- if not filarray^[filoff].tagged then
- __write(x1+1, y1+2+i, panel_f, panel_b,
- chnam(filarray^[i + filoff], pl, false)) else
- __write(x1+1, y1+2+i, tagnocsr_f, tagnocsr_b,
- chnam(filarray^[i + filoff], pl, false));
- end;
- end;
- end;
- end;
-
-
- _right, _padright: begin
- if statusflags._scrollstate then begin
- if statusflags._capsstate then begin
- if (x2<_curcolumns) then begin
- __copyscn(x1,y1,x2,y2,x1+1,y1);
- {__partscn(scn4, x1, y1, x1, y2, true);}
- inc(x1); inc(x2);
- end else smallbeep;
- end else begin
- if fullwide then begin
- {__partscn(scn4,x1,y1,x1+13,y2,true);}
- fullwide := false; {smallbeep;} inc(x1, 13);
- pc := 2; newfiloff := true; filoff := 0; filescursor := 0;
- scnlen := x2-x1-1;
- end else smallbeep;
- end;
- end else begin
- if (filescursor div page) < pc-1 then
- inc(filescursor, page) else begin
- if filoff + (pc+1)*page < filenumber then begin
- inc(filoff, page); __flushkey; dec(oldfil, page);
- if not filarray^[oldoff+oldfil].tagged then
- __attrib(x1+27-(3-pc)*13, y1+2+(filescursor mod page),
- x1+38-(3-pc)*13, y1+2+(filescursor mod page),
- panel_f, panel_b
- ) else __attrib(x1+27-(3-pc)*13,
- y1+2+(filescursor mod page),
- x1+38-(3-pc)*13, y1+2+(filescursor mod page),
- tagnocsr_f, tagnocsr_b
- );
- __copyscn(x1+14, y1+2, x1+25, y2-1-2, x1+1, y1+2);
- if fullwide then
- __copyscn(x1+27, y1+2, x1+38, y2-1-2, x1+14, y1+2);
- i := 0;
- while (
- (i<page) and (i+filoff+(pc-1)*page<filenumber)
- ) do begin
- if not filarray^[i + filoff + (pc-1)*page].tagged then
- __write(x1+27-(3-pc)*13, y1+1+1+i, panel_f, panel_b,
- chnam(filarray^[i + filoff + (pc-1)*page],pl,false)
- ) else __write(
- x1+27-(3-pc)*13, y1+1+1+i, tagnocsr_f, tagnocsr_b,
- chnam(filarray^[i + filoff + (pc-1)*page], pl, false)
- );
- inc(i);
- end;
- end else last3;
- end;
- if filoff + filescursor > filenumber then
- filescursor := filenumber - filoff;
- end;
- end;
-
-
- _home, _padhome: begin
- if filoff>0 then newfiloff := true; filoff := 0; filescursor := 0
- end;
-
- _end, _padend: last3;
-
- _pgdn, _padpgdn: begin
- newfiloff := true;
- {@} if (
- (filoff < filenumber - pc * 2 * page) and
- (filenumber > pc * 2 * page)
- ) then begin
- inc(filoff, pc * page); filescursor := pc * page - 1;
- end else last3;
- end;
-
- _pgup, _padpgup: begin
- newfiloff := true;
- if (filoff >= pc*page) then dec(filoff, pc*page) else
- filoff := 0;
- filescursor := 0;
- end;
-
- _minus, _padminus: tagfiles(false);
- _plus, _padplus: tagfiles(true);
- _padstar: swaptagged;
-
- else retkeypressed := true;
- {
- for i := 5 to nroffileskeys do retkeypressed := retkeypressed or
- (key = __keyword(_keys((ar(returnkeys))^[i])));
- end;
- }
- end; { case }
-
- end else begin
-
- if fullwide then pc := 3 else pc := 2;
- __write(x1+1,y2-1,footer_f, footer_b, __juststr(
- 'F ' + __num(filenumber) + ' (' + __kpntstr(sum,pc) + ')' + ' ' +
- 'T ' + __num(tagnum) + ' (' + __kpntstr(tagbytes,pc) + ')',
- ' ', x2-x1-1, _left_just_str)
- );
- if filarray^[filoff+filescursor].tagged then
- tagbar(filescursor, tagcsr_f, tagcsr_b) else
- tagbar(filescursor, scrollbar_f, scrollbar_b);
-
- key := __retkey; statusbits := __statkey(statusflags);
-
- if filarray^[filoff+filescursor].tagged then
- tagbar(filescursor, tagnocsr_f, tagnocsr_b) else
- tagbar(filescursor, panel_f, panel_b);
-
-
- case key of
-
- _up, _padup: begin
- if statusflags._scrollstate then begin
- if statusflags._capsstate then begin
- if (y1>1) then begin
- __copyscn(x1,y1,x2,y2,x1,y1-1);
- {__partscn(scn4, x1, y2, x2, y2, true);}
- dec(y1); dec(y2);
- end else smallbeep;
- end else begin
- if y2 > 7 then begin
- dec(y2); newfiloff := true; dec(page);
- filoff := 0; filescursor := 0;
- {if y2<_currows-2 then
- __write(x1, y2+1, panel_f, panel_b, __rep(x2-x1+1, ' '));}
- {__partscn(scn4,x1,y2+1,x2,y2+2,true);}
- end else smallbeep;
- end;
- end else begin
- if filescursor>0 then dec(filescursor) else
- if filoff>0 then begin
- dec(filoff);
- __copyscn(x1+1, y1+2, x2-1, y2-1-2-1, x1+1, y1+3);
- __write(x1+1, y1+2, panel_f, panel_b, copy(
- chnam(filarray^[filoff],pl,false), 1, scnlen));
- end;
- end; { status }
- end;
-
- _down, _paddown, _c_v, _ins, _padins: begin
- case key of
- _ins, _padins, _c_v: begin
- swaptag(filarray^[filoff+filescursor]);
- if filarray^[filoff+filescursor].tagged then
- tagbar(filescursor, tagnocsr_f, tagnocsr_b) else
- tagbar(filescursor, panel_f, panel_b);
- end; else ;
- end;
- if statusflags._scrollstate then begin
- if statusflags._capsstate then begin
- if (y2<_currows-2) then begin
- __copyscn(x1,y1,x2,y2,x1,y1+1);
- {__partscn(scn4, x1, y1, x2, y1, true);}
- inc(y1); inc(y2);
- end else smallbeep;
- end else begin
- if y2 < _currows - 2 then begin
- inc(y2); newfiloff := true; inc(page);
- filoff := 0; filescursor := 0;
- end else smallbeep;
- end;
- end else begin
- if (filescursor < page-1) and (filescursor<filenumber) then
- inc(filescursor) else
- if filoff < (filenumber-page+1) then begin
- inc(filoff);
- __copyscn(x1+1, y1+3, x2-1, y2-1-2, x1+1, y1+2);
- __write(x1+1, y2-1-2, panel_f, panel_b, copy(
- chnam(filarray^[filoff + page -1], pl, false), 1, scnlen));
- end;
- end; { status }
- end;
-
- _left, _padleft: begin
- if statusflags._scrollstate and (x1>13) then begin
- if statusflags._capsstate then begin
- if (x1>1) then begin
- __copyscn(x1,y1,x2,y2,x1-1,y1);
- {__partscn(scn4, x2, y1, x2, y2, true);}
- dec(x1); dec(x2);
- end else smallbeep;
- end else begin
- if not fullwide then begin
- fullwide := true; {smallbeep;} dec(x1, 13);
- pc := 3; newfiloff := true; filoff := 0; filescursor := 0;
- scnlen := x2-x1-1;
- end else smallbeep;
- end;
- end;
- end;
-
- _right, _padright: begin
- if statusflags._scrollstate then begin
- if statusflags._capsstate then begin
- if (x2<_curcolumns) then begin
- __copyscn(x1,y1,x2,y2,x1+1,y1);
- {__partscn(scn4, x1, y1, x1, y2, true);}
- inc(x1); inc(x2);
- end else smallbeep;
- end else begin
- if fullwide then begin
- {__partscn(scn4,x1,y1,x1+13,y2,true);}
- fullwide := false; smallbeep; inc(x1, 13);
- pc := 2; newfiloff := true; filoff := 0; filescursor := 0;
- scnlen := x2-x1-1;
- end else smallbeep;
- end;
- end;
- end;
-
- _pgdn, _padpgdn: begin
- {@} if (
- (filoff < (filenumber - 2 * page)) and (filenumber > 2 * page)
- ) then begin
- inc(filoff, page); newfiloff := true;
- end else last1;
- end;
-
- _pgup, _padpgup: begin
- newfiloff := true;
- if filoff >= page then dec(filoff,page) else filoff := 0;
- end;
-
- _end, _padend: last1;
-
- _home, _padhome: begin
- if filoff>0 then newfiloff := true; filoff := 0; filescursor := 0;
- end;
-
- _padminus: tagfiles(false);
- _padplus: tagfiles(true);
- _padstar: swaptagged;
-
- else retkeypressed := true;
- {
- for i := 5 to nroffileskeys do retkeypressed := retkeypressed or
- (key = __keyword(_keys((ar(returnkeys))^[i])));
- end;
- }
- end; { case }
-
- end; { pl or not pl }
-
- if key = ar(returnkeys)^[1] then begin
- readfiles(_doscurpath); startsorting; newfiloff := true;
- retkeypressed := false;
- end;
-
- if key = ar(returnkeys)^[2] then begin
- retkeypressed := true; { confirmation }
- end;
-
- if key = ar(returnkeys)^[3] then begin
- newfiloff := true; pl := not pl; filoff := 0; filescursor := 0;
- retkeypressed := false;
- end;
-
- until retkeypressed;
-
- __betwscn(x1, x2, y1, panel_b, panel_f, ' ' +
- __slashfil(
- __packfil(
- __cvtstr(
- __xlatestr(__backrem(_doscurpath), '.', ' '),
- _rem_white_str
- ),
- x2-x1-1-2
- )
- ) +
- ' '
- );
-
- retkey := key; tagbar(filescursor, curactbar_f, curactbar_b);
- if key = ar(returnkeys)^[2] then
- walk_files_ := filarray^[filoff + filescursor].name else
- walk_files_ := #0;
- end; { walk_files_ }
-
-
-
-
-
- end. { unit }
-