-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathToolView.pas
793 lines (643 loc) · 20.3 KB
/
ToolView.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
{ Cette unit‚ est utilis‚e pour offrir un service de
visualisation rapide d'un fichier ASCII.
}
{$I DEF.INC}
Unit ToolView;
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
INTERFACE
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
Uses Systex,Isatex;
Procedure QHlp(Const FileName:String);
Procedure QHlp4RLL(Const FileName:String;IndexStart,IndexEnd:Wd);
Function VAInit(Var Q:ViewAsciiApp;X1,Y1,X2,Y2:Byte;Const FileName:String;Hlp:Bool):Bool;
Function VAInit4RLL(Var Q;X1,Y1,X2,Y2:Byte;Const FileName:String;Index,IndexEnd:Wd):Bool;
Function VAInitRaw(Var Q:ViewAsciiApp;X1,Y1,X2,Y2:Byte;Const FileName:String):Bool;
Procedure VALoad(Var Q;X1,Y1,X2,Y2:Byte;Const Path:String);
Procedure VAGotoFilePos(Var Q:ViewAsciiApp;P:LongInt);
Procedure VADn(Var Q:ViewAsciiApp);
Procedure VAPgDn(Var Q:ViewAsciiApp);
Procedure VAPgUp(Var Q:ViewAsciiApp);
Procedure VAUp(Var Q:ViewAsciiApp);
Procedure VARefresh(Var Q);
Function VARun(Var Q):Word;
Procedure VAReSize(Var Q;X1,Y1,X2,Y2:Byte);
Procedure VAMove2(Var QX;X,Y:Byte);
Function VATitle(Var Q;Max:Byte):String;
Function VADone(Var Q):Word;
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
IMPLEMENTATION
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
Uses Adele,Memories,Systems,Video,Dialex,Dials;
Procedure VAPutData(Var Q:ViewAsciiApp);Near;Forward;
Procedure VARefreshData(Var Q:ViewAsciiApp;ClrEol:Boolean);Near;Forward;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction GetBckFileTxtLn Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Portabilit‚: Local
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction permet de lire une ligne ASCII en arriŠre (la pr‚c‚dante)
plut“t que la prochaine afin de revenir en arriŠre...
}
Function GetBckFileTxtLn(Handle,P:Wd;PL:Long):String;Near;Label Break;Var Str:String;I:Byte;Chr:Char;Buf:PChrAByte;Begin
GetBckFileTxtLn:='';Str:='';
_GetAbsRec(Handle,PL,P,Buf);
For I:=P-3downto 1do Begin
Chr:=Buf[I-1];
If Chr=#10Then Begin
Chr:=Buf[I-2];
If Chr=#13Then Goto Break;
Str:=#10+Chr+Str
End
Else
Str:=Chr+Str
End;
Break:GetBckFileTxtLn:=Str
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure WaitRetrace2 Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Portabilit‚: Local
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette routine fait simplement attendre 2 retour de balayage de l'‚cran.
Remarque
ÍÍÍÍÍÍÍÍ
þ Elle est essentiellement utilis‚ afin d'‚conomiser de la m‚moire et
c'est la raison pour laquelle est a un statue local.
}
Procedure WaitRetrace2;Near;Begin
WaitRetrace;WaitRetrace;
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ·}
{³ O b j e t V i e w A s c i i º}
{ÔÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ}
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAPutTxt Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Local
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'afficher le contenu d'une chaŒne de caractŠres
… la position courante du visualisateur de fichier ASCII en regard rapide
en tenant compte du format de fichier de traitement de texte GAT.
}
Procedure VAPutTxt(Var Q:ViewAsciiApp;Str:String);Near;
Var
I,X,XM,Y,GAttr:Byte;
Chr:Char;
Begin
_DelAllSpcRight(Str);
If(Q.View=GAT)Then Begin
I:=1;
X:=WEGetRealX(Q.W);Y:=WEGetRealY(Q.W);
XM:=X+Q.W.MaxX;
While(Length(Str)>=I)do Begin
If Str[I]<' 'Then Begin
GAttr:=Byte(Str[I]);
Inc(I);
Chr:=Str[I]
End
Else
Begin
GAttr:=0;
Chr:=Str[I]
End;
Inc(I);
If(X>=XM)and(GAttr and $10=$10)Then Break;
PutCharGAttr(X,Y,Chr,Q.W.CurrColor,GAttr);
Inc(X);
If GAttr and$10=$10Then Inc(X);
If(X>XM)Then Break;
End;
Q.W.X:=X-WEGetRealX(Q.W)
End
Else
WEPutTxt(Q.W,Str);
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VADn Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet de passer … la lecture d'une liste du texte de
ASCII suivant … l'‚cran de l'objet de visualisation de fichier en
regard rapide.
}
Procedure VADn{Var Q:VA};
Var
Handle:Hdl;
Str:String;
MY,L:Byte;
P:LongInt;
Begin
MY:=Q.W.MaxY;
If Q.FileSize<=Q.PBnk^[MY]Then Exit;
Handle:=FileOpen(Q.FileName,fmRead);
If(Handle<>errHdl)Then Begin
MoveLeft(Q.PBnk^[1],Q.PBnk^,Q.SizeBnk-4);
_WEScrollDn(Q.W);
WESetPos(Q.W,0,MY);
{ L:=Length(GetAbsFileTxtLn(Handle,Q.PBnk^[MY-1]));
If(L>Q.W.MaxX)Then L:=Q.W.MaxX+1 Else Inc(L,2);}
P:=Q.PBnk^[MY-1];
__GetAbsFileTxtLn(Handle,P,Str);
L:=Length(Str);
If L>Q.W.MaxX+1Then L:=Q.W.MaxX+1 Else L:=P-Q.PBnk^[MY-1];
Q.PBnk^[MY]:=Q.PBnk^[MY-1]+L;P:=Q.PBnk^[MY];
__GetAbsFileTxtLn(Handle,P,Str);
VAPutTxt(Q,Str);
WEClrEOL(Q.W);
FileClose(Handle);
VAPutData(Q)
End
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Destructeur VADone Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Ce destructeur met fin … l'objet de visualisation de fichier ASCII
en regard rapide.
}
Function VADone{Var Q):Word};Begin
FreeMemory(ViewAsciiApp(Q).PBnk,ViewAsciiApp(Q).SizeBnk);
WEDone(ViewAsciiApp(Q).W);
VADone:=0;
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAInitFrame Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'initaliser la structure de base interne du
visualisateur de fichier ASCII en regard rapide.
}
Procedure VAInitFrame(Var Q:ViewAsciiApp;Const FileName:String;X1,Y1,X2,Y2:Byte;Hlp,Raw:Boolean);
Var
S:String;
Begin
FillClr(Q,SizeOf(Q));
Q.Raw:=Raw;
If Not FileExist(FileName)Then Exit;
If(Hlp)Then Q.View:=Isatex.Hlp Else
If Path2Ext(FileName)='.GAT'Then Begin
Q.View:=GAT;S[0]:=#255;
GetFile(FileName,0,SizeOf(S)-1,S[1]);
S[0]:=Char(Pos(#13,S));Q.Min:=Length(S)+2;Q.PBnk^[0]:=Q.Min;
End
Else
Q.Min:=0;
Q.FileSize:=GetFileSize(FileName);
WEInit(Q.W,X1,Y1,X2,Y2);
If(Raw)Then Begin
Q.W.Palette.Border:=GetAttr(X1+1,Y1+1);
Q.W.Palette.High:=Q.W.Palette.Border;
Q.W.CurrColor:=Q.W.Palette.Border;
End;
Q.SizeBnk:=(Q.W.T.Y2-Q.W.T.Y1+2)shl 2;Q.PBnk:=MemNew(Q.SizeBnk);
If(Q.PBnk=NIL)Then Exit;
If(Q.View=GAT)Then Q.PBnk^[0]:=Q.Min;
{$IFNDEF H}
WEPushWn(Q.W);
{$ENDIF}
Q.FileName:=FileName;
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAGotoFilePos Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'envoyer le visualisateur de fichier ASCII en
regarde rapide … une position absolue … partir du d‚but du fichier en
octets.
}
Procedure VAGotoFilePos{Var Q:VA;P:Long};Begin
Q.PBnk^[0]:=P;
VARefreshData(Q,True)
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Constructeur VAInit Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Ce constructeur permet d'initialiser une visualisateur de fichier ASCII
rapide sur justement un fichier existant quelque part sur une des unit‚s
logique disponible.
}
Function VAInit{Var Q:VA;X1,Y1,X2,Y2:Byte;Const FileName:String;Hlp:Bool):Bool};Begin
VAInit:=False;
VAInitFrame(Q,FileName,X1,Y1,X2,Y2,Hlp,False);
VARefresh(Q);
VAInit:=True
End;
Function VAInitRaw;Begin
VAInitRaw:=False;
VAInitFrame(Q,FileName,X1,Y1,X2,Y2,False,True);
VARefresh(Q);
VAInitRaw:=True
End;
Procedure VALoad{Var Q;X1,Y1,X2,Y2:Byte;Const Path:String};Begin
VAInit(ViewAsciiApp(Q),X1,Y1,X2,Y2,Path,False);
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Constructeur VAInit4RLL Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Ce constructeur permet d'afficher le contenu ASCII d'un index contenu
dans un fichier bibliothŠque de format ®RLL¯ … partir du visualisateur
rapide.
}
Function VAInit4RLL{Var Q:VA;X1,Y1,X2,Y2:Byte;Const FileName:String;Index,IndexEnd:Wd):Bool};
Var
XP:Array[0..1]of LongInt;
Handle:Hdl;
I:Word;
Name:String;
Begin
VAInit4RLL:=False;
Name:=FSearch(FileName,MaltePath+';'+MaltePath+'HLP;'+MaltePath+'HELP;'+MaltePath+';\MALTE\HLP;');
VAInitFrame(ViewAsciiApp(Q),Name,X1,Y1,X2,Y2,True,False);
Handle:=FileOpen(Name,fmRead);
If(Handle<>errHdl)Then Begin
If Index=$FFFFThen Begin
GetRec(Handle,0,SizeOf(XP[0]),XP[0]);
If XP[0]=$1A324C52Then Begin
XP[0]:=4;I:=1;
While ViewAsciiApp(Q).FileSize<>XP[0]do Begin
GetRec(Handle,I,SizeOf(XP[0]),XP[0]);
If GetSysErr<>0Then Break;
Inc(I);
End;
ViewAsciiApp(Q).Min:=I shl 2;
End;
End
Else
Begin
_GetAbsRec(Handle,(Index+1)shl 2,SizeOf(XP),XP);
ViewAsciiApp(Q).Min:=XP[0];
If(IndexEnd<>Index)Then _GetAbsRec(Handle,(IndexEnd+1)shl 2,SizeOf(XP),XP);
ViewAsciiApp(Q).FileSize:=XP[1]-1;
End;
FileClose(Handle);
ViewAsciiApp(Q).PBnk^[0]:=ViewAsciiApp(Q).Min;
End;
VARefresh(Q);
VAInit4RLL:=True
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAPgDn Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet de descendre … l'‚cran plus haut du fichier ASCII
actuellement en visualisation.
}
Procedure VAPgDn{Var Q:VA};
Var
MY:Byte;
Begin
MY:=Q.W.MaxY;
If Q.FileSize<=Q.PBnk^[MY]Then Exit;
Q.PBnk^[0]:=Q.PBnk^[MY];
VARefreshData(Q,True)
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAPgUp Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet de remonter … l'‚cran plus haut du fichier ASCII
actuellement en visualisation.
}
Procedure VAPgUp{Var Q:VA};
Var
Handle:Hdl;
P:Word;
Str:String;
PL:LongInt;
J:Byte;
Begin
If(Q.PBnk^[0]<=Q.Min)Then Exit;
Handle:=FileOpen(Q.FileName,fmRead);
If(Handle<>errHdl)Then Begin
Q.PBnk^[Q.W.MaxY+1]:=Q.PBnk^[1];
For J:=Q.W.MaxY downto 0do Begin
WESetPos(Q.W,0,J);
{ If(Q.PBnk^[J+1]<=Q.Min)Then Begin Q.PBnk^[0]:=Q.Min;VARefresh(Q);Break;End
Else
Begin}
P:=256;PL:=Q.PBnk^[J+1]-255;
If PL<0Then Begin;P:=Q.PBnk^[J+1]+1;PL:=0;End;
Str:=GetBckFileTxtLn(Handle,P,PL);
VAPutTxt(Q,Str);
{ End;}
WEClrEOL(Q.W);
Q.PBnk^[J]:=Q.PBnk^[J+1]-Length(Str)-2;
If(Q.PBnk^[J]<=Q.Min)Then Begin
Q.PBnk^[0]:=Q.Min;
VARefresh(Q);
Break;
End
End;
FileClose(Handle);
VAPutData(Q)
End
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAPutData Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'afficher l'indicateur de position actuel dans
le regardeur de fichiers ASCII de l'objet d‚finit par la variable de
param‚trage ®Q¯.
}
Procedure VAPutData;
Var
S,S2:String;
Begin
If Not(Q.Raw)Then Begin
S:=CStr(Q.PBnk^[0]);
If(Q.PBnk^[Q.W.MaxY]>Q.FileSize)Then S2:='la Fin'
Else S2:=CStr(Q.PBnk^[Q.W.MaxY]);
S2:=StrUSpc(S2,13);
WESetEndBarTxtX(Q.W,1,Spc(14-Length(S))+S+' … '+S2,CurrKrs.Desktop.DialStatus)
End;
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VARefresh Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet de restituer complŠtement la fenˆtre de dialogue
de visualisation de fichier ASCII en regard rapide sans aucune ommission
quelqu'elle soit.
}
Procedure VARefresh(Var Q);Begin
If(ViewAsciiApp(Q).Raw)Then Begin
End
Else
Begin
If(ViewAsciiApp(Q).View=Hlp)Then WEPutWn(ViewAsciiApp(Q).W,'Aide',CurrKrs.Help.Window)
Else
Begin
If(ViewAsciiApp(Q).View=GAT)Then WEPutWn(ViewAsciiApp(Q).W,'Regarde: '+ViewAsciiApp(Q).FileName,CurrKrs.Help.Window)
Else WEPutWn(ViewAsciiApp(Q).W,'Regarde: '+ViewAsciiApp(Q).FileName,CurrKrs.ViewAscii.Window);
End;
WECloseIcon(ViewAsciiApp(Q).W);
WEZoomIcon(ViewAsciiApp(Q).W);
WESetEndBar(ViewAsciiApp(Q).W,CurrKrs.Desktop.DialStatus);
WEPutBarMsRight(ViewAsciiApp(Q).W);
End;
VARefreshData(ViewAsciiApp(Q),False);
If Not(ViewAsciiApp(Q).Raw)Then Begin
If Not(ViewAsciiApp(Q).View=Hlp)Then Begin
If(IsGrf)Then Begin
BarSpcHorRelief(ViewAsciiApp(Q).W.T.X1,ViewAsciiApp(Q).W.T.Y2,ViewAsciiApp(Q).W.T.X1+32,CurrKrs.Desktop.DialStatus);
BarSpcHorReliefExt(ViewAsciiApp(Q).W.T.X1+1,ViewAsciiApp(Q).W.T.Y2,ViewAsciiApp(Q).W.T.X1+31,CurrKrs.Desktop.DialStatus);
BarSpcHorRelief(ViewAsciiApp(Q).W.T.X1+33,ViewAsciiApp(Q).W.T.Y2,ViewAsciiApp(Q).W.T.X2,CurrKrs.Desktop.DialStatus);
BarSpcHorReliefExt(ViewAsciiApp(Q).W.T.X1+34,ViewAsciiApp(Q).W.T.Y2,ViewAsciiApp(Q).W.T.X2-2,CurrKrs.Desktop.DialStatus);
LuxeBox(ViewAsciiApp(Q).W.T.X2-1,ViewAsciiApp(Q).W.T.Y2);
End
Else
WESetEndBarTxtX(ViewAsciiApp(Q).W,32,'³',CurrKrs.Desktop.DialStatus);
WESetEndBarTxtX(ViewAsciiApp(Q).W,34,'Taille'+CStrBasic(ViewAsciiApp(Q).FileSize)+' octet(s)',CurrKrs.Desktop.DialStatus)
End;
End;
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VARefreshData Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet de restaurer sp‚cifiquement la partie des donn‚es
actuellement visible dans la fenˆtre, c'est-…-dire le contenu du fichier
seulement sans tenir compte du reste de la fenˆtre et des indicateurs.
}
Procedure VARefreshData;
Var
Handle:Hdl;
L,J:Byte;
Str:String;
P:LongInt;
Begin
WESetPosHome(Q.W);
Handle:=FileOpen(Q.FileName,fmRead);
If(Handle<>errHdl)Then Begin
For J:=0to(Q.W.MaxY)do Begin
P:=Q.PBnk^[J];
__GetAbsFileTxtLn(Handle,P,Str);
If Length(Str)>Q.W.MaxX+1Then L:=Q.W.MaxX+1
Else L:=P-Q.PBnk^[J]{Length(Str)+2};
VAPutTxt(Q,Str);
If(ClrEol)Then WEClrEol(Q.W);
WELn(Q.W);
Q.PBnk^[J+1]:=Q.PBnk^[J]+L
End;
FileClose(Handle);
VAPutData(Q);
End
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAReSize Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet de changer la taille d'une multi-fenˆtre de
visualisation de fichier ASCII en regard rapide.
Remarque
ÍÍÍÍÍÍÍÍ
þ Elle s'applique seulement … la m‚thode ®H¯ de gestion multi-
fenˆtre et abolument pas aux autres ancienne m‚thode demendant
un application interne pour chaque objet le restitution de
l'image...
}
Procedure VAReSize{Var Q:VA;X1,Y1,X2,Y2:Byte};
Var
Old:LongInt;
N:String;
Begin
Old:=ViewAsciiApp(Q).PBnk^[0];
N:=ViewAsciiApp(Q).FileName;
VADone(Q);
VAInitFrame(ViewAsciiApp(Q),N,X1,Y1,X2,Y2,ViewAsciiApp(Q).View=Isatex.Hlp,False);
ViewAsciiApp(Q).PBnk^[0]:=Old;
VARefresh(Q)
End;
Procedure VAMove2{Var QX;X,Y:Byte};
Var
Q:ViewAsciiApp Absolute QX;
Begin
VAReSize(Q,X,Y,X+Q.W.T.X2-Q.W.T.X1,Y+Q.W.T.Y2-Q.W.T.Y1);
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VARun Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Portabilit‚: Globale
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction attend une r‚action de la part de l'utilisateur et agit
en fonction de sa demande. Si la demande ne concerne pas l'objet, la
fonction retourne un code clavier correspondant … la demande ayant ‚t‚
faite.
}
Function VARun{Var Q):Wd};
Var
K:Word;
Begin
Repeat
K:=WEReadk(ViewAsciiApp(Q).W);
Case(K)of
kbRBarMsUp:Begin
WaitRetrace2;
VAUp(ViewAsciiApp(Q))
End;
kbRBarMsDn:Begin
WaitRetrace2;
VADn(ViewAsciiApp(Q))
End;
kbRBarMsPgUp:Begin
WaitRetrace2;
VAPgUp(ViewAsciiApp(Q))
End;
kbRBarMsPgDn:Begin
WaitRetrace2;
VAPgDn(ViewAsciiApp(Q))
End;
kbDn:VADn(ViewAsciiApp(Q));
kbPgDn:VAPgDn(ViewAsciiApp(Q));
kbUp:VAUp(ViewAsciiApp(Q));
kbPgUp:VAPgUp(ViewAsciiApp(Q))
Else Begin
VARun:=K;
Break;
End
End
Until False
End;
{ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure VAUp Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Propri‚taire: VA
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet de retourner en arriŠre dans la lecture d'une
liste du texte ASCII.
}
Procedure VAUp{Var Q:VA};
Var
Handle:Hdl;
L:Byte;
P:Word;
Str:String;
PL:LongInt;
Begin
If(Q.PBnk^[0]<=Q.Min)Then Exit;
Handle:=FileOpen(Q.FileName,fmRead);
If(Handle<>errHdl)Then Begin
MoveRight(Q.PBnk^,Q.PBnk^[1],Q.SizeBnk-4);
_WEScrollUp(Q.W);
WESetPosHome(Q.W);
P:=Q.W.MaxX+4;PL:=Q.PBnk^[1]-(P-1);
If PL<0Then Begin;P:=Q.PBnk^[1]+1;PL:=0;End;
Str:=GetBckFileTxtLn(Handle,P,PL);
If(Length(Str)>=Q.W.MaxX)Then L:=Q.W.MaxX+1+4 Else L:=Length(Str);
VAPutTxt(Q,Str);WEClrEOL(Q.W);
Q.PBnk^[0]:=Q.PBnk^[1]-L-2;
FileClose(Handle);
If(Q.PBnk^[0]<Q.Min)Then Begin
Q.PBnk^[0]:=Q.Min;
VARefresh(Q)
End
Else
VAPutData(Q)
End;
End;
Function VATitle(Var Q;Max:Byte):String;
Const Name='Regarde ASCII ';
Begin
If(ViewAsciiApp(Q).View=Hlp)Then VATitle:='Aide'
Else VATitle:=Name+TruncName(ViewAsciiApp(Q).FileName,Max-Length(Name))
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure QHlp Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure d'obtenir de l'aide … partir d'un fichier ASCII ayant
comme extension ®.HLP¯.
}
Procedure QHlp{Const FileName:String};
Var
Name:String;
V:ViewAsciiApp;
{$IFDEF H}
W:Window;
{$ENDIF}
Begin
If DirExist('\MALTE\HLP')Then Name:='\MALTE\HLP\'+Path2Name(FileName)+'.HLP'
Else Name:=MaltePath+'HLP\'+Path2Name(FileName)+'.HLP';
{$IFDEF H}
WEInit(W,5,5,MaxXTxts-5,MaxYTxts-5);
WEPushWn(W);
{$ENDIF}
VAInit(V,5,5,MaxXTxts-5,MaxYTxts-5,Name,True);
Repeat Until VARun(V)=kbEsc;
VADone(V);
{$IFDEF H}
WEDone(W)
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure QHlp4RLL Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'afficher l'aide associer … un fichier de ressource
de format ®RLL¯.
}
Procedure QHlp4RLL{Const FileName:String;IndexStart,IndexEnd:Wd};
Var
V:ViewAsciiApp;
{$IFDEF H}
W:Window;
{$ENDIF}
Begin
{$IFDEF H}
WEInit(W,5,5,MaxXTxts-5,MaxYTxts-5);
WEPushWn(W);
{$ENDIF}
VAInit4RLL(V,5,5,MaxXTxts-5,MaxYTxts-5,{SYSDrive+}FileName,IndexStart,IndexEnd);
Repeat Until VARun(V)=kbEsc;
VADone(V);
{$IFDEF H}
WEDone(W)
{$ENDIF}
End;
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
END.