[go: up one dir, main page]

Menu

[r767]: / lister.pas  Maximize  Restore  History

Download this file

1536 lines (1353 with data), 44.9 kB

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
{ $Id: lister.pas 7284 2006-04-28 16:02:45Z mkaemmerer $
This is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
The software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this software; see the file gpl.txt. If not, write to the
Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Created on July, 21st 2000 by Hinrich Donner <hd@tiro.de>
This software is part of the OpenXP project (www.openxp.de).
}
{$I xpdefine.inc}
unit lister;
interface
uses
classes, sysutils,
debug, xpglobal, keys, xpunicode_lbr, xpcharset_codec;
var
ListHelpStr: string[8] = 'Hilfe'; //todo: international
Listunvers: byte = 0;
Listhalten: byte = 0;
Listflags: longint = 0;
const
ListerBufferCount = 16383; { Laenge des Eingangspuffers }
var
mcursor: boolean = false; { Auswahlcursor fuer Blinde }
type
listcol = packed record
coltext, { normaler Text }
colselbar, { Balken bei Auswahlliste }
colmarkline, { markierte Zeile }
colmarkbar, { Balken auf mark. Zeile }
colfound, { Suchergebnis }
colstatus, { Statuszeile }
colscroll, { Scroller }
colhigh, { *hervorgehoben* }
colqhigh: byte; { Quote / *hervorgehoben* }
colsignatur: byte; { Signatur }
end;
TLister = class;
TListerConvertEvent = procedure(var buf; Size: Word) of object; { fuer Zeichensatzkonvert. }
TListerTestMarkEvent = function(const s: string; block: boolean): boolean;
TListerEnterEvent = procedure(const s: string);
TListerTestSelectEvent = function(const s: string; down: boolean): boolean;
TListerKeyPressedEvent = procedure(LSelf: TLister; var t: taste);
TListerShowLinesEvent = procedure(s: string);
TListerDisplayLineEvent = function(x, y, start_col, columns: Integer; var s: string): string;
TListerColorEvent = function(const s: string; line: longint): byte;
{ moegliche Optionen fuer den Lister }
{ }
{ SB = SelBar M = markable }
{ F1 = "F1-Hilfe" S = Suchen moeglich }
{ NS = NoStatus NA = ^A nicht moeglich }
{ CR = mit Enter beendbar MS = SelBar umschaltbar }
{ NLR = kein l/r-Scrolling APGD= immer komplettes PgDn }
{ DM = direkte Mausauswahl }
{ VSC = vertikaler Scrollbar ROT = Taste ^R aktivieren }
liststat = packed record
statline: boolean; //todo: make set from booleans?
wrapmode: boolean;
markable: boolean; { markieren moeglich }
endoncr: boolean; { Ende mit <cr> }
helpinfo: boolean; { F1=Hilfe }
wrappos: byte;
noshift: boolean; { kein links/rechts-Scrolling }
markswitch: boolean; { SelBar umschaltbar }
maysearch: boolean; { Suchen moeglich }
noctrla: boolean; { ^A nicht moeglich }
AllPgDn: boolean; { immer komplettes PgDn }
directmaus: boolean; { Enter bei Maus-Auswahl }
vscroll: boolean; { vertikaler Scrollbar }
scrollx: Integer;
rot13enable: boolean; { ^R moeglich }
autoscroll: boolean;
Signatur: boolean; { Highlight beginning from signatur }
end;
listarr = record { Pfeile }
usearrows: boolean;
x, y1, y2: byte;
arrowattr: byte;
backattr: byte;
backchr: char;
end;
ListerCharArray = array[0..ListerBufferCount] of Char;
TLister = class
protected
FOnConvert: TListerConvertEvent;
FOnTestMark: TListerTestMarkEvent;
FOnEnter: TListerEnterEvent;
FOnTestSelect: TListerTestSelectEvent;
FOnKeypressed: TListerKeyPressedEvent;
FOnShowLines: TListerShowLinesEvent;
FOnDisplayLine: TListerDisplayLineEvent;
FOnColor: TListerColorEvent;
FStartPos: Integer; // first position of select bar
FHeaderText: string; // text of header, max 40 chars
FSelBar: boolean; // display select bar
FSelLine: Integer; // actual selected line
FSelCount: Integer; // Number of selected lines
FLinePos: integer;
FLines: TListerStrings;
FUTF8Mode: boolean; // UTF-8 Mode (false: CP437)
arrows: listarr;
l, o, w,
Height: Integer; // Height including status line
markpos: integer;
// set/clear/test line Index marked
procedure SetMarkedFlag(Index: Integer);
procedure ClearMarkedFlag(Index: Integer);
function GetMarked(Index: Integer): boolean;
procedure SetMarked(Index: Integer; NewValue: boolean);
procedure SetHeaderText(s: String);
private
FIsUTF8: boolean;
CP437ToUTF8: TUTF8Encoder;
SignaturPosition: Integer; // line number where signatur starts
function SuchstrAsVariable: pstring;
function SuchStr: string;
protected
procedure SetUTF8;
procedure SetCP437;
public
col: listcol;
stat: liststat;
suchcase: boolean; { true -> Case-sensitiv }
insearch: boolean; { true -> suche text, false -> suche http-links }
constructor Create;
constructor CreateWithOptions(_l, _r, _o, _u: byte; statpos: shortint; options: string);
destructor Destroy; override;
// should modified to uses properties
procedure SetSize(_l, _r, _o, _u: byte);
// append one line
procedure AddLine(Line: String);
// read file from Ofs into Lines of Lister
procedure ReadFromFile(const Filename: string; ofs: Integer; line_break: boolean);
// Show Lister, Result is true if ESC was pressed
function Show: Boolean;
procedure SetArrows(x, y1, y2, acol, bcol: byte; backchr: char);
function FirstMarked: string;
function NextMarked: string;
function GetSelection: string;
function FirstLine: string;
function NextLine: string;
function PrevLine: string;
procedure UnmarkLine;
property StartPos: Integer read FStartPos write FStartPos;
property HeaderText: String read FHeaderText write SetHeaderText;
property SelCount: Integer read FSelCount;
property SelLine: Integer read FSelLine;
property SelBar: Boolean read FSelBar;
property LinePos: Integer read FLinePos;
property OnConvert: TListerConvertEvent read FOnConvert write FOnConvert;
property OnTestMark: TListerTestMarkEvent read FOnTestMark write FOnTestMark;
property OnEnter: TListerEnterEvent read FOnEnter write FOnEnter;
property OnTestSelect: TListerTestSelectEvent read FOnTestSelect write FOnTestSelect;
property OnKeyPressed: TListerKeyPressedEvent read FOnKeyPressed write FOnKeyPressed;
property OnShowLines: TListerShowLinesEvent read FOnShowLines write FOnShowLines;
property OnDisplayLine: TListerDisplayLineEvent read FOnDisplayline write FOnDisplayLine;
property OnColor: TListerColorEvent read FOnColor write FOnColor;
property Lines: TListerStrings read FLines;
property Marked[Index:Integer]: Boolean read GetMarked write SetMarked;
property UTF8Mode: Boolean read FUTF8Mode write FUTF8Mode;
end;
var
ListColors: ListCol;
LastLister: TLister; // points to the last opened lister (for historical reasons)
implementation { ------------------------------------------------ }
uses
{$IFDEF NCRT }
xpcurses,
{$ENDIF }
{$IFDEF WIN32 }
xpwin32,
{$ENDIF }
xpcharset,
xpcharset_maps,
typeform,
inout, maus2, winxp, resource,xp1, clip,
xp0,mime,xpkeys,xp1o,xp1o2;
{ TLister }
constructor TLister.Create;
begin
Debug.Debuglog('lister','TLister.Create',DLTrace);
LastLister := Self;
col := ListColors;
fillchar(stat, sizeof(stat), 0);
with stat do
begin
{: txt:='';
wrapmode:=false; markable:=false;
endoncr:=false;
wrappos:=0; :}
statline := true;
helpinfo := true;
end;
FOnConvert := nil;
FOnTestMark := nil;
FOnEnter := nil;
FOnKeypressed := nil;
FOnShowLines := nil;
FOnDisplayLine := nil;
FOnColor := nil;
FUTF8Mode := false;
FIsUTF8 := false;
CP437ToUTF8 := CreateUTF8Encoder(csCP437);
FLines := TListerStrings.Create;
SignaturPosition := MaxInt;
end;
constructor TLister.CreateWithOptions(_l, _r, _o, _u: byte; statpos: shortint; options: string);
begin
Debug.Debuglog('lister','TLister.CreateWithOptions',DLTrace);
Create;
SetSize(_l, _r, _o, _u);
options := UpperCase(options);
Fselbar := pos('/SB/', options) > 0;
FUTF8Mode := pos('/UTF8/', options) > 0;
stat.markable := pos('/M/', options) > 0;
stat.endoncr := pos('/CR/', options) > 0;
stat.helpinfo := pos('/F1/', options) > 0;
stat.statline := (statpos > 0) and (pos('/NS/', options) = 0);
stat.noshift := pos('/NLR/', options) > 0;
stat.markswitch := pos('/MS/', options) > 0;
stat.maysearch := pos('/S/', options) > 0;
stat.noctrla := pos('/NA', options) > 0;
stat.allpgdn := pos('/APGD/', options) > 0;
stat.directmaus := pos('/DM/', options) > 0;
stat.vscroll := pos('/VSC/', options) > 0;
stat.rot13enable := pos('/ROT/', options) > 0;
stat.signatur := pos('/SIG/', options) > 0;
if stat.vscroll then
stat.scrollx := ScreenWidth;
stat.autoscroll := true;
startpos := 0;
end;
destructor TLister.Destroy;
begin
Debug.Debuglog('lister','TLister.Destroy',DLTrace);
CP437ToUTF8.Free;
LastLister := nil;
Lines.Free;
inherited destroy;
end;
procedure TLister.SetMarkedFlag(Index: Integer);
begin
if (not Marked[Index]) then
Inc(FSelCount);
Lines.IncludeFlag (Index, lsfMARKED);
end;
procedure TLister.ClearMarkedFlag(Index: Integer);
begin
if (Marked[Index]) then
Dec(FSelCount);
Lines.ExcludeFlag (Index, lsfMARKED);
end;
function TLister.GetMarked(Index: Integer): boolean;
begin
Result := Lines.ContainsFlag (Index, lsfMARKED);
end;
procedure TLister.SetUTF8;
begin
if not UTF8Mode then exit;
if FIsUTF8 then exit;
SetLogicalOutputCharset(csUTF8);
FIsUTF8 := true;
end;
procedure TLister.SetCP437;
begin
if not UTF8Mode then exit;
if not FIsUTF8 then exit;
SetLogicalOutputCharset(csInternal);
FIsUTF8 := false;
end;
procedure TLister.SetMarked(Index: Integer; NewValue: boolean);
begin
if NewValue then
begin
if Assigned(FOnTestMark) then
begin
if FOnTestMark(Lines[index], false) then
SetMarkedFlag(Index);
end
else
SetMarkedFlag(Index);
end
else
ClearMarkedFlag(Index);
end;
procedure TLister.SetSize(_l, _r, _o, _u: byte);
begin
l := _l; o := _o;
w := _r - _l + 1; Height := _u - _o + 1;
end;
procedure TLister.AddLine(Line: String);
var
p: integer;
begin
if Line = #13 then exit; // ignore one CR
p := pos(#9, Line);
while p > 0 do
begin
delete(Line, p, 1);
insert(sp(8 - (p - 1) mod 8), Line, p);
p := pos(#9, Line);
end;
// add one line, not marked
Lines.Add(Line);
end;
procedure TLister.ReadFromFile(const Filename: string; ofs: Integer; line_break: boolean);
var input: TFileStream;
breaker: TUnicodeLineBreaker;
begin
Debug.Debuglog('lister','TLister.ReadFromFile, Filename: <'+Filename+'>',DLTrace);
FHeaderText := fitpath(FileUpperCase(FileName), 40);
Input := TFileStream.Create(Filename,fmOpenRead);
try
Input.Position := ofs;
Breaker := TUnicodeLineBreaker.Create;
try
if FUTF8Mode then Breaker.SetUTF8
else Breaker.SetCodePage(CP437TransTable);
Breaker.MaxWidth := iif(Line_Break,self.w,MaxInt);
Breaker.TabWidth := 8;
Breaker.Sink := Lines;
Breaker.AddData(Input);
Breaker.FlushData;
finally
Breaker.Free;
end;
finally
Input.Free;
end;
// search for begin of signature
if stat.Signatur then
begin
SignaturPosition := Lines.IndexOf('-- ');
if SignaturPosition = -1 then
SignaturPosition := MaxInt; // no signature found
end;
end;
var //eliminate "var not initialized" warning by using static variables
oldtcs: TMIMECharsets;
oldlcs: TMIMECharsets;
function TLister.Show: Boolean;
var
DispLines: Integer; // Screenlines to Display (List.Height - Statusline)
y: integer;
xa: integer;
t: taste;
s: string;
FirstLine: integer; // number of first line in display
f7p, f8p: longint;
suchline, suchlineTo: longint; { Zeilennr. }
spos, sposnext, slen, slen2: integer; { Such-Position/Laenge }
mzo, mzu: boolean;
mzl, mzr: boolean;
mb: boolean; { Merker fuer Inout.AutoBremse }
vstart,
vstop: integer; { Scrollbutton-Position }
_unit: longint;
scrolling: boolean;
scrollpos: integer;
scroll1st: integer;
mausdown: boolean; { Maus innerhalb des Fensters gedrueckt }
oldmark : boolean;
oldselb : boolean;
procedure showstat;
begin
if stat.statline then
begin
moff;
attrtxt(col.colstatus);
gotoxy(l, o);
// display 0 0 if file is empty
Wrt2(Format('%5d%6d', [Min(FirstLine + 1, Lines.Count), Lines.Count]));
if xa=1 then
Wrt2(' ')
else
Wrt2(RightStr(' +'+strs(xa-1),5)+' ');
{ if (a=0) and more then write(#31)
else if (a+gl>=lines.count) and (a>0) then write(#30)
else write(' '); }
Wrt2(iifs(listhalten=0,' ',iifs(listhalten=1,'+','-')));
if (listunvers=0) and (listflags=0) then Wrt2(' ')
else begin
if listunvers and 16 = 0
then Wrt2(iifs(listunvers and 1 = 0,' ','!'))
else Wrt2(iifs(listunvers and 1 = 0,'*',''));
if listflags and 3=1 then Wrt2('S')
else if listflags and 3=2 then Wrt2('s')
else Wrt2(iifs(listunvers and 8 = 8,'w',iifs(listunvers and 4=4,'c',' ')));
end;
if SelCount>0 then Wrt2(' ['+forms(strs(SelCount)+']',7))
else if stat.helpinfo then Wrt2(' F1-' + ListHelpStr);
mon;
end;
disp_DT;
end;
procedure display;
var
i: integer;
s, skew: string;
b: byte;
begin
i := 0;
SetUTF8;
moff;
while (i < DispLines) and (FirstLine + i < Lines.Count) do
begin
s := Lines[FirstLine + i];
if selbar and (FirstLine + i = FSelLine) then
if marked[FirstLine + i] then
attrtxt(col.colmarkbar)
else
attrtxt(col.colselbar)
else
if marked[FirstLine + i] then
attrtxt(col.colmarkline)
else
if Assigned(FOnColor) then
begin
b := FOnColor(s, FirstLine + i);
if b = 0 then
b := col.coltext
else
if b = $FF then
b := (col.coltext and $F0) + (col.coltext shr 4);
if stat.Signatur and (FirstLine + i >= SignaturPosition) then
b := col.colsignatur;
attrtxt(b);
end
else
attrtxt(col.coltext);
if Assigned(FOnDisplayLine) then
skew := FOnDisplayLine(l, y + i, xa, w, s)
else
begin
skew := '';
if FUTF8Mode then
s := UTF8FormS(s,xa,w)
else if xa = 1 then
s := forms(s, w)
else
s := forms(Mid(s, xa), w);
FWrt(l, y + i, s);
end;
// wenn gefunden
if (slen > 0) and (spos >= xa) and (spos <= xa + w - slen) then
begin
attrtxt(col.colfound);
if (FirstLine + i = suchline) then
begin
if (skew='') then
FWrt(l + spos - xa, y + i, copy(s, spos, slen))
else
FWrt(l + spos-Ord(skew[spos]) - xa, y + i, copy(s, spos, slen));
end
else if (FirstLine + i = suchlineTo) then
FWrt(l, y + i, copy(s, xa, slen2-(xa-1)))
else if (FirstLine + i > suchline) and (FirstLine + i < suchlineTo) then
FWrt(l, y + i, copy(s, xa, Length(s)));
end;
inc(i);
end;
attrtxt(col.coltext);
SetCP437;
// clear rest of screen if not enough lines to display
if i < DispLines then clwin(l, l + w - 1, y + i, y + DispLines - 1);
mon;
if stat.vscroll then
begin
attrtxt(col.colscroll);
maus_showVscroller(true, false, stat.scrollx, y, y + DispLines - 1,
lines.count + 1, FirstLine + 1, DispLines,
vstart, vstop, _unit);
end;
with arrows do
if usearrows then
begin
if FirstLine = 0 then
begin
attrtxt(backattr);
mwrt(x, y1, backchr);
end
else
begin
attrtxt(arrowattr);
mwrt(x, y1, #30);
end;
if FirstLine + DispLines >= lines.count then
begin
attrtxt(backattr);
mwrt(x, y2, backchr);
end
else
begin
attrtxt(arrowattr);
mwrt(x, y2, #31);
end;
end;
end;
procedure clearmark;
var
i: Integer;
begin
for i := 0 to Lines.Count - 1 do
ClearMarkedFlag(i);
end;
procedure setmark;
var
n: Integer;
s: string;
begin
Clearmark;
for n := f7p to f8p do
begin
s := Lines[n];
if Assigned(FOnTestMark) then
begin
if FOnTestMark(s, true) then
SetMarkedFlag(n);
end
else
SetMarkedFlag(n);
end;
end;
procedure suchen(var rep: boolean; backward_search: Boolean = False; url_search: Boolean = False; LastURL: PString = nil);
var
found, brk: boolean;
pp: Integer;
sw: byte;
nftxt: atext;
mi: byte;
URL: boolean; // URL has been found
URLStart, URLEnd: integer; // URL start and end position in bytes
URLEndTmp: integer;
s: string;
line_adj: string;
suchstr_adj: string;
begin
if (LastURL <> nil) then
LastURL^ := '';
attrtxt(col.colstatus);
sw:=min(40,w-11);
nftxt:=sp(w);
mwrt(l,y+DispLines-1,nftxt);
if (url_search) then
begin
if not rep then
begin
mi:=invattr; invattr:=$70;
invattr:=mi;
SuchLine := iif(selbar,FSelLine,iif(slen>0,SuchLine,0));
Slen := 0;
end
end
else
begin
if not rep then
begin
mi:=invattr; invattr:=$70;
rdedtrunc:=false;
ld(l,y+DispLines-1, GetRes2(11,23),SuchstrAsVariable^,sw,1,true,brk);
if (brk) then
insearch := False;
backward_search := False;
rdedtrunc:=true;
invattr:=mi;
SuchLine := iif(selbar,FSelLine,iif(slen>0,SuchLine,0));
Slen := 0;
end
else
begin
brk:=false;
mwrt(l,y+DispLines-1,GetRes2(11,24));
end;
end;
if (not url_search) and (brk or (suchstr='')) then
begin
slen:=0; sposnext:=1;
display;
end
else
begin
found:=false;
while not found and (SuchLine>=0) and (SuchLine<Lines.Count) do
begin
if (url_search) then
begin
spos := sposnext;
s := mid(Lines[SuchLine],sposnext);
URL := FindUrl(s, URLStart, URLEnd);
if (not URL) then
pp := 0
else
begin
slen:=URLEnd-URLStart;
slen2 := 0;
SuchLineTo := SuchLine;
while (SuchLineTo < Lines.Count) and (not Lines.ContainsFlag(SuchLineTo,lsfLINEBREAK)) do
begin
Inc(SuchLineTo);
URLEndTmp := URLEnd;
s := s + Lines[SuchLineTo];
FindUrl(s, URLStart, URLEnd);
if (URLEnd = URLEndTmp) then
begin
Dec(SuchLineTo);
break;
end;
slen2 := slen2 + Length(Lines[SuchLineTo]);
end;
if (slen2 <> 0) then
begin
slen2 := slen2 - Length(Lines[SuchLineTo]);
slen2 := (URLEnd-URLStart) - (slen+slen2);
if (slen2 = 0) then
begin
Dec(SuchLineTo);
slen2 := Length(Lines[SuchLineTo]);
end;
end;
pp := URLStart;
if (LastURL <> nil) then
LastURL^ := Copy(s,URLStart,URLEnd-URLStart);
end;
end
else
begin
spos := sposnext;
line_adj := Lines[SuchLine];
suchstr_adj := suchstr;
if backward_search then
begin
line_adj := LeftStr(line_adj,sposnext-2);
line_adj := Reverse(line_adj);
suchstr_adj := Reverse(suchstr_adj);
end
else
line_adj := Mid(line_adj,sposnext);
if suchcase then
pp:=pos(suchstr_adj,line_adj)
else
pp:=pos(UpperCase(suchstr_adj),UpperCase(line_adj));
end;
if pp=0 then
begin
if backward_search then
begin
Dec(SuchLine);
if (SuchLine >= 0) then
sposnext:=Length(Lines[SuchLine])+2
else
sposnext:=1;
end
else
begin
Inc(SuchLine);
sposnext:=1;
end;
end
else
begin
if backward_search then
pp := 1 - pp - Length(suchstr_adj);
spos := sposnext - 1 + pp;
inc(sposnext,pp);
if (not url_search) then
begin
SuchLineTo := SuchLine;
slen:=length(suchstr);
end;
found:=true;
end;
end;
if not found then
begin
attrtxt(col.colstatus);
mwrt(l,y+DispLines-1,center(GetRes2(11,25),w-1));
slen:=0;
rep := False;
end
else
begin
if FirstLine + DispLines <= SuchLineTo then Inc(FirstLine,1 + SuchLineTo - (FirstLine + DispLines));
if SuchLine > FirstLine + DispLines then FirstLine := SuchLine;
if SuchLine < FirstLine then FirstLine := SuchLine;
if selbar then FSelLine := SuchLine;
while spos<xa do dec(xa,10);
while spos+slen>xa+w do inc(xa,10);
rep := True;
end;
end;
FreeRes;
end;
procedure listrot13;
var
i: Integer;
begin
for i := 0 to Lines.Count - 1 do
Lines[i] := DecodeRot13String(Lines[i]);
end;
procedure Maus_bearbeiten;
var xx,yy,i : integer;
inside : boolean;
new1st : integer;
begin
maus_gettext(xx,yy);
inside:=(xx>=l) and (xx<l+w) and (yy>=y) and (yy<y+DispLines);
if scrolling then
begin
if t=mausunleft then
scrolling:=false
else if yy<>scrollpos then
begin
if SelBar then
begin
New1st:=Scroll1st+(yy-ScrollPos)*
System.Round(1.0*Lines.Count/(Height-vstop+vstart));
FSelLine := MinMax(New1St,0,Lines.Count-1);
if FSelLine<FirstLine then FirstLine:=FSelLine;
if FSelLine>=FirstLine+DispLines then FirstLine:=FSelLine-DispLines+1;
end else // !SelBar
begin
New1st:=Scroll1st+(yy-ScrollPos)*_unit;
FirstLine := MinMax(New1St,0,Lines.Count-DispLines);
end; // !SelBar
end; // yy<>scrollpos
end else // !scrolling
if t=mauswheelup then
begin
if SelBar then
begin
FSelLine := MinMax(FSelLine-MausWheelStep,0,Max(0,Lines.Count-1));
if FSelLine<FirstLine then FirstLine:=FSelLine;
end else
FirstLine := MinMax(FirstLine-MausWheelStep,0,Max(0,Lines.Count-DispLines));
end else
if t=mauswheeldn then
begin
if SelBar then
begin
FSelLine := MinMax(FSelLine+MausWheelStep,0,Max(0,Lines.Count-1));
if FSelLine>=FirstLine+DispLines then FirstLine:=FSelLine-DispLines+1;
end else
FirstLine := MinMax(FirstLine+MausWheelStep,0,Max(0,Lines.Count-DispLines));
end else
if t=mausunright then
t:=keyesc
else
if (t=mausleft) or (t=mausldouble) or (t=mauslmoved) or
(not inside and mausdown and ((t=keyup) or (t=keydown))) then
begin
if (inside or (mausdown and ((t=keyup) or (t=keydown)) )) and
(stat.markswitch or selbar) then
begin
if t=keyup then FirstLine:=Max(FirstLine-1,0) else
if t=keydown then FirstLine:=Min(FirstLine+1,Max(0,Lines.Count-1));
FSelLine:=MinMax(MinMax(yy-y+FirstLine,FirstLine,FirstLine+DispLines-1),0,Max(0,Lines.Count-1));
if not SelBar then begin
oldselb:=false;
FSelbar:=true;
Stat.markable:=true;
end;
if not mausdown then
begin
if (yy-y+FirstLine<0) or
(yy-y+FirstLine>Lines.Count-1) then exit;
mausdown:=true;
oldmark := Marked[FSelLine];
Marked[FSelLine]:=not oldmark;
scrollpos:=FSelLine;
end;
if ScrollPos<FSelLine then
for i:=ScrollPos+1 to FSelLine do
Marked[i]:=not oldmark
else if ScrollPos>FSelLine then
for i:=ScrollPos-1 downto FSelLine do
Marked[i]:=not oldmark;
scrollpos:=FSelLine;
end else
if ((t=mausleft) or (t=mausldouble)) and
(xx=stat.scrollx) and (yy>=y) and (yy<y+Height-1) then
begin
if yy<vstart then
t:=keypgup
else
if yy>vstop then
t:=keypgdn
else
begin
scrolling:=true;
scrollpos:=yy;
scroll1st:=iif(SelBar,FSelLine,FirstLine);
end;
end;
end else
if (t=mausunleft) then
begin
if stat.directmaus and mausdown and inside then
t:=keycr;
if mausdown then
begin
FSelBar:=OldSelb;
OldSelB:=true;
mausdown:=false;
end;
end;
end;
var
UrlString: String;
UrlStart, UrlEnd: Integer;
DosExitCode: Integer;
rep: Boolean;
LastURL: string;
begin // Show
Debug.Debuglog('lister','TLister.Show',DLTrace);
sposnext := 1;
startpos := minmax(startpos, 0, Lines.Count - 1);
DispLines := Height - iif(stat.statline, 1, 0);
if UTF8Mode then
begin
OldTCS := GetConsoleOutputCharset;
OldLCS := GetLogicalOutputCharset;
SetConsoleOutputCharset(csUTF8);
SetLogicalOutputCharset(csInternal);
end;
if startpos > DispLines then
begin
FirstLine := startpos; FSelLine := StartPos;
end
else
begin
FirstLine := 0; FSelLine := Startpos;
end;
xa := 1;
y := o + iif(stat.statline, 1, 0);
if stat.statline then
begin
attrtxt(col.colstatus);
mwrt(l, o, sp(w));
mwrt(l + w - length(HeaderText), o, HeaderText);
end;
attrtxt(col.coltext);
clwin(l, l + w - 1, y, y + DispLines - 1);
suchline := 0; slen := 0;
f7p := 1; f8p := 0;
mzo := mauszuo; mzu := mauszuu;
mzl := mauszul; mzr := mauszur;
// mausdown := false;
maus_pushinside(l, l + w - 2, y + 1, y + DispLines - 2);
mb := InOut.AutoBremse; AutoBremse := true;
scrolling := false;
mausdown := false;
oldselb := true; {!}
rep := false;
repeat
if SelBar then
begin
FSelLine := MinMax(FSelLine, 0, Lines.Count -1);
while assigned(FOnTestSelect) and not FOnTestSelect(Lines[FSelLine],true) do
begin
if FSelLine < Lines.Count - 1 then Inc(FSelLine) else break;
if FirstLine + DispLines - 1 < FSelLine then Inc(FirstLine);
end;
while assigned(FOnTestSelect) and not FOnTestSelect(Lines[FSelLine],true) do
begin
if FSelLine > 0 then Dec(FSelLine) else break;
end;
FirstLine := Min(FirstLine, FSelLine);
FirstLine := Max(FirstLine, FSelLine-DispLines +1);
FirstLine := Max(FirstLine, 0);
end else
begin
FirstLine := Min(FirstLine,Lines.Count-1);
FirstLine := Max(FirstLine,0);
end;
display;
showstat;
if Assigned(FOnShowLines) then FOnShowLines(GetSelection);
mauszuo:=false; // (pl<>nil) and (pl^.prev<>nil);
mauszuu:=false; // (pl<>nil) and (pl^.next<>nil);
mauszul := false; mauszur := false;
if (FirstLine = 0) or (_mausy > y) then AutoUp := false;
if (FirstLine + DispLines > lines.count - 1) or (_mausy < y + DispLines -
1) then AutoDown := false;
if mcursor and selbar then
begin
gotoxy(l, y + FSelLine - FirstLine);
get(t, curon);
end
else
get(t, curoff);
{$IFDEF Win32 }
if t = keyf11 then
begin
UrlString := FirstMarked;
if FindUrl(UrlString, UrlStart, UrlEnd) then
begin
UrlString := '"' + Copy(UrlString, UrlStart, UrlEnd-UrlStart) + '"';
Debug.DebugLog('Lister', 'Call lister.* with ' + UrlString, dlInform);
if fileexists('lister.cmd') then
RTLExec('lister.cmd', UrlString, DosExitCode, false)
else
if fileexists('lister.bat') then
RTLExec('lister.bat', UrlString, DosExitCode, false);
end else
ErrSound;
end;
{$ENDIF }
mauszuo := mzo; mauszuu := mzu;
mauszul := mzl; mauszur := mzr;
if ((t>=mausfirstkey) and (t<=mauslastkey)) or mausdown then
Maus_bearbeiten;
if Assigned(FonKeyPressed) then
Debug.Debuglog('lister','TLister.Show, calling FOnKeyPressed(Self, t)',DLTrace);
if Assigned(FonKeyPressed) then FOnKeyPressed(Self, t);
if Lines.Count > 0 then
begin { Liste nicht leer }
s := Lines[FSelLine];
if stat.markable and (t = ' ') and
(not Assigned(FOnTestMark) or FOnTestMark(s, false)) then
begin
if Marked[FSelLine] then
ClearMarkedFlag(FSelLine)
else
SetMarkedFlag(FSelLine);
t := keydown;
end;
if (t = ' ') and not stat.markable and not selbar then
t := keypgdn;
if stat.maysearch and ((UpperCase(t) = 'S') or (t = '/') or (t = '\') or (t = keytab) or (insearch and (t = keystab)))
then
begin
if (t = keystab) then
suchen(rep,true)
else if (t = keytab) then
begin
if insearch then
suchen(rep)
else
suchen(rep,false,true,@LastURL)
end
else
begin
insearch := true;
suchcase := (t = 'S') or (t = '\');
rep := false;
suchen(rep);
end;
if (rep = False) then
begin
FirstLine := 0;
FSelLine := 0;
slen := 0;
end;
end;
if stat.maysearch and (LastURL <> '') then
begin
if (UpperCase(t) = k4_C) then
begin
String2Clip(LastURL);
message (GetRes2(11,26) + ' ' + LastURL);
wkey(1,false);
closebox;
end
else if (((t = keycr) and not stat.endoncr) or ((t = keyaltcr) and stat.endoncr)) and (ListURLViewer <> '') then
begin
t := '';
XPWinShell(ListURLViewer + ' "'+LastURL+'"','',600,1,False);
end;
end;
// key up
if (t = keyup) and not mausdown then
if SelBar then
FSelLine := FSelLine - 1
else
FirstLine := FirstLine - 1
else
// key down
if (t = keydown) and not mausdown then
begin
if SelBar then
FSelLine := FSelLine + 1
else
if FirstLine + DispLines < Lines.Count then
FirstLine := FirstLine + 1
end else
// goto first line of text
if (t = keyhome) or (t = keycpgu) then
begin
FirstLine := 0;
FSelLine := 0;
slen := 0;
end else
// goto last line of text
if t = keypgup then
begin
if SelBar then
FSelLine := FSelLine - DispLines;
FirstLine := FirstLine - DispLines;
end else
if t = keypgdn then
begin
if SelBar then
FSelLine := FSelLine + DispLines;
if FirstLine + DispLines < Lines.Count -1 then
FirstLine := FirstLine + DispLines;
end else
if t = keychom then
FirstLine := 0
else
if (t = keyend) then
begin
if Selbar then
FSelLine := Lines.Count - 1
else
if FirstLine + DispLines < Lines.Count -1 then
FirstLine := Lines.Count - DispLines;
end else
if not stat.noshift then
begin
if ((t = keyrght) or (t = keycrgt)) and (xa < 180) then inc(xa, 10);
if ((t = keyleft) or (t = keyclft)) and (xa > 1) then dec(xa, 10);
{ if t=keyclft then xa:=1;
if t=keycrgt then xa:=181; }
end;
if t = ^E then
begin
clearmark;
slen := 0;
end;
if stat.markable then
begin
if t = keyf7 then
begin
f7p := FSelLine;
setmark;
end;
if t = keyf8 then
begin
f8p := FSelLine;
setmark;
end;
end;
if (stat.markable or stat.markswitch) and (t = ^A)
and not stat.noctrla then
begin
f7p := 0; f8p := lines.count - 1;
setmark;
end;
if (UpperCase(t) = 'M') and stat.markswitch then
begin
Fselbar := not FSelbar;
stat.markable := Selbar;
// move Selbar between first and last line in Screen
FSelLine := MinMax(FSelLine, FirstLine, FirstLine + DispLines);
end;
if stat.rot13enable and (t = ^R) then
ListRot13;
if (t = keycr) and not stat.endoncr and Assigned(FOnEnter) then
begin
FOnEnter(Lines[FSelLine]);
t := '';
end;
end;
until (t = keyesc) or
((t = keycr) and ((selbar) or stat.endoncr));
maus_popinside;
AutoBremse := mb;
Result := (t = keyesc);
if UTF8Mode then
begin
SetConsoleOutputCharset(OldTCS);
SetLogicalOutputCharset(OldLCS);
end;
if Result then
FSelLine := - 1;
Debug.Debuglog('lister','TLister.Show, End',DLTrace);
end;
procedure TLister.SetHeaderText(s: string);
begin
FHeaderText := LeftStr(s, 40);
end;
const
SuchstrCP437: string = '';
SuchstrChanged: Boolean = False;
SuchstrUTF8: string = '';
function TLister.SuchstrAsVariable: pstring;
begin
Result := @SuchstrCP437;
SuchstrChanged := True;
end;
function TLister.Suchstr: string;
begin
if (UTF8Mode) then
begin
if (SuchstrChanged) then
begin
SuchstrUTF8 := CP437ToUTF8.Encode(SuchstrCP437);
SuchstrChanged := False;
end;
Result := SuchstrUTF8;
end
else
Result := SuchstrCP437;
end;
procedure TLister.SetArrows(x, y1, y2, acol, bcol: byte; backchr: char);
begin
arrows.x := x;
arrows.y1 := y1; arrows.y2 := y2;
arrows.arrowattr := acol;
arrows.backattr := bcol;
arrows.backchr := backchr;
arrows.usearrows := true;
end;
function TLister.FirstMarked: string;
begin
MarkPos := 0;
if SelCount = 0 then
Result := GetSelection
else
begin
while (MarkPos < Lines.Count) and (not Marked[MarkPos]) do
Inc(MarkPos);
if MarkPos = Lines.Count then
Result := #0
else
Result := Lines[MarkPos];
end;
FLinePos := MarkPos;
end;
function TLister.NextMarked: string;
begin
Inc(MarkPos);
while (MarkPos < Lines.Count) and (not Marked[MarkPos]) do
Inc(MarkPos);
if MarkPos >= Lines.Count then
Result := #0
else
Result := Lines[MarkPos];
FLinePos := MarkPos;
end;
function TLister.GetSelection: string;
begin
if FSelLine <> -1 then
Result := Lines[FSelLine]
else
Result := '';
end;
function TLister.FirstLine: string;
begin
if lines.count = 0 then
begin
Result := #0;
FLinePos := -1;
end else
begin
FLinePos := 1;
Result := Lines[0];
end;
end;
function TLister.NextLine: string;
begin
if (FLinePos = -1) or (FLinePos >= Lines.Count) then
Result := #0
else
begin
Result := Lines[FLinePos];
Inc(FLinepos);
end;
end;
function TLister.PrevLine: string;
begin
if (FLinePos >= Lines.Count) or (FLinePos < 0) then
Result := #0
else
begin
Result := Lines[FLinePos];
Dec(FLinePos);
end;
end;
procedure TLister.UnmarkLine;
begin
ClearMarkedFlag(FLinePos);
end;
initialization
with ListColors do
if color then
begin
coltext := 7;
colselbar := $30;
colmarkline := green;
colmarkbar := $30 + green;
colfound := $71;
colstatus := 3;
colsignatur := 7;
end
else
begin
coltext := 7;
colselbar := $70;
colmarkline := $F;
colmarkbar := $70;
colfound := 1;
colstatus := $F;
colsignatur := $F;
end;
finalization
{
$Log: lister.pas,v $
Revision 1.95 2004/01/15 01:32:34 mk
- fixed NextLine: Last Line was deleted
Revision 1.94 2003/10/02 20:50:12 cl
- TLister.OnDisplay now gets the full line to be displayed
- tweaks and optimisations for xp1.ListDisplay
Revision 1.93 2003/09/29 20:47:12 cl
- moved charset handling/conversion code to xplib
Revision 1.92 2003/09/28 11:00:30 mk
- removed unused variable in ReadFromFile
Revision 1.91 2003/09/25 20:27:39 cl
- BUGFIX: UTF8Mid works with characters, not columns => use extended version
of UTF8FormS for lister.
Revision 1.90 2003/09/21 20:17:39 mk
- rewrite of Listdisplay:
removed Assemlber function MakeListDisplay, now
recoded in Pascal in ListDisplay
- use Integer instead of xpWord in TListerDisplayLineEvent
- removed global Variable CharBuf
- new parameters for ConsoleWrite, removed CharBuf support
- Highlight Lines with URL in Lister
- Added support for Highlighting in Lister with Unicode-Display
Revision 1.89 2003/09/11 22:30:04 mk
- added special color for signatures
Revision 1.88 2003/08/26 01:30:22 mk
- improved display of actual line in lister (showstat)
Revision 1.87 2003/08/21 18:41:25 cl
- some fixes for last commits
Revision 1.86 2003/08/20 20:39:21 cl
- fixed one more "list index out of bounds" error
Revision 1.85 2003/08/20 18:24:21 cl
- fixed several off-by-one errors in lister component
Revision 1.84 2003/08/05 23:34:34 cl
- xpunicode_linebreak was too long unit name for FPC/1.0.6 on Linux
Revision 1.83 2003/05/10 15:44:30 mk
- show two more lines when listing messages after PgDown
Revision 1.82 2003/05/01 10:53:59 mk
- restored correct page down handling, when stat.allpgdn = true
Revision 1.81 2003/04/28 20:18:57 cl
- CRLF at the end of a text file is now uniformly handled as the start of
an additional line.
Revision 1.80 2003/04/03 15:56:00 mk
- added handling ofs in TLister.ReadFromFile,
this fixes problem with double header in messages
Revision 1.79 2003/03/16 19:02:05 cl
- initial support for langage files in encodings different from CP437
Revision 1.78 2003/02/13 14:41:57 cl
- implemented correct display of UTF8 in the lister
- implemented Unicode line breaking in the lister
Revision 1.77 2003/01/07 00:20:37 cl
- added OnTestSelect event
Revision 1.76 2002/12/21 05:37:50 dodi
- removed questionable references to Word type
Revision 1.75 2002/12/14 09:25:17 dodi
- removed gpltools and encoder units
Revision 1.74 2002/12/14 07:31:27 dodi
- using new types
Revision 1.73 2002/12/12 11:58:40 dodi
- set $WRITEABLECONT OFF
Revision 1.72 2002/12/04 16:56:58 dodi
- updated uses, comments and todos
Revision 1.71 2002/08/01 17:21:18 mk
- fixed TLister.NextMarked: AV when Lines.Count = 0 and MarkPos = 1
Revision 1.70 2002/05/30 13:28:33 mk
- added automatic UTF-8 detection to lister
Revision 1.69 2002/04/07 18:36:40 mk
- fixed some with newsgroup lists
Revision 1.68 2002/04/06 18:37:45 mk
- fixed Ctrl-A in Lister (bug in setmark)
Revision 1.67 2002/03/03 15:45:54 cl
- changed TListerColorEvent's first parameter from var => const
Revision 1.66 2002/01/29 11:47:38 mk
- fixed crash in getline (xp1o.pas)
Revision 1.65 2002/01/03 19:19:13 cl
- added and improved UTF-8/charset switching support
Revision 1.64 2001/12/30 19:56:48 cl
- Kylix 2 compile fixes
Revision 1.63 2001/10/22 21:55:46 cl
- killed more range check errors
Revision 1.62 2001/10/20 17:26:39 mk
- changed some Word to Integer
Word = Integer will be removed from xpglobal in a while
Revision 1.61 2001/10/20 17:12:36 ml
- range check errorfix
- removed some hints and warnings
- corrected debuglog
- 2 more keytranslations for xterm
Revision 1.60 2001/10/10 20:38:52 mk
- removed (unnecessary) ScreenWidth from Lister option VSC
- use correct scrollbar position with more than 80 screen columns
- show scrollbar only if listscroller is enabled
Revision 1.59 2001/09/26 23:34:18 mk
- fixed FPC compile error with newest snapshot:
Error: Self can only be an explicit parameter in message handlers or class methods
Revision 1.58 2001/09/20 18:28:23 cl
- mouse support in message lister
Revision 1.57 2001/09/15 19:54:56 cl
- compiler-independent mouse support for Win32
Revision 1.56 2001/09/10 15:58:01 ml
- Kylix-compatibility (xpdefines written small)
- removed div. hints and warnings
Revision 1.55 2001/09/08 16:29:29 mk
- use FirstChar/LastChar/DeleteFirstChar/DeleteLastChar when possible
- some AnsiString fixes
Revision 1.54 2001/07/31 16:18:39 mk
- removed some unused variables
- changed some LongInt to DWord
- removed other hints and warnings
Revision 1.53 2001/07/28 12:04:08 mk
- removed crt unit as much as possible
Revision 1.52 2001/07/21 13:44:36 mk
- Added TLister method UnmarkLine
Revision 1.51 2001/05/27 18:22:46 ma
- fixed: selection bar did not work properly
Revision 1.50 2001/04/07 11:37:25 ma
- "search" function now working as usual
Revision 1.49 2001/02/03 08:45:07 mk
- published lines property
Revision 1.48 2001/01/03 08:01:49 mo
-Richtige Positionierung des cursors und der Zeilenposition bei Suche –S-
Revision 1.47 2000/12/26 16:40:27 mk
- readded search function
Revision 1.46 2000/12/26 12:10:00 mk
- fixed a litte bug in pgend
Revision 1.45 2000/12/26 09:44:48 mk
- fixed some more bugs
Revision 1.44 2000/12/25 22:50:45 mk
- MarkPos in FirstMarked should be 0
Revision 1.43 2000/12/25 20:40:24 mk
- fixed FirstMarked
Revision 1.42 2000/12/25 20:30:20 mk
- test if Event functions are not nil
Revision 1.41 2000/12/25 14:02:40 mk
- converted Lister to class TLister
Revision 1.40 2000/12/22 10:09:04 mk
- compatiblity update for fpc
Revision 1.39 2000/12/22 10:04:33 mk
- nearly complete rewrite
}
end.