-
Notifications
You must be signed in to change notification settings - Fork 3
/
DOSSHELL.PAS
1579 lines (1501 loc) · 32.5 KB
/
DOSSHELL.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{ @author: Sylvain Maltais (support@gladir.com)
@created: 2022
@website(https://www.gladir.com/msdos0)
@abstract(Target: Turbo Pascal, Free Pascal)
}
Program DOSSHELL;
{$M 8192,0,65536}
Uses Crt,DOS;
Const
MainMenu:Array[0..4]of String[10]=(
'Fichier','Options','Affichage','Arbre','Aide'
);
MainMenuEnglish:Array[0..4]of String[10]=(
'File','Options','View','Tree','Help'
);
MainMenuGermany:Array[0..4]of String[12]=(
'Datei','Optionen','Anzeige','Verzeichnis','Hilfe'
);
SubMenuFile:Array[0..18]of String[25]=(
'Ouvrir',
'Ex‚cuter...',
'Imprimer',
'Associer...',
'Rechercher...',
'Afficher le contenu',
'',
'D‚placer...',
'Copier...',
'Supprimer...',
'Renommer...',
'Change les attributs...',
'',
'Cr‚er un r‚pertoire...',
'',
'S‚lectionner tout',
'D‚selectionner tout',
'',
'Quitter'
);
SubMenuFileEnglish:Array[0..18]of String[20]=(
'Open',
'Run...',
'Print',
'Associate...',
'Search...',
'View File Contents',
'',
'Move...',
'Copy...',
'Delete...',
'Rename...',
'Change Attributes...',
'',
'Create Directory...',
'',
'Select All',
'Deselect All',
'',
'Exit'
);
SubMenuFileGermany:Array[0..18]of String[20]=(
'™ffnen',
'Ausfhren...',
'Drucken',
'Verknpfen...',
'Suchen...',
'Dateiinhalt anzeigen',
'',
'Verschieben...',
'Kopieren...',
'L”schen...',
'Umbenennen...',
'Attribute „ndern...',
'',
'Verzeichnis erstellen...',
'',
'Alles ausw„hlen',
'Auswahl aufheben',
'',
'Beenden'
);
SubMenuOptions:Array[0..6]of String[40]=(
'Confirmation...',
'Options d''affichage des fichiers...',
'S‚lectionner dans tous les r‚pertoires',
'Renseignements...',
'Activer la commutation de tƒches',
'Ecran...',
'Couleurs...'
);
SubMenuOptionsEnglish:Array[0..6]of String[20]=(
'Confirmation...',
'File Display Options...',
'Select Across Directories',
'Show Information...',
'Enable Task Swapper',
'Display...',
'Colors...'
);
SubMenuOptionsGermany:Array[0..6]of String[35]=(
'Best„tigen...',
'Dateianzeige...',
'Aus mehreren Verzeichnissen ausw„hlen',
'Informationen anzeigen...',
'Programmumschaltung aktivieren',
'Anzeigemodus...',
'Farbschema...'
);
SubMenuView:Array[0..7]of String[30]=(
'Liste simple',
'Listes multiples',
'Tous les fichiers',
'Listes programmes/fichiers',
'Liste programmes',
'',
'Actualiser l''‚cran',
'Actualiser'
);
SubMenuViewEnglish:Array[0..7]of String[20]=(
'Single File List',
'Dual File Lists',
'All Files',
'Program/File Lists',
'Program List',
'',
'Repaint Screen',
'Refresh'
);
SubMenuViewGermany:Array[0..7]of String[25]=(
'Einfache Dateiliste',
'Zweifache Dateiliste',
'Nur Dateien',
'Programme und Dateien',
'Nur Programme',
'',
'Anzeige neu aufbauen',
'Aktualisieren'
);
SubMenuTree:Array[0..3]of String[25]=(
'D‚velopper un niveau',
'D‚velopper une branche',
'D‚velopper tout',
'R‚duire une branche'
);
SubMenuTreeEnglish:Array[0..3]of String[20]=(
'Expand One Level',
'Expand Branch',
'Expand All',
'Collapse Branch'
);
SubMenuTreeGermany:Array[0..3]of String[20]=(
'N„chste Ebene einblenden',
'Zweig einblenden',
'Alle Ebenen einblenden',
'Zweig ausblenden'
);
SubMenuHelp:Array[0..7]of String[20]=(
'Index',
'Clavier',
'Notions fondamentales',
'Commandes',
'Proc‚dures',
'Utiliser l''aide',
'',
'A propos du Shell'
);
SubMenuHelpEnglish:Array[0..7]of String[20]=(
'Index',
'Keyboard',
'Shell Basics',
'Commands',
'Procedures',
'Using Help',
'',
'About Shell'
);
SubMenuHelpGermany:Array[0..7]of String[20]=(
'Index',
'Tastatur',
'Grundlagen',
'Befehle',
'Verfahren',
'Hilfe verwenden',
'',
'Info ber Shell'
);
YMenuMax:Array[1..5]of Byte=(
High(SubMenuFile),High(SubMenuOptions),High(SubMenuView),
High(SubMenuTree),High(SubMenuHelp)
);
MaxFiles=511;
FileYMax=7;
Type
ProgramRec=Record
Command:String;
Title:String[38];
Help:String;
Pause,Group:Boolean;
Next:Pointer;
End;
PProgramRec=^ProgramRec;
StrName=String[12];
Var
Language:(_French,_English,_Germany,_Italian,_Spain);
TmpLanguage:String;
YMenu,XMenu:Integer;
FilePos,MenuPos:Integer;
MenuYMax:Byte;
CurrZone,FileY,MenuY:Byte;
ShowASCII128,OnMenu:Boolean;
FileManager:Boolean;
ProgramList:PProgramRec;
ProgramCount:Integer;
Nom:Array[0..MaxFiles] of StrName;
Temps:Array[0..MaxFiles] of LongInt;
Taille:Array[0..MaxFiles] of LongInt;
Attribt:Array[0..MaxFiles] of Byte;
Accepte:Array[0..MaxFiles] of 0..1;
NombreFichierX:0..MaxFiles;
TypeTri:0..4;
{$IFNDEF FPC}
Procedure CursorOff;
Var
Regs:Registers;
Begin
Regs.AH:=1;
Regs.CH:=32;
Regs.CL:=0;
Intr($10,Regs);
End;
Procedure CursorOn;
Var
Regs:Registers;
Begin
Regs.AX:=$0100;
Regs.CX:=(7 shl 8)+9;
Intr($10,Regs);
End;
{$ENDIF}
Function StrToUpper(S:String):String;
Var
I:Byte;
Begin
For I:=1 to Length(S)do Begin
If S[I] in['a'..'z']Then S[I]:=Chr(Ord(S[I])-32);
End;
StrToUpper:=S;
End;
Function PadRight(S:String;Space:Byte):String;
Var
I:Byte;
Begin
If Length(S)<Space Then For I:=Length(S)+1 to Space do S:=S+' ';
PadRight:=S;
End;
Function PadZeroLeft(Value:Integer;Space:Byte):String;
Var
S:String;
Begin
Str(Value,S);
While Length(S)<Space do S:='0'+S;
PadZeroLeft:=S;
End;
Function DuplicateString(C:Char;Num:Integer):String;
Var
I:Byte;
S:String;
Begin
S:='';
For I:=1 to Num do S:=S+C;
DuplicateString:=S;
End;
Function TrimL(S:String):String;
Var
I:Byte;
Begin
For I:=1to Length(S)do Begin
If S[I]<>' 'Then Begin
TrimL:=Copy(S,I,255);
Exit;
End;
End;
TrimL:=S;
End;
Function TrimR(s:String):String;
Var
i:Integer;
Begin
i:=Length(s);
While (i>0)and(s[i]in[#9,' '])do Dec(i);
s[0]:=Chr(i);
TrimR:=S;
End;
Function Trim(S:String):String;Begin
Trim:=TrimL(TrimR(S));
End;
Function GetCurrentDisk:Char;
Var
CurrentDir:String;
Begin
GetDir(0,CurrentDir);
GetCurrentDisk:=CurrentDir[1];
End;
Procedure Box(X1,Y1,X2,Y2,Couleur:Byte);Begin
Window(X1,Y1,X2,Y2);
TextBackground((Couleur shr 4)and 15);
If Couleur and $80=$80 Then Begin
TextColor((Couleur and 15)+BLINK);
End
Else
TextColor(Couleur and 15);
ClrScr;
Window(1,1,80,25);
End;
Procedure FrameEmpty(X1,Y1,X2,Y2,Couleur:Byte);
Var
I:Byte;
ChrHori,ChrVert:Char;
Chr218,Chr192,Chr191,Chr217:Char;
Begin
TextBackground((Couleur shr 4)and 15);
If Couleur and $80=$80 Then Begin
TextColor((Couleur and 15)+BLINK);
End
Else
TextColor(Couleur and 15);
If(ShowASCII128)Then Begin
ChrHori:='-';
ChrVert:='|';
Chr218:='+';
Chr192:='+';
Chr191:='+';
Chr217:='+';
End
Else
Begin
ChrHori:=#$C4;
ChrVert:=#$B3;
Chr218:=#218;
Chr192:=#192;
Chr191:=#191;
Chr217:=#217;
End;
For I:=Y1+1 to Y2-1 do Begin
GotoXY(X1,I);
Write(ChrVert);
GotoXY(X2,I);
Write(ChrVert);
End;
GotoXY(X1+1,Y1);
Write(DuplicateString(ChrHori,X2-X1-1));
GotoXY(X1+1,Y2);
Write(DuplicateString(ChrHori,X2-X1-1));
GotoXY(X1,Y1);
Write(Chr218);
GotoXY(X1,Y2);
Write(Chr192);
GotoXY(X2,Y1);
Write(Chr191);
GotoxY(X2,Y2);
Write(Chr217);
End;
Function AddProgramList:Pointer;
Var
P:PProgramRec;
CurrProgram:PProgramRec;
Begin
AddProgramList:=NIL;
GetMem(P,SizeOf(ProgramRec));
If P<>NIL Then Begin
If(ProgramList=NIL)Then ProgramList:=P
Else
Begin
CurrProgram:=ProgramList;
While CurrProgram^.Next<>NIL do CurrProgram:=CurrProgram^.Next;
If CurrProgram^.Next=NIL Then Begin
CurrProgram^.Next:=P;
End;
End;
Inc(ProgramCount);
AddProgramList:=P;
End;
End;
Procedure LoadDosShellIni;
Var
CurrSection:(_None,_SaveState,_ProgramStarter);
FileIni:Text;
InProgram:Boolean;
OpenAccol,Group:Integer;
CurrLine,CurrWord,ResultValue:String;
I:Integer;
CurrProgram:ProgramRec;
CurrPProgram:PProgramRec;
Begin
{$I-}Assign(FileIni,'DOSSHELL.INI');
Reset(FileIni);{$I+}
If IoResult=0Then Begin
Group:=0;
OpenAccol:=0;
CurrSection:=_None;
InProgram:=False;
FillChar(CurrProgram,SizeOf(CurrProgram),0);
CurrProgram.Next:=NIL;
While Not EOF(FileIni)do Begin
ReadLn(FileIni,CurrLine);
CurrLine:=Trim(CurrLine);
If StrToUpper(CurrLine)='[SAVESTATE]'Then CurrSection:=_SaveState Else
If StrToUpper(CurrLine)='[PROGRAMSTARTER]'Then CurrSection:=_ProgramStarter Else
If Trim(CurrLine)='{'Then Inc(OpenAccol) Else
If Trim(CurrLine)='}'Then Begin
If InProgram Then Begin
CurrPProgram:=AddProgramList;
If CurrPProgram<>NIL Then Begin
Move(CurrProgram,CurrPProgram^,SizeOf(CurrProgram));
FillChar(CurrProgram,SizeOf(CurrProgram),0);
CurrProgram.Next:=NIL;
End;
InProgram:=False;
End
Else
If Group>0Then Dec(Group);
Dec(OpenAccol)
End
Else
Begin
CurrWord:='';
I:=1;
While(CurrLine[I]in['A'..'Z','a'..'z'])and(I<=Length(CurrLine))do Begin
CurrWord:=CurrWord+CurrLine[I];
Inc(I);
End;
While(CurrLine[I]in[' ',#9])and(I<=Length(CurrLine))do Inc(I);
If CurrLine[I]='='Then Begin
Inc(I);
While(CurrLine[I]in[' ',#9])and(I<=Length(CurrLine))do Inc(I);
ResultValue:=Copy(CurrLine,I,255);
If(CurrSection=_ProgramStarter)Then Begin
If(InProgram)Then Begin
If StrToUpper(CurrWord)='COMMAND'Then CurrProgram.Command:=ResultValue Else
If StrToUpper(CurrWord)='HELP'Then CurrProgram.Help:=ResultValue Else
If StrToUpper(CurrWord)='PAUSE'Then Begin
If StrToUpper(ResultValue)='ENABLED'Then CurrProgram.Pause:=True Else
If StrToUpper(ResultValue)='DISABLED'Then CurrProgram.Pause:=False;
End
Else
If StrToUpper(CurrWord)='TITLE'Then CurrProgram.Title:=ResultValue;
End
Else
If StrToUpper(CurrWord)='GROUP'Then Inc(Group) Else
If StrToUpper(CurrWord)='FILEMANAGER'Then Begin
If StrToUpper(ResultValue)='ENABLED'Then FileManager:=True Else
If StrToUpper(ResultValue)='DISABLED'Then FileManager:=False;
End
Else
If StrToUpper(CurrWord)='PROGRAM'Then InProgram:=True;
End;
End;
End;
End;
Close(FileIni);
End;
End;
Procedure ReadFiles(Chaine:PathStr;Attribut:Word);
Var
Compteur,Position:Word;
OK:Boolean;
Ecart,I,J,K,M:LongInt;
Sortie:Boolean;
X:String[12];
XTaille:LongInt;
XAttribt:Byte;
XSeconde:0..59;
XMinute:0..59;
XHeure:0..23;
XJour:1..31;
XMois:1..12;
XAnnees:Word;
Date_TimeB:DateTime;
Palette:SearchRec;
Directory:DirStr;
FileName:NameStr;
Extension:ExtStr;
Erreur:Integer;
Procedure SousTri;
Var
Date_Time:DateTime;
Begin
UnpackTime(Temps[I],Date_Time);
UnPackTime(Temps[M],Date_TimeB);
X := Nom[I];
XTaille := Taille[I];
XAttribt := Attribt[I];
XSeconde := Date_Time.Sec;
XMinute := Date_Time.Min;
XHeure := Date_Time.Hour;
XJour := Date_Time.Day;
XMois := Date_Time.Month;
XAnnees := Date_Time.Year;
Nom[I] := Nom[M];
Taille[I] := Taille[M];
Attribt[I] := Attribt[M];
Date_Time.Sec := Date_TimeB.Sec;
Date_Time.Min := Date_TimeB.Min;
Date_Time.Hour := Date_TimeB.Hour;
Date_Time.Day := Date_TimeB.Day;
Date_Time.Month := Date_TimeB.Month;
Date_Time.Year := Date_TimeB.Year;
Nom[M] := X;
Taille[M] := XTaille;
Attribt[M] := XAttribt;
Date_TimeB.Sec := XSeconde;
Date_TimeB.Min := XMinute;
Date_TimeB.Hour := XHeure;
Date_TimeB.Day := XJour;
Date_TimeB.Month:= XMois;
Date_TimeB.Year := XAnnees;
PackTime(Date_Time,Temps[I]);
PackTime(Date_TimeB,Temps[M]);
Dec(I,Ecart);
End;
Procedure SousInit;Begin
Ecart := Ecart div 2;
J := 1;
K := NombreFichierX - Ecart;
End;
Procedure TriNom;Begin
Ecart := NombreFichierX;
If(Ecart>3)Then
Repeat
SousInit;
Repeat
I := J;
Sortie := False;
Repeat
M := I + Ecart;
If Nom[I] > Nom[M] Then SousTri
Else Sortie := True;
Until (I<1) or (Sortie = True);
Inc(J);
Until J>K;
Until Ecart = 1;
End;
Procedure TriExtension;Begin
Ecart := NombreFichierX;
If(Ecart>3)Then
Repeat
SousInit;
Repeat
I := J;
Sortie := False;
Repeat
M := I + Ecart;
If(Copy(Nom[I],10,3)+Copy(Nom[I],1,8) >
Copy(Nom[M],10,3)+Copy(Nom[M],1,8))Then
SousTri Else Sortie := True;
Until (I<1) or (Sortie = True);
Inc(J);
Until J>K;
Until Ecart = 1;
End;
Procedure TriHeure;Begin
Ecart := NombreFichierX;
If(Ecart>3)Then
Repeat
SousInit;
Repeat
I := J;
Sortie := False;
Repeat
M := I + Ecart;
If(Temps[I]>Temps[M])Then
SousTri
Else
Sortie := True;
Until (I<1) or (Sortie = True);
Inc(J);
Until J>K;
Until Ecart = 1;
End;
Procedure TriTaille;Begin
Ecart := NombreFichierX;
If(Ecart>3)Then
Repeat
SousInit;
Repeat
I := J;
Sortie := False;
Repeat
M := I + Ecart;
If Taille[I] > Taille[M] Then SousTri
Else Sortie := True;
Until (I<1) or (Sortie = True);
Inc(J);
Until J>K;
Until Ecart = 1;
End;
Begin
Position:=0;
FindFirst(Chaine,$FFF7,Palette);
Erreur:=DOSERROR;
While Erreur = 0 do Begin
If((Palette.Name<>'.')and(Erreur=0))and(Palette.Attr and 16=0)Then Begin
Accepte[Position] := 0;
Attribt[Position] := Palette.Attr and 22;
Temps[Position] := Palette.Time;
Taille[Position] := Palette.Size;
If Length(Palette.Name)>12Then Begin
Nom[Position] := Copy(Palette.Name,1,12);
End
Else
Nom[Position] := Palette.Name;
If(Attribt[Position]<>16)Then Begin
FSplit(Palette.Name,Directory,FileName,Extension);
Repeat
FileName := FileName + ' ';
Until (Length(FileName)>=8);
Nom[Position] := Filename + Extension;
End
else
If(Attribt[Position]=16)Then Begin
Nom[Position] := #1 + Nom[Position];
End;
Inc(Position);
End;
If Position>=MaxFiles Then Break;
FindNext(Palette);
Erreur:=DOSERROR;
End;
NombreFichierX := Position - 1;
Case TypeTri of
0 : TriNom;
1 : TriExtension;
2 : TriHeure;
3 : TriTaille;
End;
For Compteur:=1 to NombreFichierX do Begin
If(Copy(Nom[Compteur],1,1)<#32)Then Nom[Compteur]:=Copy(Nom[Compteur],2,11);
End;
End;
Procedure ShowTitle;Begin
Box(1,1,80,1,$1F);
GotoXY(30,1);
Write('MS-DOS Shell Clone');
End;
Procedure SetColorSelect;Begin
TextColor(15);
TextBackground(0);
End;
Procedure SetColorUnSelect;Begin
TextColor(0);
TextBackground(3);
End;
Procedure ShowMenu;
Var
I:Byte;
Begin
Box(1,2,80,2,$30);
GotoXY(1,2);
For I:=0 to High(MainMenu) do Begin
If Not((CurrZone=3)and(I=3))Then Begin
If(OnMenu)Then Begin
If I+1=XMenu Then SetColorSelect
Else SetColorUnSelect;
End;
Case Language of
_Germany:Write(' ',MainMenuGermany[I],' ');
_English:Write(' ',MainMenuEnglish[I],' ');
Else Write(' ',MainMenu[I],' ');
End;
SetColorUnSelect;
If Language in[_English,_French]Then Write(' ');
End;
End;
End;
Procedure SubMenuItem(Y:Integer;Disable:Boolean);Begin
If(Disable)Then SetColorUnSelect Else
If Y=YMenu Then SetColorSelect
Else SetColorUnSelect;
Case XMenu of
1:Begin
GotoXY(2,4+Y);
If SubMenuFile[Y]=''Then Write(DuplicateString('-',27+1))
Else
Case Language of
_English:Write(' ',PadRight(SubMenuFileEnglish[Y],27));
_Germany:Write(' ',PadRight(SubMenuFileGermany[Y],27));
Else Write(' ',PadRight(SubMenuFile[Y],27));
End;
End;
2:Begin
Case Language of
_English:GotoXY(9,4+Y);
_Germany:GotoXY(9,4+Y);
Else GotoXY(12,4+Y);
End;
If SubMenuOptions[Y]=''Then Write(DuplicateString('-',39+1))
Else
Case Language of
_English:Write(' ',PadRight(SubMenuOptionsEnglish[Y],39));
_Germany:Write(' ',PadRight(SubMenuOptionsGermany[Y],39));
Else Write(' ',PadRight(SubMenuOptions[Y],39));
End;
End;
3:Begin
Case Language of
_English:GotoXY(19,4+Y);
_Germany:GotoXY(19,4+Y);
Else GotoXY(22,4+Y);
End;
If SubMenuView[Y]=''Then Write(DuplicateString('-',27+1))
Else
Case Language of
_English:Write(' ',PadRight(SubMenuViewEnglish[Y],27));
_Germany:Write(' ',PadRight(SubMenuViewGermany[Y],27));
Else Write(' ',PadRight(SubMenuView[Y],27));
End;
End;
4:Begin
Case Language of
_English:GotoXY(26,4+Y);
_Germany:GotoXY(28,4+Y);
Else GotoXY(34,4+Y);
End;
If SubMenuTree[Y]=''Then Write(DuplicateString('-',27+1))
Else
Case Language of
_English:Write(' ',PadRight(SubMenuTreeEnglish[Y],27));
_Germany:Write(' ',PadRight(SubMenuTreeGermany[Y],27));
Else Write(' ',PadRight(SubMenuTree[Y],27));
End;
End;
5:Begin
If(CurrZone=3)Then Begin
Case Language of
_English:GotoXY(26,4+Y);
_Germany:GotoXY(28,4+Y);
Else GotoXY(34,4+Y);
End;
End
Else
Begin
Case Language of
_English:GotoXY(33,4+Y);
_Germany:GotoXY(41,4+Y);
Else GotoXY(42,4+Y);
End;
End;
If SubMenuHelp[Y]=''Then Write(DuplicateString('-',27+1))
Else
Case Language of
_English:Write(' ',PadRight(SubMenuHelpEnglish[Y],27));
_Germany:Write(' ',PadRight(SubMenuHelpGermany[Y],27));
Else Write(' ',PadRight(SubMenuHelp[Y],27));
End;
End;
End;
End;
Procedure ShowSubMenu;
Var
I:Integer;
Begin
Case XMenu of
1:Begin
FrameEmpty(1,3,30,5+High(SubMenuFile),$30);
For I:=Low(SubMenuFile)to High(SubMenuFile)do Begin
SubMenuItem(I,False);
End;
End;
2:Begin
Case Language of
_English:FrameEmpty(8,3,49,5+High(SubMenuOptions),$30);
_Germany:FrameEmpty(8,3,49,5+High(SubMenuOptions),$30);
Else FrameEmpty(11,3,52,5+High(SubMenuOptions),$30);
End;
For I:=Low(SubMenuOptions)to High(SubMenuOptions)do Begin
SubMenuItem(I,False);
End;
End;
3:Begin
Case Language of
_English:FrameEmpty(18,3,47,5+High(SubMenuView),$30);
_Germany:FrameEmpty(18,3,47,5+High(SubMenuView),$30);
Else FrameEmpty(21,3,50,5+High(SubMenuView),$30);
End;
For I:=Low(SubMenuView)to High(SubMenuView)do Begin
SubMenuItem(I,False);
End;
End;
4:Begin
Case Language of
_English:FrameEmpty(25,3,54,5+High(SubMenuTree),$30);
_Germany:FrameEmpty(27,3,56,5+High(SubMenuTree),$30);
Else FrameEmpty(33,3,62,5+High(SubMenuTree),$30);
End;
For I:=Low(SubMenuTree)to High(SubMenuTree)do Begin
SubMenuItem(I,False);
End;
End;
5:Begin
If(CurrZone=3)Then Begin
Case Language of
_English:FrameEmpty(25,3,54,5+High(SubMenuHelp),$30);
_Germany:FrameEmpty(27,3,56,5+High(SubMenuHelp),$30);
Else FrameEmpty(33,3,62,5+High(SubMenuHelp),$30);
End;
End
Else
Begin
Case Language of
_English:FrameEmpty(32,3,61,5+High(SubMenuHelp),$30);
_Germany:FrameEmpty(40,3,69,5+High(SubMenuHelp),$30);
Else FrameEmpty(41,3,70,5+High(SubMenuHelp),$30);
End;
End;
For I:=Low(SubMenuHelp)to High(SubMenuHelp)do Begin
SubMenuItem(I,False);
End;
End;
End;
End;
Procedure ShowPath;
Var
Path:String;
Begin
TextColor(0+BLINK);
TextBackground(7);
GetDir(0,Path);
GotoXY(1,3);
Write(' ':2,Path);
ClrEol;
End;
Procedure RefreshDrive;
Var
CurrDrive,I:Char;
Begin
TextColor(0+BLINK);
TextBackground(7);
GotoXY(1,4);
Write(' ');
CurrDrive:=GetCurrentDisk;
For I:='A' to 'Z'do Begin
If(DiskSize(1+Ord(I)-Ord('A'))<>-1)Then Begin
If CurrDrive=I Then Begin
TextColor($F);
If CurrZone=0 Then TextBackground(1)
Else TextBackground(0);
End
Else
Begin
TextColor(0+BLINK);
TextBackground(7);
End;
Write('[',I,':]');
TextColor(00+BLINK);
TextBackground(7);
Write(' ');
End;
End;
ClrEol;
End;
Function PreviousDrive:Boolean;
Var
LastDrive,CurrDrive,I:Char;
Begin
PreviousDrive:=False;
CurrDrive:=GetCurrentDisk;
LastDrive:='@';
For I:='A' to 'Z'do Begin
If(DiskSize(1+Ord(I)-Ord('A'))<>-1)Then Begin
If CurrDrive=I Then Begin
If LastDrive='@'Then Exit;
ChDir(LastDrive+':');
PreviousDrive:=True;
Exit;
End
Else
LastDrive:=I;
End;
End;
End;
Function NextDrive:Boolean;
Var
CurrDrive,I:Char;
FindCurr:Boolean;
Begin
NextDrive:=False;
FindCurr:=False;
CurrDrive:=GetCurrentDisk;
For I:='A' to 'Z'do Begin
If(DiskSize(1+Ord(I)-Ord('A'))<>-1)Then Begin
If FindCurr Then Begin
ChDir(I+':');
NextDrive:=True;
Exit;
End
Else
If CurrDrive=I Then FindCurr:=True;
End;
End;
End;
Procedure ShowDrive;Begin
Box(1,4,80,5,$F0);
RefreshDrive;
End;
Procedure ShowFunctionKey;
Const
FunctionKey:Array[0..1]of String[15]=(
'F10=Actions','Shift+F9=Prompt de commande'
);
FunctionKeyEnglish:Array[0..1]of String[25]=(
'F10=Actions','Shift+F9=Command Prompt'
);
FunctionKeyGermany:Array[0..1]of String[35]=(
'F10=Menleiste','UMSCHALT+F9=Eingabeaufforderung'
);
Var
I:Integer;
Begin
TextColor(0);
TextBackground(3);
GotoXY(1,25);
ClrEol;
For I:=0 to High(FunctionKey) do Begin
Case Language of
_Germany:Write(' ',FunctionKeyGermany[I]);
_English:Write(' ',FunctionKeyEnglish[I]);
Else Write(' ',FunctionKey[I]);
End;
End;
End;
Procedure ShowDirectoryTreePanel;
Var
ColorState:Byte;
Begin
If CurrZone=1Then ColorState:=$1F
Else ColorState:=$70;
Box(1,6,40,15,$F0);
FrameEmpty(1,6,40,15,$F0);
Box(1,6,40,6,ColorState);