home *** CD-ROM | disk | FTP | other *** search
- program MickeyMouseV1p1;
- {
- TSR utility, much in the same vein as DR and QD, except...
- 1) Full Mouse Control (almost)
- 2) Ease of use
- 3) ShareWare (but with no anoying screen)
- 4) Reliable (Not so with other versions)
-
- AUTHOR: Jovo J. Filipovich of "Jovosys Software Engineering"
- DATE History : Version 1.0 Started November 8, 1989
- -- Basic Operations done and screen manipulation
- done to the point where execute was to work
- Never Finished due to midstream modifications
- Version 1.1 Started November 13, 1989
- -- Screen Menu Modified, now easier to use.
- "Execute" mouse option implemented.
- "Scroll Up" and "Scroll Down" bars were enlarged
- so mouse need not be in a particular row.
- Options for printing (port/Page length) were moved
- to "Print" (Right Button). Right Button on mouse
- now pulls up an option window on certain commands.
-
- }
-
- Uses Crt,Dos,Mouse,Unread,WritBox,InterWin;
-
- {$I MICKEY11.INC}
-
- CONST
- FILE_ROW_START = 5;
- FILE_ROW_END = 21;
- FILE_COL_START = 1;
- FILE_COL_END = 54;
- MAX_FILES_SHOW = 17;
- RMENU_SIZE = 17;
- RMENU : array [1..RMENU_SIZE] of StringVar = (
- '╔══════════╦═════════╗',
- '║ Home ║ End ║',
- '╠══════════╬═════════╣',
- '║ Copy ║ Move ║',
- '╠══════════╬═════════╣',
- '║ Delete ║ Rename ║',
- '╠══════════╬═════════╣',
- '║ Print ║ View ║',
- '╠══════════╬═════════╣',
- '║ Rem DIR ║Make DIR ║',
- '╠══════════╬═════════╣',
- '║ New Path ║Chg. Attr║',
- '╠══════════╬═════════╣',
- '║ Mark ALL ║ Execute ║',
- '╠══════════╬═════════╣',
- '║ EXIT ║ QUIT ║',
- '╚══════════╩═════════╝');
- SHRM_SIZE = 5;
- SHRM : array [1..SHRM_SIZE] of StringVar = (
- '┌────────────────────┐',
- '│Left = SELECT /LIN│',
- '│Right = UNSELECT/PG │',
- '│#891311MKYV110N00167│',
- '└────────────────────┘');
- SCRDN_SIZE = 3;
- SCRDN : array [1..SCRDN_SIZE] of StringVar = (
- '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░',
- '░░░░░░░░░░░░░░░░░░░░░ Scroll Down ░░░░░░░░░░░░░░░░░░░░░░',
- '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░');
- SCRUP_SIZE = 3;
- SCRUP : array [1..SCRUP_SIZE] of StringVar = (
- '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░',
- '░░░░░░░░░░░░░░░░░░░░░ Scroll Up ░░░░░░░░░░░░░░░░░░░░░░░░',
- '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░');
- OTHER_SIZE = 3;
- OTHER : array [1..OTHER_SIZE] of StringVar = (
- 'Marked Information -',
- ' Files:',
- ' Bytes:');
- LINF01 = 'DIR= ';
- LINF02 = ' Files';
- LINF03 = ' bytes free';
-
- TYPE
- FileType = (Normal,Dir,RdOnly,SysF,Arc); { Types of Files }
- FileLineRec = RECORD
- FileName : String[12]; { 11 Byte File Name with . }
- Filler_1 : String[3]; { Blank Portion }
- FileSize : String[8]; { Converted from numeric or <DIR> }
- Filler_2 : String[3]; { Spaces }
- FileDate : String[8]; { MM/DD/YY }
- Filler_3 : String[3]; { Spaces }
- FileTime : String[7]; { HH:MM[pm/am] }
- Filler_4 : String[2]; { Spaces }
- FileMark : String[1]; { a '*' or ' ' }
- Filler_5 : String[3]; { Spaces }
- FileAttr : String[4]; { HRSA or .... }
- Marked : Boolean; { True If marked }
- Dentry : Boolean; { True If Directory }
- Executable : Boolean; { True IF EXE or BAT or COM file }
- End;
- FileLineStruc = Array [1..256] Of FileLineRec;
- PieceStr = String[2]; { Used in conversions }
- Mcmd = (Home_View, End_View, Execute_File, Mark_All_Files,
- Exit_Mickey, Quit_Mickey, Copy_File, Move_File,
- Delete_File, Rename_File, New_Path, Chg_Attr,
- Print_File, View_File, Remove_Dir, Make_Dir,
- Scroll_Up, Scroll_Down, Select_File, No_Command);
-
-
- VAR
- BytesFree : LongInt; { Number of bytes free on current Drive }
- FileCount : Integer; { Total Count Of Files }
- WindowOffset : Integer; { Offset from first viewed file }
- CurrDir : StringVar; { Current Directory Path }
- TotalFilesMarked : Integer; { Number of marked Files }
- TotalBytesMarked : LongInt; { Number of bytes the marked files }
- Files : FileLineStruc;
- OriginalDir : StringVar; { Starting Directory on entry }
- Srow, Scol : Word;
- ExecutableName : StringVar; { Expected to be initialized upon EXEC }
- FinalCommand : Mcmd;
- Junk : Integer;
- OldTextAttr : Byte;
-
-
- Function NumToStr(Indx : BYTE) : PieceStr;
- Begin
- NumToStr := chr((Indx div 10) or $30) + chr((Indx mod 10) or $30);
- End;
-
-
- Procedure ShowScreen(VAR BytesFree,MarkedBytes:LongInt; VAR CurrDir:StringVar;
- VAR MarkedFiles : Integer);
- Procedure ShowMenus;
- Var CurrAttr : Byte;
- Begin { ShowMenus }
- ClrScr; { Clear the screen }
- CurrAttr := TextAttr;
- TextColor(LightGray);
- WriteBox(RMENU,RMENU_SIZE,1,58);
- TextColor(DarkGray);
- WriteBox(SHRM,SHRM_SIZE,21,58);
- TextColor(Red);
- WriteBox(OTHER,OTHER_SIZE,18,58);
- TextColor(Brown);
- WriteBox(SCRUP,SCRUP_SIZE,2,1);
- WriteBox(SCRDN,SCRDN_SIZE,22,1);
- TextAttr := CurrAttr;
- End; { ShowMenus }
-
- Begin { ShowScreen }
- BytesFree := DiskFree(0); { Get the Bytes free of current drive }
- GetDir(0,CurrDir); { Get the Current Directory }
- MarkedFiles := 0;
- MarkedBytes := 0;
- ShowMenus;
- GotoXY(1,1); Write(LINF01); Write(CurrDir); { Show Current Directory }
- GotoXY(66,19); Write(MarkedFiles:14); { Show Number of Marked Files }
- GotoXY(66,20); Write(MarkedBytes:14); { Show The Number of marked Bytes }
- GotoXY(28,25); Write(BytesFree:10,LINF03);{ Show Number of bytes available}
- End; { ShowScreen }
-
-
-
- Procedure BuildFileList(Path : StringVar; VAR FileList : FileLineStruc;
- VAR FileCount : Integer);
- Var
- Srec : SearchRec; { Seach Record }
- Dtrec : DateTime; { Date/Time record }
- Attr : Word;
- Indx,I2,I3 : Integer;
- Ppos,ToFill : Word;
- YrS : PieceStr;
- Ext : StringVar; { Used to see extention }
-
-
- Begin
- For Indx := 1 to 256 do
- With FileList[Indx] do
- begin
- FileName := ' '; Filler_1 := ' ';
- FileSize := '';
- Filler_2 := ' '; FileDate := '00-00-00';
- Filler_3 := ' '; FileTime := '00:00pm'; Filler_4 := ' ';
- FileMark := ' '; Filler_5 := ' '; FileAttr := '....';
- Marked := False; Dentry := False; Executable := False;
- end; { With/FOR }
- Indx := 0;
- Attr := AnyFile; { $3f }
- If (Path[Length(Path)] <> '\')
- Then Path := Path + '\*.*'
- Else Path := Path + '*.*';
- FindFirst(Path,Attr,Srec);
- While DosError = 0 do
- begin
- Inc(Indx);
- If ((Srec.Attr AND VolumeID) <> VolumeID) THEN
- With Srec do
- begin
- If (Name <> '.') AND
- (Name <> '..') AND
- ((Attr AND Directory) <> Directory) AND
- ((Attr AND VolumeID) <> VolumeID)
- Then begin
- Ppos := Pos('.',Name);
- FileList[Indx].FileName[9] := '.';
- If (Ppos > 0) { Ckeck for period }
- then begin
- For I2 := 1 to Ppos-1 do
- FileList[Indx].FileName[I2] := Name[I2];
- I3 := 10;
- For I2 := Ppos+1 to Length(Name) do
- begin
- FileList[Indx].FileName[I3] := Name[I2];
- Inc(I3);
- end;
- Ext := '';
- Ext := Copy(Name,Ppos+1,Length(Name)-Ppos);
- If (Ext = 'EXE') OR (Ext = 'COM') or (Ext = 'BAT')
- Then FileList[Indx].Executable := TRUE;
- end
- else For I2 := 1 to Length(Name) { No extention }
- do FileList[Indx].FileName[I2] := Name[I2];
- Str(Size:8,FileList[Indx].FileSize);
- end
- Else begin
- For I2 := 1 to Length(Name) do
- FileList[Indx].FileName[I2] := Name[I2];
- FileList[Indx].FileSize := ' <DIR>';
- FileList[Indx].Dentry := TRUE;
- end; { Else }
- If ((Attr AND Hidden) = Hidden) Then FileList[Indx].FileAttr[1] := 'H';
- If ((Attr AND ReadOnly) = ReadOnly) Then FileList[Indx].FileAttr[2] := 'R';
- If ((Attr AND SysFile) = SysFile) Then FileList[Indx].FileAttr[3] := 'S';
- If ((Attr AND Archive) = Archive) Then FileList[Indx].FileAttr[4] := 'A';
- UnpackTime(Time,DtRec); { Unpack the passed time of file }
- DtRec.Year := DtRec.Year - 1900;
- Str(DtRec.Year,YrS);
- FileList[Indx].FileDate := NumToStr(DtRec.Month) + '-' +
- NumToStr(DtRec.Day) + '-' +
- Yrs;
- YrS := ''; { For Next Section }
- If DtRec.Hour >= 12
- Then begin
- YrS := 'pm'; { Set this to Pm }
- If DtRec.Hour > 12 Then DtRec.Hour := DtRec.Hour - 12;
- end { Then }
- Else begin
- YrS := 'am';
- If DtRec.Hour = 0 Then DtRec.Hour := DtRec.Hour + 12;
- end; { Else and If }
- FileList[Indx].FileTime := NumToStr(DtRec.Hour) + ':' +
- NumToStr(DtRec.Min) + YrS;
- End { With }
- Else Dec(Indx); { Skip Volume ID }
- FindNext(Srec);
- end; { while }
- FileCount := Indx;
- End; { Build File List }
-
-
-
- Procedure ShowFiles(VAR Files:FileLineStruc; Start, FileCount:Integer;
- StartRow, StartCol : Integer);
- Var
- CurrRow,CurrCol,Indx : Integer;
- Begin
- CurrRow := StartRow; CurrCol := StartCol;
- Indx := Start;
- While (CurrRow <= FILE_ROW_END) AND (Indx <= FileCount) do
- begin
- GotoXY(CurrCol,CurrRow);
- With Files[Indx] do
- Write(FileName,Filler_1,FileSize,Filler_2,
- FileDate,Filler_3,FileTime,Filler_4,
- FileMark,Filler_5,FileAttr);
- Inc(Indx);
- Inc(CurrRow);
- end;
- GotoXY(15,25);
- Write(FileCount:4,' Files');
- WindowOffset := Start - 1;
- end;
-
-
-
- Function UserCommand(Row,Col : Word) : Mcmd;
- { Returns the command at given location }
- Begin
- Case Col of
- 1..56 : Case Row of
- FILE_ROW_START..FILE_ROW_END : UserCommand := Select_File;
- 2..4 : UserCommand := Scroll_Up;
- 22..24 : UserCommand := Scroll_Down;
- else UserCommand := No_Command;
- end; { case row }
- 59..68 : Case Row of
- 2 : UserCommand := Home_View;
- 4 : UserCommand := Copy_File;
- 6 : UserCommand := Delete_File;
- 8 : UserCommand := Print_File;
- 10 : UserCommand := Remove_Dir;
- 12 : UserCommand := New_Path;
- 14 : UserCommand := Mark_All_Files;
- 16 : UserCommand := Exit_Mickey;
- else UserCommand := No_Command;
- end; { Case Row }
- 70..78 : Case Row Of
- 2 : UserCommand := End_View;
- 4 : UserCommand := Move_File;
- 6 : UserCommand := Rename_File;
- 8 : UserCommand := View_File;
- 10 : UserCommand := Make_Dir;
- 12 : UserCommand := Chg_Attr;
- 14 : UserCommand := Execute_File;
- 16 : UserCommand := Quit_Mickey;
- else UserCommand := No_Command;
- end; { Case Row }
- Else UserCommand := No_Command;
- End; { Case }
- End; { UserCommand }
-
-
- Procedure QualifyCommand(VAR Cmd : Mcmd; Row : Word;
- VAR Reason : StringVar);
- { Note return of index only when applicable (files)
- There are certain conditions that must be met with certain commands
- This Procedure Does Not Execute the commands, simply checks conditions }
- Var Temp : Integer;
-
- Begin
- Reason := 'Invalid Selection Area';
- Case Cmd of
- Copy_File, Move_File, Delete_File,
- Chg_Attr, Print_File
- : If (TotalFilesMarked < 1)
- Then Begin
- Cmd := No_Command; { At least one file }
- Reason := 'At lease one file must be marked';
- end;
- Rename_File, View_File
- : If (TotalFilesMarked <> 1)
- Then Begin
- Cmd := No_Command; { ONLY one file }
- Reason := 'Only one marked file allowed';
- end;
- Select_File : If (Files[Row-FILE_ROW_START+WindowOffset+1].FileName[1]
- = ' ') { Blank }
- Then begin
- Cmd := No_Command;
- Reason := 'No file located there';
- end;
- Execute_File : If (TotalFilesMarked <> 1)
- Then begin
- Cmd := No_Command; { Must be executable }
- Reason := 'Requires one file for execution';
- end
- Else begin
- Temp := 1;
- While NOT Files[Temp].Marked do Inc(Temp);
- If NOT Files[Temp].Executable
- Then begin
- Cmd := No_Command;
- Reason := 'File marked is not executable';
- end;
- end;
- end; { Case }
- End;
-
-
- Procedure FwindowScroll(Direction : Integer);
- { +1 = File names up -- make room for new file name at bottom
- -1 = File names down -- make room at top for new file }
- Var
- RegPack : Registers;
- Begin
- RegPack.BX := $0700; { Screen Attribute }
- RegPack.CX := (FILE_ROW_START-1) * 256 + 0; { Upper Row/ Left Column }
- RegPack.DX := (FILE_ROW_END-1) * 256 + FILE_COL_END-1; { LRC }
- If (Direction > 0)
- Then RegPack.AX := $0601
- Else RegPack.AX := $0701;
- Intr($10,RegPack); { Call The BIOS routine to do it }
- End; { FwindowScroll }
-
-
- Function UnParse(E : StringVar) : StringVar;
- { Turns 'HELLO .PAS' into 'HELLO.PAS' }
- Var
- Indx,Junk : Byte;
- Temp : StringVar;
- Begin
- Indx := Pos(' ',E); { Find This }
- If (Indx > 8) OR (Indx = 0)
- then Unparse := Copy(E,1,Length(E)) { The full name filled }
- else if (E[10] = ' ')
- then Unparse := Copy(E,1,Indx-1) { No extension }
- else begin
- Temp := Copy(E,9,4); { Get the extention with '.' }
- Junk := Pos(' ',Temp);
- If (Junk = 0) Then Junk := 5;
- UnParse := Copy(E,1,Indx-1) + Copy(Temp,1,Junk-1);
- end;
- End; { Unparse }
-
-
-
- Procedure ExecuteCmd(Cmd : Mcmd; Row,Col : Word; ButtonPress : MouseButtons);
- Var
- OldRow, OldCol : Word;
- Indx,Junk,Junk2: Integer;
- Nbytes : LongInt;
- DirExtract : StringVar;
- JunkFile : file; { any type of file }
- Begin
- OldRow := Row;
- OldCol := Col;
- Case Cmd of
- Delete_File :
- begin
- If (YnErrorWindow('Delete All Marked Files?'))
- then begin
- Junk := TotalFilesMarked;
- Indx := 1;
- While (Junk <> 0) do
- begin
- While (Not (Files[Indx].Marked)) do Inc(Indx);
- DirExtract := UnParse(Files[Indx].FileName); { Do this }
- Assign(JunkFile,DirExtract);
- Erase(JunkFile);
- Dec(Junk);
- Inc(Indx);
- end;
- ShowScreen(BytesFree,TotalBytesMarked,CurrDir,TotalFilesMarked);
- BuildFileList(CurrDir,Files,FileCount); { Remake }
- ShowFiles(Files,1,FileCount,FILE_ROW_START,FILE_COL_START);
- end;
- end;
- Select_File :
- begin
- Indx := Row - FILE_ROW_START + WindowOffset + 1; { Make File Index }
- If (Files[Indx].Dentry) AND (ButtonPress = RightPressed)
- { If it is a directory, switch screen }
- Then begin
- TotalFilesMarked := 0;
- TotalBytesMarked := 0; {Reset}
- Junk := Pos(' ',Files[Indx].FileName); { Find Space }
- DirExtract := Copy(Files[Indx].FileName,1,Junk-1);
- ChDir(DirExtract); { Change it }
- ShowScreen(BytesFree,TotalBytesMarked,CurrDir,TotalFilesMarked);
- BuildFileList(CurrDir,Files,FileCount); { Remake }
- ShowFiles(Files,1,FileCount,FILE_ROW_START,FILE_COL_START);
- end;
- If (ButtonPress = LeftPressed)
- Then begin { Mark an unmarked file }
- If NOT(Files[Indx].Marked OR Files[Indx].Dentry)
- then begin
- Files[Indx].FileMark := '*'; { Mark it }
- GotoXY(47,Row); Write('*');
- Files[Indx].Marked := TRUE;
- Inc(TotalFilesMarked);
- Val(Files[Indx].FileSize,Nbytes,Junk);
- Inc(TotalBytesMarked,Nbytes);
- end;
- end
- Else begin { Unmark a marked file }
- If (Files[Indx].Marked) AND (NOT Files[Indx].Dentry)
- then begin
- Files[Indx].FileMark := ' '; { Unmark it }
- GotoXY(47,Row); Write(' ');
- Files[Indx].Marked := FALSE;
- Dec(TotalFilesMarked);
- Val(Files[Indx].FileSize,Nbytes,Junk);
- Dec(TotalBytesMarked,Nbytes);
- end;
- End; { else }
- end; { Select_File }
- Scroll_Up : { Left Button = Scroll 1 up, Right Button = Scroll Page Up }
- begin
- If (WindowOffset > 0) { If it is 0, then no scrolling required }
- then case ButtonPress of
- LeftPressed :
- begin
- FwindowScroll(-1);{Scroll the Files window down actual }
- Dec(WindowOffset);
- GotoXY(FILE_COL_START,FILE_ROW_START);
- Indx := WindowOffset + 1;
- With Files[Indx] do
- Write(FileName,Filler_1,FileSize,Filler_2,
- FileDate,Filler_3,FileTime,Filler_4,
- FileMark,Filler_5,FileAttr);
- GotoXY(OldCol,OldRow);
- end; { Case Left Pressed }
- RightPressed :
- begin { Simply sroll up X number of times }
- For Indx := 1 to MAX_FILES_SHOW-1 do
- ExecuteCmd(Scroll_Up,Row,Col,LeftPressed);
- end;
- end; { Case -- If then }
- end; { Case Scroll Up }
- Scroll_Down :
- begin
- If ((WindowOffset+MAX_FILES_SHOW) < FileCount)
- { Max Number of files display }
- then Case ButtonPress of
- LeftPressed :
- begin
- FwindowScroll(1);
- Inc(WindowOffset);
- GotoXY(FILE_COL_START,FILE_ROW_END);
- Indx := WindowOffset + MAX_FILES_SHOW;
- With Files[Indx] do
- Write(FileName,Filler_1,FileSize,Filler_2,
- FileDate,Filler_3,FileTime,Filler_4,
- FileMark,Filler_5,FileAttr);
- GotoXY(OldCol,OldRow);
- end;
- RightPressed : { Page down }
- begin
- For Indx := 1 to MAX_FILES_SHOW-1 do
- ExecuteCmd(Scroll_Down,Row,Col,LeftPressed);
- end;
- end; { If - Then case }
- end; { Scroll_Down }
- Mark_All_Files :
- begin
- If ButtonPress = LeftPressed { Mark all the files }
- then begin
- For Indx := 1 to FileCount do
- If NOT (Files[Indx].Dentry or Files[Indx].Marked)
- { If Not A directory }
- then begin
- Files[Indx].Marked := TRUE;
- Files[Indx].FileMark := '*';
- Inc(TotalFilesMarked);
- Val(Files[Indx].FileSize,Nbytes,Junk);
- Inc(TotalBytesMarked,Nbytes);
- end;
- end
- else begin { Unmark all files }
- For Indx := 1 to FileCount do
- If (NOT Files[Indx].Dentry) AND (Files[Indx].Marked)
- { If Not A directory and is marked }
- then begin
- Files[Indx].Marked := FALSE;
- Files[Indx].FileMark := ' ';
- Dec(TotalFilesMarked);
- Val(Files[Indx].FileSize,Nbytes,Junk);
- Dec(TotalBytesMarked,Nbytes);
- end;
- end;
- ShowFiles(Files,1,FileCount,FILE_ROW_START,FILE_COL_START);
- end; { Mark all files }
- Execute_File :
- begin
- Junk := 1; { First, Find the 1 marked file for execution }
- While NOT Files[Junk].Marked do Inc(Junk); { it IS there }
- Indx := Pos(' ',Files[Junk].FileName);
- If (Indx > 8) OR (Indx = 0) Then Indx := 9; { 12 byte executables }
- ExecutableName := '';
- ExecutableName := Copy(Files[Junk].FileName,1,Indx-1);
- End; { Execute File }
- Home_View : ShowFiles(Files,1,FileCount,FILE_ROW_START,FILE_COL_START);
- End_View :
- begin
- Indx := FileCount - MAX_FILES_SHOW + 1;
- If Indx > 0
- then ShowFiles(Files,Indx,FileCount,FILE_ROW_START,FILE_COL_START);
- end;
- end; { Case }
- GotoXY(66,19); Write(TotalFilesMarked:14);
- GotoXY(66,20); Write(TotalBytesMarked:14);
- GotoXY(OldCol,OldRow);
- End; { ExecuteCmd }
-
-
-
-
- Procedure LiteCommand(MouseRow,MouseCol : Word;
- Var NewArea, OldArea : Mcmd);
- Var
- OldRow, OldCol : Word; { Set by case to unhighlight old area }
- NewRow, NewCol : Word; { START of field to highlighted -- NOT CURR ROW/COL!!}
- OldTit, NewTit : StringVar; { Strings at those locations }
- NormColor,InvColor,EntC : Word; { Colors }
-
-
- Procedure GetAreaCoords(Area : Mcmd;
- Var Row,Col : Word;
- Var Tit : StringVar;
- Var NormC, InvC : Word);
- { Returns corresponding row, col for area START!!!! and string name }
- Begin
- Case Area of
- Home_View : begin Row :=02; Col :=59; Tit := ' Home '; end;
- End_View : begin Row :=02; Col :=70; Tit := ' End ' ; end;
- Execute_File : begin Row :=14; Col :=70; Tit := ' Execute ' ; end;
- Mark_All_Files : begin Row :=14; Col :=59; Tit := ' Mark ALL '; end;
- Exit_Mickey : begin Row :=16; Col :=59; Tit := ' EXIT '; end;
- Quit_Mickey : begin Row :=16; Col :=70; Tit := ' QUIT ' ; end;
- Copy_File : begin Row :=04; Col :=59; Tit := ' Copy '; end;
- Move_File : begin Row :=04; Col :=70; Tit := ' Move ' ; end;
- Delete_File : begin Row :=06; Col :=59; Tit := ' Delete '; end;
- Rename_File : begin Row :=06; Col :=70; Tit := ' Rename ' ; end;
- New_Path : begin Row :=12; Col :=59; Tit := ' New Path '; end;
- Chg_Attr : begin Row :=12; Col :=70; Tit := 'Chg. Attr' ; end;
- Print_File : begin Row :=08; Col :=59; Tit := ' Print '; end;
- View_File : begin Row :=08; Col :=70; Tit := ' View ' ; end;
- Remove_Dir : begin Row :=10; Col :=59; Tit := ' Rem DIR '; end;
- Make_Dir : begin Row :=10; Col :=70; Tit := 'Make DIR ' ; end;
- else begin Row := 0; Col := 0; Tit := ''; end;
- End; { Case }
- NormC := LightGray;
- InvC := Green * 16 + Black;
- End; { GetAreaCoords }
-
-
- Begin
- EntC := TextAttr;
- If (OldArea <> NewArea) { Only if change of area, then change lite }
- then If (NewArea <> No_Command) and
- (NewArea <> Scroll_Up) and
- (NewArea <> Scroll_Down) and
- (NewArea <> Select_File)
- then begin
- GetAreaCoords(NewArea,NewRow,NewCol,NewTit,NormColor,InvColor); { get }
- GetAreaCoords(OldArea,OldRow,OldCol,OldTit,NormColor,InvColor); { Get }
- GotoXY(OldCol,OldRow);
- TextAttr := NormColor;
- Write(OldTit);
- GotoXY(NewCol,NewRow);
- TextAttr := InvColor;
- Write(NewTit);
- OldArea := NewArea;
- end
- else begin { Fail on if means moved out of menu into covered area }
- GetAreaCoords(OldArea,OldRow,OldCol,OldTit,NormColor,InvColor); { Grab }
- GotoXY(OldCol,OldRow);
- TextAttr := NormColor;
- Write(OldTit);
- OldArea := NewArea;
- end;
- GotoXY(MouseCol,MouseRow);
- TextAttr := EntC;
- End; { Lite }
-
-
-
- Procedure MouseFunc(Var LastCmd : Mcmd); { Interface for mouse }
- Var
- MouseRow, MouseCol : Word;
- Indx,PrevIndx : Integer;
- MouseBpress : MouseButtons;{(NonePressed,LeftPressed,RightPressed)}
- UsrCmd : Mcmd; { User Commanded through mouse }
- OldHighlight,
- NewHighlight : Mcmd; { Use commands to 'know' where we are on scr }
- OldColor, InvColor : Byte; { Old Text Color and InvColor }
- Reason : StringVar;
-
- Begin
- OldColor := TextAttr; { Save screen's text attribute here }
- InvColor := Brown * 16 + White; { This here }
- PrevIndx := 0; { Set this for this }
- OldHighlight := No_Command;
- NewHighlight := No_Command;
- ShowMouseCursor; { Start off Here }
- MouseBpress := GetMouseButtonStatus; { Flush any pending presses }
- UsrCmd := No_Command;
- While (UsrCmd <> Exit_Mickey) AND
- (UsrCmd <> Quit_Mickey) AND
- (UsrCmd <> Execute_File) do
- begin
- MouseBpress := NonePressed; { Flush and negate old invalid presses }
- While (MouseBpress = NonePressed) { Retrieve next }
- do begin
- GetTextMouseLocation(MouseRow,MouseCol); { Get it }
- Indx := Integer(MouseRow) - FILE_ROW_START + WindowOffset + 1;
- If (MouseRow in [FILE_ROW_START..FILE_ROW_END]) and
- (MouseCol in [FILE_COL_START..FILE_COL_END]) and
- (Files[Indx].FileName[1] <> ' ')
- then begin { Highlight the Current File Line }
- If (Indx <> PrevIndx)
- then begin
- If (PrevIndx <> 0) { Moved from last file }
- then begin
- TextAttr := OldColor; { Set to... }
- GotoXY(1,PrevIndx+FILE_ROW_START-WindowOffset-1);
- With Files[PrevIndx] do
- Write(FileName,Filler_1,FileSize,Filler_2,
- FileDate,Filler_3,FileTime,Filler_4,
- FileMark,Filler_5,FileAttr);
- end;
- GotoXY(1,MouseRow);
- TextAttr := InvColor; { Highlight }
- With Files[Indx] do
- Write(FileName,Filler_1,FileSize,Filler_2,
- FileDate,Filler_3,FileTime,Filler_4,
- FileMark,Filler_5,FileAttr);
- GotoXY(MouseCol,MouseRow); { Reset }
- PrevIndx := Indx; { Save Old Indx }
- end;
- end
- Else begin { Now, out of text area, check if we were there }
- If (PrevIndx <> 0)
- then begin
- TextAttr := OldColor; { Set to... }
- GotoXY(1,PrevIndx+FILE_ROW_START-WindowOffset-1);
- With Files[PrevIndx] do
- Write(FileName,Filler_1,FileSize,Filler_2,
- FileDate,Filler_3,FileTime,Filler_4,
- FileMark,Filler_5,FileAttr);
- GotoXY(MouseCol,MouseRow);
- PrevIndx := 0;
- end;
- NewHighlight := UserCommand(MouseRow,MouseCol);
- LiteCommand(MouseRow,MouseCol,NewHighlight,OldHighlight);
- end;
- MouseBpress := GetMouseButtonStatus;
- end;
- TextAttr := OldColor;
- GetTextMouseLocation(MouseRow,MouseCol); { Get it }
- UsrCmd := UserCommand(MouseRow,MouseCol); { Get the command sequence }
- QualifyCommand(UsrCmd,MouseRow,Reason);
- If (UsrCmd = No_Command)
- Then begin
- sound(440);
- Delay(4);
- NoSound;
- NiErrorWindow(Reason);
- end
- Else ExecuteCmd(UsrCmd,MouseRow,MouseCol,MouseBpress);
- end; { Bif Valid While }
- LastCmd := UsrCmd;
- End; { MouseFunc }
-
-
- BEGIN { Mickey -- main }
- DirectVideo := True;
- OldTextAttr := TextAttr;
- TextColor(Cyan);
- Srow := WhereY; Scol := WhereX;
- GetDir(0,OriginalDir);
- ShowScreen(BytesFree,TotalBytesMarked,CurrDir,TotalFilesMarked);
- BuildFileList(CurrDir,Files,FileCount);
- ShowFiles(Files,1,FileCount,FILE_ROW_START,FILE_COL_START);
- MouseFunc(FinalCommand);
- HideMouseCursor;
- If (FinalCommand = Quit_Mickey) then ChDir(OriginalDir);
- If (FinalCommand = Execute_File)
- then begin
- For Junk := 1 to Length(ExecutableName)
- do UnreadChar(ExecutableName[Junk]); { Exctract and push chars }
- UnreadChar(chr(13)); { And A CR }
- end;
- TextAttr := OldTextAttr;
- ClrScr;
- END.