Source

GoFish4 / Forms / gofish_results.SCA

Full commit
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
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
SCCTEXT Version 4.0.0.2
PLATFORM C(8,0),UNIQUEID C(10,0),TIMESTAMP N(10,0),CLASS M(4,0),CLASSLOC M(4,0),BASECLASS M(4,0),OBJNAME M(4,0),PARENT M(4,0),PROPERTIES M(4,0),PROTECTED M(4,0),METHODS M(4,0),OBJCODE M(4,0),OLE M(4,0),OLE2 M(4,0),RESERVED1 M(4,0),RESERVED2 M(4,0),RESERVED3 M(4,0),RESERVED4 M(4,0),RESERVED5 M(4,0),RESERVED6 M(4,0),RESERVED7 M(4,0),RESERVED8 M(4,0),USER M(4,0)
1252

[ RECORD]
[PLATFORM] COMMENT 
[UNIQUEID] Screen    
[START RESERVED1]
VERSION =   3.00[END RESERVED1]
[START RESERVED8]
..\lib\gofish.h[END RESERVED8]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] dataenvironment
[BASECLASS] dataenvironment
[OBJNAME] Dataenvironment
[START PROPERTIES]
DataSource = .NULL.
Height = 0
Left = 0
Name = "Dataenvironment"
Top = 0
Width = 0
[END PROPERTIES]
[START RESERVED2]
1[END RESERVED2]
[START RESERVED4]
2[END RESERVED4]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _0AT01N151
[CLASS] form
[BASECLASS] form
[OBJNAME] gofish
[START PROPERTIES]
AllowOutput = .F.
BorderStyle = 3
Caption = "GoFish 4.1"
DataSession = 2
DoCreate = .T.
Dockable = 0
FontName = "Tahoma"
Height = 600
KeyPreview = .T.
Left = 15
MaxWidth = -1
MinHeight = 425
MinWidth = 900
Name = "gofish"
ShowTips = .T.
TabStop = .T.
Top = 5
Visible = .T.
Width = 1000
WindowState = 2
WindowType = 0
_memberdata =     6279<VFPData><memberdata name="width" display="Width"/><memberdata name="height" display="Height"/><memberdata name="seterror" display="SetError"/><memberdata name="osearchengine" display="oSearchEngine"/><memberdata name="formatgrid" display="FormatGrid"/><memberdata name="csearchresultsalias" display="cSearchResultsAlias"/><memberdata name="caption" display="Caption"/><memberdata name="sortcolumn" display="SortColumn"/><memberdata name="restoresearchengineoptions" display="RestoreSearchEngineOptions"/><memberdata name="csearchoptionsxmlfile" display="cSearchOptionsXMLFile"/><memberdata name="cuisettingsfile" display="cUISettingsFile"/><memberdata name="loadformsettings" display="LoadFormSettings"/><memberdata name="saveformsettings" display="SaveFormSettings"/><memberdata name="ogrid" display="oGrid"/><memberdata name="restoredefaultdir" display="RestoreDefaultDir"/><memberdata name="cinitialdefaultdir" display="cInitialDefaultDir"/><memberdata name="dosearch" display="DoSearch"/><memberdata name="fillsearchresultscursor" display="FillSearchResultsCursor"/><memberdata name="updateformaftersearch" display="UpdateFormAfterSearch"/><memberdata name="clearsearchresultscursor" display="ClearSearchResultsCursor"/><memberdata name="validateinputs" display="ValidateInputs"/><memberdata name="chtmlcodeviewfilename" display="cHtmlCodeViewFilename"/><memberdata name="showhtmlcodeview" display="ShowHtmlCodeView"/><memberdata name="cbrowseproject" display="cBrowseProject"/><memberdata name="ccurrentdir" display="cCurrentDir"/><memberdata name="setpath" display="SetPath"/><memberdata name="setproject" display="SetProject"/><memberdata name="cactiveproject" display="cActiveProject"/><memberdata name="top" display="Top"/><memberdata name="ncurrentid" display="nCurrentId"/><memberdata name="obrowser" display="oBrowser"/><memberdata name="nbrowserzoom" display="nBrowserZoom"/><memberdata name="editfile" display="EditFile"/><memberdata name="createindex" display="CreateIndex"/><memberdata name="restoreindex" display="RestoreIndex"/><memberdata name="findcolumn" display="FindColumn"/><memberdata name="updatesearchscopevariables" display="UpdateSearchScopeVariables"/><memberdata name="showcodeforcurrentrow" display="ShowCodeForCurrentRow"/><memberdata name="lsearchformvisible" display="lSearchFormVisible"/><memberdata name="populatetreeview" display="PopulateTreeview"/><memberdata name="expandallnodes" display="ExpandAllNodes"/><memberdata name="otree" display="oTree"/><memberdata name="cfilter" display="cFilter"/><memberdata name="csortorder" display="cSortOrder"/><memberdata name="csortfields" display="cSortFields"/><memberdata name="ngridfontsize" display="nGridFontSize"/><memberdata name="addclassestotreeview" display="AddClassesToTreeView"/><memberdata name="navigatetomasterrecord" display="NavigateToMasterRecord"/><memberdata name="getcurrentscope" display="GetCurrentScope"/><memberdata name="showoptionsform" display="ShowOptionsForm"/><memberdata name="showfilterform" display="ShowFilterForm"/><memberdata name="lsearching" display="lSearching"/><memberdata name="showform" display="ShowForm"/><memberdata name="showhelpform" display="ShowHelpForm"/><memberdata name="showhtml" display="ShowHtml"/><memberdata name="setcaption" display="SetCaption"/><memberdata name="search" display="Search"/><memberdata name="linit" display="lInit"/><memberdata name="viewreport" display="ViewReport"/><memberdata name="owebcontrol" display="oWebControl"/><memberdata name="csearchresultsmessage" display="cSearchResultsMessage"/><memberdata name="cresultsmessage" display="cResultsMessage"/><memberdata name="updatetreeview" display="UpdateTreeView"/><memberdata name="lapplyfilter" display="lApplyFilter"/><memberdata name="applyfilter" display="ApplyFilter"/><memberdata name="lreplaceformvisible" display="lReplaceFormVisible"/><memberdata name="showreplacepanel" display="ShowReplacePanel"/><memberdata name="lreplacemode" display="lReplaceMode"/><memberdata name="lreplacemode_assign" display="lReplaceMode_Assign"/><memberdata name="updatesearchenginecursor" display="UpdateSearchEngineCursor"/><memberdata name="nreplacerisk" display="nReplaceRisk"/><memberdata name="validatereplaceexpression" display="ValidateReplaceExpression"/><memberdata name="replaceline" display="ReplaceLine"/><memberdata name="confirmreplace" display="ConfirmReplace"/><memberdata name="creplaceline" display="cReplaceLine"/><memberdata name="updateformaftereplace" display="UpdateFormAfteReplace"/><memberdata name="loadreplaceline" display="LoadReplaceLine"/><memberdata name="formatgridforreplacemode" display="FormatGridForReplaceMode"/><memberdata name="adjustformforreplacepanel" display="AdjustFormForReplacePanel"/><memberdata name="clearall" display="ClearAll"/><memberdata name="filtergfse" display="FilterGFSE"/><memberdata name="cleargfsefilter" display="ClearGFSEFilter"/><memberdata name="checkall" display="CheckAll"/><memberdata name="cdonotrenderextensions" display="cDoNotRenderExtensions"/><memberdata name="noriginalsearchscope" display="nOriginalSearchScope"/><memberdata name="nreplacemode" display="nReplaceMode"/><memberdata name="creplaceudffilename" display="cReplaceUDFFilename"/><memberdata name="showgofishhelppage" display="ShowGoFishHelpPage"/><memberdata name="showreplacehistory" display="ShowReplaceHistory"/><memberdata name="doreplace" display="DoReplace"/><memberdata name="replace" display="Replace"/><memberdata name="nreplacemode_assign" display="nReplaceMode_Assign"/><memberdata name="formatprocesscolumn" display="FormatProcessColumn"/><memberdata name="nsplitterposratio" display="nSplitterPosRatio"/><memberdata name="osearchoptions" display="oSearchOptions"/><memberdata name="showadvancedform" display="ShowAdvancedForm"/><memberdata name="lautoyield" display="lAutoYield"/><memberdata name="setscope" display="SetScope"/><memberdata name="setsearchexpression" display="SetSearchExpression"/><memberdata name="lsavesettings" display="lSaveSettings"/><memberdata name="z_lincludesubdirectoriesbrowsed" display="z_lIncludeSubDirectoriesBrowsed"/><memberdata name="z_lincludesubdirectoriescurrent" display="z_lIncludeSubDirectoriesCurrent"/><memberdata name="ndropdowndisplaycount" display="nDropDownDisplayCount"/></VFPData>
cactiveproject = 
cbrowseproject = 
ccurrentdir = 
cdonotrenderextensions = (' DOC DOCX XLS XLXS PDF CHM ')
cfilter = 
chtmlcodeviewfilename = 
cinitialdefaultdir = 
creplaceline = 
creplaceudffilename = 
cresultsmessage = 
csearchoptionsxmlfile = ( Home(7) + 'GF_Search_Settings.xml')
csearchresultsalias = csrSummarySearchResults
csearchresultsmessage = 
csortfields = 
csortorder = 
cuisettingsfile = ( Home(7) + 'GF_Results_Form_Settings.xml')
lapplyfilter = .F.
lautoyield = .F.
linit = .F.
lreplaceformvisible = .F.
lreplacemode = .F.
lsavesettings = .T.
lsearchformvisible = .F.
lsearching = .F.
nbrowserzoom =          0.9
ncurrentid = 0
ndropdowndisplaycount = 30
ngridfontsize = 8
noriginalsearchscope = 0
nreplacemode = 0
nreplacerisk = 1
nsplitterposratio = 0
obrowser = .NULL.
ogrid = .NULL.
osearchengine = .NULL.
osearchoptions = .NULL.
otree = .NULL.
owebcontrol = .NULL.
z_lincludesubdirectoriesbrowsed = .T.
z_lincludesubdirectoriescurrent = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE Activate
Local lcApp, lcClassLib, lcScope

Thisform.lAutoYield = _VFP.AutoYield
_VFP.AutoYield = .T.

lcApp = ''

Try
	lcApp = _Screen._GoFish.cAppPath + _Screen._GoFish.cAppName
Catch
	MessageBox('Error: Cannot find _Screen._GoFish object.', 0, 'GoFish error:')
Endtry

*-- Need to restore the ClassLibs in case the user clears out the Set ClassLib while outside of this form
lcClassLib = 'GoFishSearchEngine'
If !Empty(lcApp)
	If !(Upper(lcClassLib) $ Upper(Set('ClassLib')))
		Try
			Set Classlib To &lcClassLib in (lcApp) Additive
		Catch
			MessageBox('Cannot restore classlib ' + lcClassLib, 0, 'GoFish error:')
		EndTry
	Endif
	
	lcClassLib = 'GF_PEME_BaseTools'
	If !(Upper(lcClassLib) $ Upper(Set('ClassLib')))
		Try
			Set Classlib To &lcClassLib in (lcApp) Additive 
		Catch
			MessageBox('Cannot restore classlib ' + lcClassLib, 0, 'GoFish error:')
		EndTry
	Endif
Endif

ThisForm.UpdateSearchScopeVariables()

lcScope = Thisform.GetCurrentScope()

With Thisform.comboSearchScopeHistory
	.LoadRows()
	.SaveSearchScope(lcScope)
	.Value = Lower(lcScope)
Endwith

Set Talk Off && Just in case user has turn this on somehow or accidentally
Set Echo Off
Set Exact On
Set Deleted On

Set Safety Off

Thisform.comboSearchExpressionHistory.Requery()


*--- Update UDF info on Advanced Replace stuff ------------------
If !Empty(Thisform.cReplaceUDFFilename) and File(Thisform.cReplaceUDFFilename)
	Thisform.oSearchEngine.cReplaceUDFCode = FileToStr(Thisform.cReplaceUDFFilename)
Else
	Thisform.cReplaceUDFFilename = ''
	Thisform.oSearchEngine.cReplaceUDFCode = ''
Endif

If Thisform.nReplaceMode = 3 && Update the Replace lines, in case the UDF has been modified.
	Thisform.DoReplace(.t.)
Endif


Thisform.Refresh()

 
  
ENDPROC
PROCEDURE Deactivate
_VFP.AutoYield = Thisform.lAutoYield
ENDPROC
PROCEDURE Destroy
DoDefault()

*-- Restore nSearchScope to original value if the Scope combo was used to make temporary selection ---------
If This.oSearchEngine.oSearchOptions.nSearchScope = 5
	This.oSearchEngine.oSearchOptions.nSearchScope = Evl(thisform.nOriginalSearchScope, 3)
EndIf

If Thisform.lSaveSettings
	This.SaveFormSettings()
	This.oSearchEngine.SaveOptions(This.cSearchOptionsXMLFile)
Endif

This.oSearchOptions = .null.
This.oSearchEngine = .Null.
This.oGrid = .Null.
This.oBrowser = .null.
This.oTree = .null.
This.oWebControl = .null.

Release _Screen._GoFish
_Screen._GoFish = .null.







ENDPROC
PROCEDURE Init
Lparameters tcProject

Local loGrid, loSearchEngine, loSearchOptions

Set Talk Off
Set Echo Off
Set Century On

_Screen._GoFish.oResultsForm = this

This.Caption = 'GoFish ' + JustStem(_Screen._GoFish.cVersion)

This.oBrowser = Thisform.containerRight.Container2.containerWebControl.oBrowser

loSearchEngine = This.oSearchEngine
loSearchOptions = loSearchEngine.oSearchOptions
loGrid = Thisform.containerRight.Container1.gridFiles

tcProject = Evl(tcProject, '')

Thisform.UpdateSearchScopeVariables()

*-- Create a local GF results cursor from GFSE cursor, then bind the grid to it
loGrid.ColumnCount = Fcount(Thisform.cSearchResultsAlias)
loGrid.RecordSource = (Thisform.cSearchResultsAlias)
Thisform.Refresh()
Thisform.FormatGrid()

loSearchEngine.LoadOptions(This.cSearchOptionsXMLFile) && Load search settings from previous session
Thisform.nOriginalSearchScope = loSearchOptions.nSearchScope 
loSearchEngine.oSearchOptions.lIncludeAllFileTypes = .f. && Deprecated feature. Set to .f. to handle old XML files
loSearchEngine.oProgressBar = This.ProgressBar

ThisForm.RestoreIndex() && Must be called AFTER saved search options are loaded in from XML file

With loSearchOptions
	.lStoreCode = .T.
	.lCreateResultsCollection = .F.
Endwith

*-- Load some default setting from form properties, then load stored settings from XML file
loGrid.FontSize = Thisform.nGridFontSize 
This.oTree.Font.Size = Thisform.nGridFontSize 
This.containerRight.Container2.containerWebControl.nZoom = This.nBrowserZoom
This.LoadFormSettings() && Form size and position, as well as a few custom properties that are store on the form

*-- Add previous stored project...
If !Empty(loSearchOptions.cProject) and File(loSearchOptions.cProject)
	loSearchEngine.SetProject(loSearchOptions.cProject)
EndIf

*-- Add passed in Project...
If !Empty(tcProject)
	If 'PJX' $ Upper(tcProject)
		loSearchOptions.nSearchScope = 2
		If File(tcProject)
			loSearchEngine.SetProject(FullPath(tcProject))
		Else
			MessageBox('Passed project [' + tcProject + '] cannot be found.', 0, 'GoFish')
		EndIf
	Else
		loSearchOptions.nSearchScope = 4
		loSearchEngine.oSearchOptions.cPath = tcProject
	Endif
EndIf

If Thisform.lApplyFilter = .t.
	Thisform.ApplyFilter()
Endif

ThisForm.PopulateTreeview()

Thisform.oBrowser.Setfocus() && A trick to make the web control appear on the page,
							 && otherwise, it's doesn't appear properly at startup.
Thisform.SetCaption(Thisform.containerRight.container1.lblResults, '')

For Each loColumn in Thisform.oGrid.Columns
	BindEvent(loColumn.Header1, 'Click', Thisform, 'SortColumn')
Endfor

Thisform.editSearch.SetFocus()
Thisform.editSearch.InteractiveChange()

*-- Ensure that the current scope is in the SearchScopeHistory table
With Thisform.comboSearchScopeHistory
	.LoadProjects(This.oSearchEngine.oProjects)
	.SaveSearchScope(Lower(Thisform.GetCurrentScope()))
Endwith

Thisform.Refresh()

DoDefault()

If loSearchOptions.lShowAdvancedFormOnStartup
	Thisform.timerShowAdvancedForm.Interval = 100
Endif

This.lInit = .t.

ENDPROC
PROCEDURE KeyPress
Lparameters nKeyCode, nShiftAltCtrl

If Thisform.lSearching = .F. And nKeyCode = 27
	Thisform.Release()
Endif



ENDPROC
PROCEDURE Load
Set Talk Off
Set Echo Off

Thisform.lAutoYield = _VFP.AutoYield
_VFP.AutoYield = .T.


DoDefault()

This.Top = -2000 && See comments in LoadFormSettings() for explanation of this...

This.cInitialDefaultDir = Addbs(Sys(5) + Sys(2003))

This.oSearchEngine = Createobject('GoFishSearchEngine')
This.oSearchOptions = This.oSearchEngine.oSearchOptions

This.cActiveProject = Thisform.oSearchEngine.GetActiveProject()

This.FillSearchResultsCursor()

This.cHtmlCodeViewFilename = Addbs(Sys(2023)) + This.cSearchResultsAlias + '.html'

If This.Top < 0 && Just in case the above -2000 didn't get reset properly in LoadFormSettings()
	This.Top = 0
Endif


ENDPROC
PROCEDURE LostFocus
*Activate Screen

ENDPROC
PROCEDURE Resize
DoDefault()
ENDPROC
PROCEDURE addclassestotreeview
Lparameters toVcxNode, tcClassLib

Local lcAlias, lcClass, lcFilename, lcFilter, lcWhere, lnSelect, loClassLibsNode

lnSelect = Select()
lcAlias = Thisform.cSearchResultsAlias

lcClassLibFilter = 'filepath = [' + Alltrim(tcClassLib) + ']'

lcFilter = Alltrim(Filter(lcAlias))
lcWhere = 'Where ' + lcFilter + Iif(!Empty(lcFilter), ' and ', '') + lcClassLibFilter
Select filename, Class, Id From (lcAlias) &lcWhere Order By 2 Into Cursor 'Classes'

Scan For !Empty(Class)
	lcFilename = Alltrim(filename)
	lcClass = Alltrim(Class)
	Try
		loClassLibsNode = Thisform.oTree.nodes.Add(toVcxNode.Key, 4, 'Class_' + Alltrim(Str(Id)), lcClass, ,)
	Catch
	Endtry
	Locate For Alltrim(filename) + Alltrim(Class) <> lcFilename + lcClass Rest

	If !Eof()
		Skip - 1
	Endif

Endscan

Select (lnSelect)



ENDPROC
PROCEDURE adjustformforreplacepanel
Lparameters tlShow

Local loGrid, loGridPanel, loReplacePanel

loGridPanel = Thisform.containerRight.container1
loGrid = Thisform.containerRight.container1.gridFiles
loReplacePanel = loGridPanel.containerReplaceText

If Empty(Thisform.oSearchEngine.oSearchOptions.cReplaceExpression)
	Thisform.oSearchEngine.oSearchOptions.cReplaceExpression = Thisform.oSearchEngine.oSearchOptions.cSearchExpression
Endif

With loGrid
	.Anchor = 0
	
	If Thisform.lReplaceMode = .t.
		.top = loReplacePanel.Top + loReplacePanel.Height
	Else
		.top = loReplacePanel.Top
	Endif
	
	.Height = loGrid.Parent.Height - .Top - 1
	
	.Anchor = 15
Endwith   

Thisform.Refresh()  
ENDPROC
PROCEDURE applyfilter
Local lcFilter

lcFilter = Evl(Thisform.cFilter, '')

Set Filter To &lcFilter in (Thisform.cSearchResultsAlias)


 
ENDPROC
PROCEDURE checkall
Thisform.FilterGFSE()

*-- Update local cursor
Replace process with .t. All in (Thisform.cSearchResultsAlias) ;
 For replacerisk <= Thisform.nReplaceRisk and ;
		 replaced = .f. 

*-- Update GFSE cursor
Replace process with .t. All in (Thisform.oSearchEngine.cSearchResultsAlias) ;
 For replacerisk <= Thisform.nReplaceRisk and ;
		 replaced = .f. 
 
Thisform.DoReplace(.t.)  &&.t. means "Preview" Replace


ENDPROC
PROCEDURE clearall
Thisform.FilterGFSE()

Replace process with .f. all in (Thisform.cSearchResultsAlias)
Replace replaceline with '' for replaced = .f. in (Thisform.cSearchResultsAlias)
Replace trimmedreplaceline with '' for replaced = .f. in (Thisform.cSearchResultsAlias)

Replace process with .f. all in (Thisform.oSearchEngine.cSearchResultsAlias)
Replace replaceline with '' for replaced = .f. in (Thisform.oSearchEngine.cSearchResultsAlias)
Replace trimmedreplaceline with '' for replaced = .f. in (Thisform.oSearchEngine.cSearchResultsAlias)

Thisform.ClearGFSEFilter()
Goto top in (Thisform.cSearchResultsAlias)
Thisform.oGrid.SetFocus()


ENDPROC
PROCEDURE cleargfsefilter
Set Filter To in (This.oSearchEngine.cSearchResultsAlias)
ENDPROC
PROCEDURE clearsearchresultscursor
Local lcSafety, lnSelect

lnSelect = Select()

Select (This.cSearchResultsAlias)

If Used(This.cSearchResultsAlias)
	lcSafety = Set('Safety')
	Set Safety Off
	Zap in (This.cSearchResultsAlias)
	Set Safety &lcSafety
Else
	MessageBox('Error clearing search results cursor for new search.', 0, 'Error:')
	Select (lnSelect)
	Return .f.
EndIf

Select (lnSelect)
   
ENDPROC
PROCEDURE confirmreplace
Local lcBackupOption, llBackup, lnResponse

If Thisform.oSearchEngine.oSearchOptions.lDoNotShowReplaceWarning
	Return .T.
Endif

llBackup = Thisform.oSearchEngine.oSearchOptions.lBackup

lcBackupOption = 'Backup option: ' + Iif(llBackup, '[Enabled]', '[*** DISABLED ***]')

lnResponse = Messagebox('=============================================' + CR + ;
	  '             W  A  R  N  I  N  G	'											+ CR + ;
	  '============================================='	+ CR + CR + ;
	  'Are you SURE you are ready to Replace?' + CR + CR + ;
	  lcBackupOption + CR + CR + ;
	  'These changes cannot be reversed!!', 3 + 32, 'GoFish Replace')

If lnResponse <> 6
	Return .F.
Endif



ENDPROC
PROCEDURE createindex
Lparameters tcFieldType, tcField, tcOrder

If Empty(tcFieldType)
	Return 
Endif


If tcFieldType = 'C'
	lcReturn = 'Left(Alltrim(' + tcField + ', Chr(32), Chr(9)), 50)'
Else
	lcReturn = 'tcField'
EndIf

Return lcReturn




*!*	Lparameters tcFieldType, tcField, tcOrder

*!*	If Empty(tcFieldType)
*!*		Return 
*!*	Endif

*!*	lnSelect = Select()

*!*	Select (thisform.cSearchResultsAlias)

*!*	Try
*!*		If tcFieldType = 'C'
*!*			Index On Left(Alltrim(&tcField, Chr(32), Chr(9)), 50) Tag 'IndexTag' &tcOrder
*!*		Else
*!*			Index On &tcField Tag(tcField) &tcOrder
*!*		EndIf
*!*	Catch
*!*		Messagebox('Cannot sort on this column', 0, 'Notice:')
*!*	Endtry

*!*	Goto Top

*!*	Select (lnSelect)


ENDPROC
PROCEDURE doreplace
Lparameters tlPreviewReplace && .t. means do a "Preview" Replace

Local lnCurrentId

If !tlPreviewReplace && If not doing a Preview, then we are doing a replace and will do some extra validation
	If !ThisForm.ValidateReplaceExpression() or !ThisForm.ConfirmReplace()
		Return .f.
	Endif
Endif

lnCurrentId = Evaluate(Thisform.cSearchResultsAlias + '.id')

*Thisform.UpdateSearchEngineCursor()&& Copy over the Process settings from local cursor to GFSE cursor
Thisform.oSearchEngine.oSearchOptions.lAllowBlankReplace = .t.
Thisform.oSearchEngine.oSearchOptions.lPreviewReplace = tlPreviewReplace

Thisform.FilterGFSE()

Thisform.oSearchEngine.ReplaceMarkedRows(Thisform.oSearchEngine.cSearchResultsAlias)

ThisForm.ClearGFSEFilter()

Thisform.UpdateFormAfteReplace(lnCurrentId) 




ENDPROC
PROCEDURE dosearch
Lparameters tlLeaveFilterActive

Local lcMessage, lcScope, lcSearchExpression, lcSetEscape, loSearchEngine, loSearchOptions

This.lInit = .t.
Thisform.oSearchEngine.oSearchOptions.cReplaceExpression = ''

If !This.ValidateInputs()
	Thisform.lSearching = .f.
	Thisform.comboSearchScopeHistory.SetFocus()
	Thisform.Refresh()
	Return .f.
EndIf

lcSetEscape = Set('Escape')
Set Escape Off

Set Typeahead To 1
Clear Typeahead
KEYBOARD '{spacebar}'

Thisform.lSearching = .T.
Thisform.nCurrentId = 0
Thisform.lReplaceMode = .f.

Thisform.oTree.Nodes.Clear()

*-- This is required because I had problems getting the checkboxes to be usable after the cursor is zapped
*-- and then re-populated. This value will be restored after the search.
Thisform.oGrid.Setfocus()
Thisform.oGrid.colProcess.DynamicCurrentControl = ''

Thisform.ClearSearchResultsCursor() && Go ahead and blank out the cursor so the grid will be empty during the search

loSearchEngine = Thisform.oSearchEngine
loSearchOptions = Thisform.oSearchEngine.oSearchOptions

Thisform.Refresh()

*-- Save Search Expression ---------------------------------------------------
lcSearchExpression = Thisform.oSearchEngine.oSearchOptions.cSearchExpression
Thisform.comboSearchExpressionHistory.SaveSearchExpression(lcSearchExpression) 

*-- Save Search Scope ---------------------------------------------------
lcScope = Alltrim(Lower(Thisform.comboSearchScopeHistory.text))

lcMessage = 'Searching...'
Thisform.PopulateTreeview(lcMessage , 32768)
Thisform.ShowHtml('<h3>&nbsp;&nbsp;&nbsp;' + lcMessage + '</h3>')

loSearchEngine.PrepareForSearch() && Blank out settings from last search so I can refresh the UI with blank value

If '.PJX' $ Upper(lcScope)
	lnReturn = loSearchEngine.SearchInProject(lcScope)
Else
	*loSearchOptions.lIncludeSubDirectories = Thisform.chkSubdirectories.Value
	lnReturn = loSearchEngine.SearchInPath(lcScope) 
Endif

If lnReturn <= 0
	MessageBox(Thisform.oSearchEngine.oSearchErrors[Thisform.oSearchEngine.oSearchErrors.count], 16, 'GoFish - Search error:')
Endif

Set Escape &lcSetEscape

Thisform.oSearchEngine.oSearchOptions.cReplaceExpression = lcSearchExpression 

Thisform.comboSearchScopeHistory.SaveSearchScope(lcScope)
Thisform.UpdateFormAfterSearch()






      
ENDPROC
PROCEDURE editfile
Thisform.oSearchEngine.EditFromCurrentRow(thisform.cSearchResultsAlias)
ENDPROC
PROCEDURE expandallnodes
Local i

For i = 1 To This.oTree.Nodes.Count
	This.ExpandNode(This.oTree.Nodes.Item(i))
EndFor

Thisform.oTree.SelectedItem.EnsureVisible()


ENDPROC
PROCEDURE fillsearchresultscursor

Local lcFieldList, lcFirstField, lcOrder, lcOrderByClause, lcSearchEngineResultsAlias
Local lcSearchResultsAlias, lnSelect

lcSearchEngineResultsAlias = Thisform.oSearchEngine.cSearchResultsAlias
lcSearchResultsAlias = Thisform.cSearchResultsAlias

lnSelect = Select()

*-- Construct Order By clause for Select statement from stored form property
If !Empty(Thisform.cSortFields)
	lcFieldList = Alltrim(Thisform.cSortFields, 1, ',')
	lcFirstField = GetWordNum(lcFieldList, 1, ',')
	lcOrder = Thisform.cSortOrder
	If (Empty(lcOrder) or ('ASC' $ Upper(lcOrder)))
		lcOrder = 'ASC'
	Endif
	lcOrderByClause = 'Order by ' + lcFirstField + ' ' + lcOrder 
	*lcOrderByClause = ',' + lcFirstField + ' ' + lcOrder 
Else
	lcOrderByClause = ''
Endif

*-- Create the local cursor if it does not already exist -----------------------
If !Used(lcSearchResultsAlias)
*	Select * From (lcSearchEngineResultsAlias) Into Cursor (lcSearchResultsAlias) &lcOrderByClause ReadWrite 
	Select * From (Select * from (lcSearchEngineResultsAlias) Order By filename, class, objectname, methodname) source;
	 Into Cursor (lcSearchResultsAlias) &lcOrderByClause ReadWrite 


Else && Otherwise, Zap it and rebuild from GFSE cursor...
	*Thisform.UpdateSearchEngineCursor()
	
	Thisform.ClearSearchResultsCursor() && Zap it
	*-- Build a temp local cursor in correct initial order
	Select * From (Select * from (lcSearchEngineResultsAlias) Order By filename, class, objectname, methodname) source;
	 Into Cursor gf_temp_csr &lcOrderByClause

	*-- Update local cursor in order that user has applied
	Insert Into (lcSearchResultsAlias) Select * from gf_temp_csr &lcOrderByClause 
	
	*Replace process with .f. for replaced = .t. all in (lcSearchResultsAlias)
Endif

Select (lcSearchResultsAlias) 
Goto Top

Select (lnSelect)


       
ENDPROC
PROCEDURE filtergfse
Local lcFilter

lcFilter = Filter(this.cSearchResultsAlias)         
Set Filter To &lcFilter in (This.oSearchEngine.cSearchResultsAlias)
 
ENDPROC
PROCEDURE findcolumn
Lparameters tcControlSource

Local loColumn, loGrid, lcControlSourceField

loGrid = this.oGrid

For each loColumn in loGrid.Columns
	lcControlSourceField = GetWordNum(loColumn.ControlSource, 2, '.')
	If Upper(lcControlSourceField) = Upper(tcControlSource)
		Return loColumn
	Endif
Endfor
 

ENDPROC
PROCEDURE formatgrid
*-- This method provides basic grid formatting when form is first launched, 
*-- then, in the Form.Init(), the user settings will be loaded, which will
*-- restore column width and column order based on user's last sesssion.

Local lcControlSourceField, lcDynamicBackColor, lcSearchResultsAlias, loColumn, loGrid

loGrid = Thisform.containerRight.Container1.gridFiles
lcSearchResultsAlias = Thisform.cSearchResultsAlias

*-- Set Header captions from Field name -----------------
For Each loColumn In loGrid.columns
	lcControlSourceField = Proper(Getwordnum(loColumn.ControlSource, 2, '.'))
	loColumn.Width = 100
	loColumn.Header1.Caption = lcControlSourceField
	loColumn.Header1.Tag = lcControlSourceField  && Save ControlSource on tag so Options form can access it.
Endfor

*-- Now, override a few Header captions so they'll read better ------------------
*-- Note: Any "Visible = .f." settings assigned here oly affect GF the first time it is ever used.
*         After first use, the XML settings files take over this visibility of columns.

loColumn = This.FindColumn('Process')
loColumn.Header1.caption = 'Replace'
loGrid.colProcess.Visible = .f.
loColumn.width = 50
This.FormatProcessColumn()

loColumn = This.FindColumn('Filepath')
loColumn.Width = 200
loColumn.Visible = .f.

loColumn = This.FindColumn('Filename')
loColumn.Width = 200

loColumn = This.FindColumn('Filetype')
loColumn.Header1.caption = 'Ext'

loColumn = This.FindColumn('TrimmedmatchLine')
loColumn.Header1.caption = 'Match Line'
loColumn.Width = 200

loColumn = This.FindColumn('TrimmedReplaceline')
loColumn.Header1.caption = 'Replace Line'
lcDynamicBackColor = "ICase(replaced, RGB(149,249,147), replacerisk > Thisform.nReplaceRisk, Rgb(210,210,210), Rgb(255,255,255))"
loColumn.DynamicBackColor = lcDynamicBackColor 
loColumn.Width = 200

loColumn = This.FindColumn('Baseclass')
loColumn.Visible = .f.

loColumn = This.FindColumn('Parentclass')
loColumn.Header1.caption = 'Parent Class'
loColumn.Visible = .f.

loColumn = This.FindColumn('Objectname')
loColumn.Header1.caption = 'Object Name'

loColumn = This.FindColumn('Methodname')
loColumn.Header1.caption = 'Method Name'

loColumn = This.FindColumn('ObjectClass')
loColumn.Header1.caption = 'Object Class'
loColumn.Visible = .f.

loColumn = This.FindColumn('ObjectBaseClass')
loColumn.Header1.caption = 'Object Baseclass'
loColumn.Visible = .f.

*loColumn = This.FindColumn('MatchType')
*loColumn.Visible = .f.

loColumn = This.FindColumn('Type')
loColumn.Visible = .f.

loColumn = This.FindColumn('Recno')
loColumn.Visible = .f.

loColumn = This.FindColumn('ProcStart')
loColumn.Visible = .f.

loColumn = This.FindColumn('MatchStart')
loColumn.Visible = .f.

loColumn = This.FindColumn('MatchLen')
loColumn.Visible = .f.

loColumn = This.FindColumn('lIsText')
loColumn.Visible = .f.

loColumn = This.FindColumn('Code')
loColumn.Visible = .f.

loColumn = This.FindColumn('id')
loColumn.Visible = .f.

loColumn = This.FindColumn('MatchLine')
loColumn.Header1.caption = 'Match Line with white space'
loColumn.Visible = .f.


    
ENDPROC
PROCEDURE formatgridforreplacemode
Local llReplaceMode, lnOrder, lnWidth, loColumn

llReplaceMode = Thisform.lReplaceMode

loColumn = This.FindColumn('TrimmedMatchline')
lnOrder = loColumn.ColumnOrder
lnWidth = loColumn.Width

loColumn = This.FindColumn('TrimmedReplaceline')
loColumn.Visible = llReplaceMode
loColumn.ColumnOrder = lnOrder + 1
loColumn.Width = lnWidth

loColumn = This.FindColumn('Process')
loColumn.Visible = llReplaceMode&& and (Thisform.nReplaceMode # 2)
loColumn.ColumnOrder = Evl(lnOrder - 1, 1)
loColumn.Width = 50
 
ENDPROC
PROCEDURE formatprocesscolumn
Local lcReplaceColumnDynamicBackgroundColor, lcReplaceColumnDynamicCurrentControl, loColumn

*-- This method is called from the GRid.Init() *AND* must be called after every search becuase I had trouble where the Replace checkboxes
*-- would quit working after a search, in certain situtations. Re-applying the DynamicCurrentControl setting here fixed the problem.

loColumn = This.FindColumn('Process')

lcReplaceColumnDynamicCurrentControl = "ICase(replaced = .t., 'imageCheck', (replacerisk <= Thisform.nReplaceRisk) and (Thisform.nReplaceMode # 2), 'check1', 'label1')"
lcReplaceColumnDynamicBackgroundColor = "ICase(replacerisk = 2, RGB(255,255,128), replacerisk = 3 and Thisform.nReplaceRisk = 3, Rgb(255,192,0), Rgb(255,255,255))"

If this.lInit
	Thisform.oGrid.Setfocus() && It's important for the grid to have focus as these next settings below are applied
Endif

loColumn.DynamicCurrentControl = lcReplaceColumnDynamicCurrentControl
loColumn.DynamicBackColor = lcReplaceColumnDynamicBackgroundColor 
 
   
ENDPROC
PROCEDURE getcurrentscope
Local lcScope, lnScope

*0=Not set, 1=Active Project, 2=Browse Project, 3=Current Dir, 4=Browse Directory, 5=A Selection from the Scope combo

lnScope = Thisform.oSearchEngine.oSearchOptions.nSearchScope

Do Case

	Case lnScope = 1 && Active Project
		lcScope = Thisform.cActiveProject

	Case lnScope = 2 && Browsed Project
		lcScope = This.oSearchEngine.oSearchOptions.cProject	

	Case lnScope = 3 && Current Directory
		lcScope = Thisform.cCurrentDir 	
	
	Case lnScope = 4  && Browsed Directory
		lcScope = This.oSearchEngine.oSearchOptions.cPath

	Case lnScope = 0 or lnScope = 5
		lcScope = Alltrim(Thisform.comboSearchScopeHistory.Text)
		
		If Empty(lcScope)
			lcScope = Thisform.cCurrentDir
		Endif
		
EndCase

lcScope = Alltrim(lcScope)
lcScope = Rtrim(lcScope, '\')

Return lcScope
ENDPROC
PROCEDURE loadformsettings
Local loMy as 'My' OF 'My.vcx'

*-- Note: In the Load() event, Form.Top is set to -2000 to prevent the form from appearing in the
*-- visible screen area and then being moved to the restored position. This caused an annoying
*-- flashing behavior than can be avoided with this trick.
*-- Therefore, we must be sure to bring the form back into the view area before we leave this method.

If !File(This.cUISettingsFile)
	This.Top = 0 && See note above
	Return
EndIf

loMy = Newobject('My', 'My.vcx')
loSettings = loMy.Settings
loSettings.Load(This.cUISettingsFile)

*-- Restore Docking settings (Code provided by Jim Nelson) -----------------
*-- Important note: Dock settings MUST be restored before Lett and Top are restored in next step
	Try
    This.Dockable = loSettings.nDockable
    llDocked       = loSettings.lDocked
    lnDockPosition = loSettings.nDockPosition
    If This.Dockable = 1 And llDocked
        lcDockWindow = loSettings.cDockWindow
        Do Case
            Case Not Empty (lcDockWindow)
                Try
                    Dock Name Thisform position 4 Window &lcDockWindow
                Catch

                Endtry
            Case  Between (lnDockPosition, 0, 3)
                This.Dock (lnDockPosition)
        Endcase
    EndIf
	Catch
	Endtry

	*-- Resize form size and position--------------------
	If loSettings.Exists('FormTop')
		With loSettings
			This.Left   = .FormLeft
			This.Height = .FormHeight
			This.Width  = .FormWidth
			Thisform.Resize() 
			Try
				This.containerRight.splitter1.MoveSplitterToPosition(.Splitter1Position)
			Catch
			EndTry
			Try
				This.splitter2.MoveSplitterToPosition(.Splitter2Position)
			Catch
			Endtry
			This.Top = .FormTop && Do this one last to finally bring the form into view.
		EndWith
	Else
		This.Top = 0
	EndIf

	
  *-- Load other Form properties from My Settings ------------------------------------
  With Thisform
		*.lIncludeSubDirectoriesCurrent = PropNvl(loSettings, 'lIncludeSubDirectoriesCurrent', .t.)
		*.lIncludeSubDirectoriesBrowsed = PropNvl(loSettings, 'lIncludeSubDirectoriesBrowsed', .t.)
		.containerRight.container2.containerWebControl.nZoom = PropNvl(loSettings, 'nBowserZoom', .t.)
		.nGridFontSize = PropNvl(loSettings, 'nGridFontSize', Thisform.oGrid.FontSize, .t.)
		.lApplyFilter = PropNvl(loSettings, 'lApplyFilter', .f., .t.)
		.cFilter = PropNvl(loSettings, 'cFilter', '', .t.)
	
		.cSortFields = PropNvl(loSettings, 'cSortFields', '')
		.cSortOrder = PropNvl(loSettings, 'cSortOrder', '')
		.nReplaceRisk = Evl(PropNvl(loSettings, 'nReplaceRisk', 1), 1)
		.cReplaceUDFFilename = PropNvl(loSettings, 'cReplaceUdfFilename', '')
		.nReplaceMode = PropNvl(loSettings, 'nReplaceMode', 1)

		.nDropDownDisplayCount = PropNvl(loSettings, 'nDropDownDisplayCount', 20, .t.)

  EndWith

	This.oGrid.FontSize = Thisform.nGridFontSize 
	This.oTree.Font.Size = Thisform.nGridFontSize 

	*--- Restore Width, ColumnOrder, and Visible state to Grid columns ----------------
	lnX = 1
	For Each loControl in Thisform.oGrid.Columns
		loControl.Width = PropNvl(loSettings, loControl.name + '_width', 100, .t.)
		loControl.ColumnOrder = PropNvl(loSettings, loControl.name + '_order', lnX, .t.)
		loControl.Visible = PropNvl(loSettings, loControl.name + '_visible', .t., .t.)
		loControl.Header1.FontBold = PropNvl(loSettings, loControl.name + '_BoldHeader', .f., .t.)
		lnX = lnX + 1 
	EndFor
	

ENDPROC
PROCEDURE loadreplaceline
Local lcCursor, lcMatchLine, llReplaced

lcCursor = This.cSearchResultsAlias

lcMatchLine = &lcCursor..matchline
lnMatchLength = &lcCursor..matchlen
llReplaced = &lcCursor..replaced

If !llReplaced
	Thisform.cReplaceLine = Left(lcMatchLine, lnMatchLength)
Else
	Thisform.cReplaceLine = ''
Endif


 
ENDPROC
PROCEDURE lreplacemode_assign
Lparameters tlReplaceMode

llEnteringReplaceMode = tlReplaceMode = .t. and thisform.lReplaceMode = .f.

*-- Cannot enable here if this feature is not enabled in Options
If Thisform.oSearchEngine.oSearchOptions.lEnableReplaceMode = .f.
	Thisform.lReplaceMode = .f.
Else
	Thisform.lReplaceMode = tlReplaceMode
Endif

If Thisform.nReplaceMode = 0 
	Thisform.nReplaceMode = 1
Endif

Thisform.AdjustFormForReplacePanel(tlReplaceMode)
Thisform.FormatGridForReplaceMode()

Thisform.Refresh()

If llEnteringReplaceMode and thisform.nReplaceMode = 3
	Do Form gofish_advaccedreplacehelp
EndIf



ENDPROC
PROCEDURE navigatetomasterrecord
Lparameters tnId

Local lcFullSearchResults, lcMessage

lcFullSearchResults = Thisform.oSearchEngine.cSearchResultsAlias

Select (lcFullSearchResults)
Locate for id = tnId

If !Found()
	lcMessage = 'Error locating selected record in master table. Id = [' + Alltrim(Str(tnId)) + ']'
	MessageBox(lcMessage, 0, 'GoFish Error')
	Return .f.
EndIf
  
ENDPROC
PROCEDURE nreplacemode_assign
Lparameters tnReplaceMode

Local loReplaceColumn

If thisform.lInit and tnReplaceMode = 3 and tnReplaceMode <> Thisform.nReplaceMode
	Do Form gofish_advaccedreplacehelp
Endif

This.nReplaceMode = tnReplaceMode
Thisform.oSearchEngine.nReplaceMode = tnReplaceMode

Thisform.AdjustFormForReplacePanel()

*-- Need to refresh the grid with new Replace Line values from the selected mode
If This.lInit = .T. And !Thisform.lSearching
	Thisform.DoReplace(.T.) && .t. means do a "Preview" Replace
Endif

*-- Adjust header caption of Replace column
loColumn = This.FindColumn('Process')
loColumn.Header1.Caption = Iif(Thisform.nReplaceMode = 2, 'Replaced', 'Replace')

ENDPROC
PROCEDURE populatetreeview
Lparameters tcMessage, tnColor

Local lcAlias, lcFilePath, lnSelect, loTreeView, lcRoot

Local llScxNodeAdded, llVcxNodeAdded, lcPrgNodeAdded, lcOtherNodeAdded
lnSelect = Select()

lcAlias = this.cSearchResultsAlias
loTreeView = Thisform.containerLeft.oTreeView
loTreeView.LabelEdit = 1

lcRoot = Evl(tcMessage, 'Results')
lnColor = Evl(tnColor, 0)

With loTreeView.Nodes 

	.Clear()
	
	*-- Add topmost 'Results' node  ----------------------------
	loNode = .Add(,, 'Results', lcRoot,,)
	loNode.Expanded = .t.
	loNode.Bold = (Reccount(lcAlias) > 0) or Pcount() > 0
	loTreeView.LineStyle = Iif(Eof(lcAlias), 0, 1)
	
	loNode.ForeColor = lnColor
	
	lcFilter = Filter(lcAlias)
	lcWhere = Iif(!Empty(lcFilter), 'Where ' + lcFilter, '')

	Select FilePath, filename, id, FileType  From (lcAlias) &lcWhere Order by 2,1 into cursor 'Files'
	
	*-- Create main category nodes if present in the filtered results -
	Locate for Upper(FileType) = 'SCX'
		If Found()
			loFormsNode = .Add('Results', 4,'Root_SCX','Forms',,)
			loFormsNode.Expanded = .t.
		Endif

	Locate for Upper(FileType) = 'VCX'
		If Found()
			loClassLibsNode = .Add('Results', 4,'Root_VCX','ClassLibs',,)
			loClassLibsNode.Expanded = .t.
		Endif

	Locate for Upper(FileType) = 'PRG'
		If Found()
			loPrgNode = .Add('Results', 4,'Root_PRG','Prg',,)
			loPrgNode.Expanded = .t.
		Endif

	Locate for Upper(FileType) = 'FRX'
		If Found()
			loReportsNode = .Add('Results', 4,'Root_FRX','Reports',,)
			loReportsNode.Expanded = .t.
		Endif

	Locate for Upper(FileType) = 'DBF'
		If Found()
			loDbfNode = .Add('Results', 4,'Root_DBF','Data',,)
			loDbfNode.Expanded = .t.
		Endif

	Locate for !(Upper(FileType) $ ' SCX VCX PRG FRX DBF ')
		If Found()
			loOtherNode = .Add('Results', 4,'Root_OTHER','Other',,)
			loOtherNode.Expanded = .t.
		Endif
			
	*-- Now populate each category node -------------------------------
	Scan
		lcFilePath = Alltrim(Upper(FilePath))
		lcExt = Upper(JustExt(FilePath))
		
		If '_' + lcExt + '_' $ '_SCX_VCX_PRG_FRX_DBF_'
			lcRoot = 'Root_' + lcExt
		Else
			lcRoot = 'Root_OTHER'
		EndIf
						
		loNode = .Add(lcRoot, 4, 'File_' + Alltrim(Str(id)) + '_' + Alltrim(FilePath), Lower(JustFname(lcFilePath)),,)
		loNode.parent.bold = .t.
		loNode.expanded = .t.
		
		If lcExt = 'VCX'
			loNode.expanded = .f.
			ThisForm.AddClassesToTreeView(loNode, FilePath)
		Endif		

		Locate For Alltrim(Upper(Filepath)) <> lcFilePath Rest && Jump To next FileName

		If !Eof()
			Skip -1
		Endif
		
	Endscan

EndWith

loTreeView.Refresh()
 	 
Select (lnSelect)
	  
ENDPROC
PROCEDURE replace
*--- Make sure at least one record is selected before calling Replace() method
Local laSelectedCount[1]

Select Count(id) from (thisform.cSearchResultsAlias);
 Where process = .t. and replaced = .f.;
 Into Array laSelectedCount
 
If laSelectedCount = 0 
	MessageBox('No eligible records are selected for replace.', 0, 'Notice:')
	Return .f.
EndIf

Thisform.DoReplace()
  
ENDPROC
PROCEDURE replaceline
Local lcGFSECursor, lcReplaceLine, llResult, lnId, lnLastChar

If Evaluate(Thisform.cSearchResultsAlias + '.replaced') or !ThisForm.ConfirmReplace()
	Return .f.
Endif

lnId = Evaluate(Thisform.cSearchResultsAlias + '.id')

lcReplaceLine = Thisform.cReplaceLine

lnLastChar = Asc(Right(lcReplaceLine, 1))
If lnLastChar = 10 && Editbox will add a CHr(10) so this has to be stripped off
	lcReplaceLine = Left(Thisform.cReplaceLine, Len(Thisform.cReplaceLine) - 1)
Endif

lnLastChar = Asc(Right(lcReplaceLine, 1))
If lnLastChar <> 13 && Make sure user has not stripped of the Chr(13) that came with the MatchLine
	lcReplaceLine = lcReplaceLine + Chr(13)
Endif

lcGFSECursor = Thisform.oSearchEngine.cSearchResultsAlias

Thisform.oSearchEngine.oSearchOptions.lPreviewReplace = .f.
llResult = Thisform.oSearchEngine.ReplaceLine(lcGFSECursor, lnId, lcReplaceLine)

If llResult = .t.
	Thisform.UpdateFormAfteReplace(lnId) 
Else	
	MessageBox('Error performing replace. View Error list for more details.', 0, 'Error:')
	Return .f.
Endif








              
ENDPROC
PROCEDURE restoredefaultdir
Cd (This.cInitialDefaultDir)

ENDPROC
PROCEDURE restoreindex
Local lcField, lcFieldType, lcSortDirection, loSearchOptions

loSearchOptions = This.oSearchEngine.oSearchOptions

*-- Restore sort order on cursor
lcFieldType = GetWordNum(loSearchOptions.cIndexString, 1, '|')
lcField = GetWordNum(loSearchOptions.cIndexString, 2, '|')
lcSortDirection = GetWordNum(loSearchOptions.cIndexString, 3, '|')

If !Empty(lcFieldType) and !Empty(lcField)
	This.CreateIndex(lcFieldType, lcField, lcSortDirection) 
Endif

ENDPROC
PROCEDURE saveformsettings
Local loMy As 'My' Of 'My.vcx'

loMy = Newobject('My', 'My.vcx')

loSettings = loMy.Settings

With loSettings
	*-- Form Size and Position -----------------------------
	.Add('FormTop',    This.Top)
	.Add('FormLeft',   This.Left)
	.Add('FormHeight', This.Height)
	.Add('FormWidth',  This.Width)
	.Add('Splitter1Position', This.containerRight.splitter1.Top)
	.Add('Splitter2Position', This.splitter2.Left)

	*-- Persist the docking information.
 	.Add('nDockable', This.Dockable)
	If This.Dockable # 0
		.Add('lDocked', This.Docked)

		If This.Docked
			Adockstate (laDock)
			lnRow = Ascan (laDock, This.Caption, -1, -1, 1, 15)
			lcDockWindow = ''
			If lnRow > 0
				.Add('nDockPosition', laDock[lnRow, 3])
				If laDock[lnRow, 4] # _Screen.Caption And Not Empty (laDock[lnRow, 4])
					lcDockWindow = laDock[lnRow, 4]
				Else
					lnRowDocked = Ascan (laDock, This.Caption, -1, -1, 4, 15)
					If lnRowDocked > 0
						lcDockWindow = laDock[lnRowDocked, 1]
					Endif
				Endif
			Endif lnRow > 0

			.Add('cDockWindow', lcDockWindow)
		Endif
	Endif

	*--- Save other custom form properties that to restore next session ----------------
	*.Add('lIncludeSubDirectoriesCurrent', Thisform.lIncludeSubDirectoriesCurrent)
	*.Add('lIncludeSubDirectoriesBrowsed', Thisform.lIncludeSubDirectoriesBrowsed)
	.Add('nBowserZoom', Thisform.containerRight.container2.containerWebControl.nZoom)
	.Add('nGridFontSize', Thisform.nGridFontSize)
	.Add('lApplyFilter', Thisform.lApplyFilter)
	.Add('cFilter', Thisform.cFilter)
	.Add('nReplaceRisk', Evl(Thisform.nReplaceRisk, 1))
	.Add('cReplaceUdfFilename', Thisform.cReplaceUDFFilename)
	.Add('nReplaceMode', Evl(Thisform.nReplaceMode, 1))

	.Add('cSortFields', Thisform.cSortFields)
	.Add('cSortOrder', Thisform.cSortOrder)

	.Add('nDropDownDisplayCount', Thisform.nDropDownDisplayCount)

	*-- Grid Settings -----------------------------
	For Each loControl In Thisform.oGrid.Columns
		.Add(loControl.Name + '_width',    loControl.Width)
		.Add(loControl.Name + '_order',    loControl.ColumnOrder)
		.Add(loControl.Name + '_visible',  loControl.Visible)
		.Add(loControl.Name + '_BoldHeader', loControl.Header1.FontBold)
	Endfor

	.Save(This.cUISettingsFile)

Endwith





ENDPROC
PROCEDURE search
Local lcFilter, lcFirstChar, lcLastChar, lcSearchExpression, lnResponse

lcSearchExpression = Thisform.oSearchEngine.oSearchOptions.cSearchExpression
lcFirstChar = Left(lcSearchExpression, 1)
lcLastChar = Right(lcSearchExpression, 1)

*====== Deal with any leading or trailing spaces in the search expression ======================
If lcFirstChar = Chr(32) Or lcLastChar = Chr(32)
	lnResponse = Messagebox('Notice: The search expression contains leading or trailing spaces.' + ;
		  Chr(13) + Chr(13) + ;
		  'Do you want to remove these spaces from the search expression?', 3 + 32, 'GoFish notice:') && Yes, No, Cancel dialog box
	If lnResponse = 2 && Cancel
		Thisform.editSearch.SetFocus()
		Return
	Endif

	If lnResponse = 6 && Yes
		Thisform.oSearchEngine.oSearchOptions.cSearchExpression = Alltrim(lcSearchExpression)
	Endif
Endif

lcFilter = Thisform.cFilter

Set Filter To &lcFilter In (Thisform.cSearchResultsAlias) && Need to remove any filter that the Treeview has applied

Thisform.DoSearch(.T.)

If Thisform.lSearching = .T.
	Thisform.lSearching = .F.
Endif

Thisform.editSearch.SetFocus()
ENDPROC
PROCEDURE setcaption
Lparameters toControl, tcCaption

toControl.Caption = tcCaption

toControl.Refresh()
ENDPROC
PROCEDURE setpath
Lparameters tcDir

MessageBox('Form.SetPath() shoudl no longer be needed.')
Return



Local lcPath, llReturn

lcPath = Alltrim(Thisform.oSearchEngine.oSearchOptions.cPath)	&& Store it. Might be invalid, and if so, we'll restore it to save them

llReturn = Thisform.oSearchEngine.SetPath(tcDir) && Will also rebuild list of Projects that are present in this path

If !llReturn
	MessageBox('Invalid path. Please correct',32, 'GoFish Error:')
	Thisform.oSearchEngine.oSearchOptions.cPath	= lcPath
Endif

Thisform.Refresh()

Return llReturn

     
ENDPROC
PROCEDURE setscope
Lparameters tcScope

tcScope = Alltrim(tcScope)
tcScope = Rtrim(Lower(tcScope), '\')

If (!Directory(tcScope, 1) and !('.pjx' $ Lower(tcScope))) or Empty(tcScope)
	MessageBox('Invalid scope setting', 0, 'Error:')
	Return
Endif

Thisform.comboSearchScopeHistory.SaveSearchScope(tcScope)
Thisform.comboSearchScopeHistory.Value = tcScope
Thisform.comboSearchScopeHistory.Valid()

Thisform.Refresh()
ENDPROC
PROCEDURE setsearchexpression
Lparameters tcSearchExpression

Thisform.oSearchEngine.oSearchOptions.cSearchExpression = tcSearchExpression

Thisform.Refresh()
ENDPROC
PROCEDURE showadvancedform

If Thisform.lSearchFormVisible = .f.
	Thisform.lSearchFormVisible = .t.
	Do Form 'GoFish_Advanced' with Thisform
Else
	ThisForm.ShowForm('GF_Advanced')
Endif


ENDPROC
PROCEDURE showcodeforcurrentrow
Lparameters tlForce

*-- This method will only generate the html if the ROW has changed, not the colum. This prevents
*-- the html from being regerated if the user tabs to a new column in the grid, without changing rows.

Local lnId

If Eof(Thisform.cSearchResultsAlias) or Thisform.lSearching = .t.
	Return
Endif

lnId = Evaluate(Thisform.cSearchResultsAlias + '.id')

If (lnId <> Thisform.nCurrentId and lnId > 0) or tlForce
	Thisform.LoadReplaceLine()
	Thisform.Refresh()
	Thisform.ShowHtmlCodeView()
EndIf

Thisform.nCurrentId = lnId
ENDPROC
PROCEDURE showfilterform
Local lcCurrentFilter, lcCursor, lcFilter

lcCursor = thisform.cSearchResultsAlias
lcCurrentFilter = Filter(lcCursor)
Thisform.nCurrentId = 0

Set Filter To In (lcCursor) && Clear current filter so Filter form and process all records

Do Form GoFish_Filter With This To lcFilter

If IsNull(lcFilter)
	Set Filter To &lcCurrentFilter in (lcCursor)
	Return
Else
	Thisform.cFilter = lcFilter
	Thisform.lApplyFilter = .t.
	Thisform.ApplyFilter()
EndIf

ThisForm.UpdateTreeView()



ENDPROC
PROCEDURE showform
Lparameters tcFormName

Local llReturn, lnI

If Empty(tcFormName)
	Return
Endif
llReturn = .f.

For lnI = 1 To _Screen.FormCount
    If Upper(_Screen.Forms(lnI).Name) = Upper(tcFormName)

        With _Screen.Forms (lnI)
            If .WindowState = 1
                .WindowState = 0
            Endif
            .Show()
        EndWith
        llReturn = .t.
        Exit
    Endif
EndFor

Return llReturn 
ENDPROC
PROCEDURE showgofishhelppage
oShell = Createobject("wscript.shell")
oShell.Run('http://vfpx.codeplex.com/wikipage?title=GoFish%20Replace%20Help')

ENDPROC
PROCEDURE showhelpform
Do Form 'GoFish_About'
ENDPROC
PROCEDURE showhtml
Lparameters tcHtml

Local loWebContainer

loWebContainer = Thisform.containerRight.container2.ContainerWebControl

loWebContainer.ShowHtml(tcHtml) 
ENDPROC
PROCEDURE showhtmlcodeview
Local lcCode, lcCss, lcCssFile, lcCursor, lcHtml, lcJavaScript, lcJavaScriptFile, lcMatchLine
Local lcExt, lcReplaceLine, lnMatchStart, loSearchEngine, loWebControl

lcCursor = Thisform.cSearchResultsAlias
loSearchEngine = Thisform.oSearchEngine
loWebControl = ThisForm.containerRight.container2.containerWebControl

*-- These file types cannot be rendered ------------------
lcExt = Alltrim(Upper(&lcCursor..filetype))
If (' ' + lcExt + ' ') $ This.cDoNotRenderExtensions
	loWebControl.ShowHtml('Cannot render this file type.')
	Return
Endif

lcCode = Substr(&lcCursor..Code, &lcCursor..procstart + 1)

lnMatchStart = &lcCursor..matchstart - &lcCursor..procstart
lcMatchLine = &lcCursor..matchline
lcReplaceLine = &lcCursor..replaceline

lcCssFile = _Screen._GoFish.cAppPath + 'CSS\GoFish.css'
lcJavaScriptFile = _Screen._GoFish.cAppPath + 'HTML\GoFish.js'

lcCss = Iif(File(lcCssFile), FileToStr(lcCssFile), '')
lcJavaScript = Iif(File(lcJavaScriptFile), FileToStr(lcJavaScriptFile), '')

lcHtml = loSearchEngine.GenerateHTMLCode(lcCode, lcMatchLine, lnMatchStart, lcCss, lcJavaScript, lcReplaceLine, &lcCursor..replaced)

loWebControl.ShowHtml(lcHtml)


  
ENDPROC
PROCEDURE showoptionsform
Do Form GoFish_Options with Thisform && Calls a Modal form...

lnRecno = Recno(This.cSearchResultsAlias)

Thisform.SaveFormSettings()
Thisform.LoadFormSettings()

If Thisform.nReplaceRisk = 0
	Thisform.lReplaceMode = .f. && Will trigger the _assign method
Endif

*-- Unmark any marked records where the replacerisk is higher than the new setting
Update (thisform.cSearchResultsAlias) Set process = .f. where replacerisk > thisform.nReplaceRisk

Select (this.cSearchResultsAlias)
Try
	Goto (lnRecno)
Catch
EndTry

Thisform.Refresh


ENDPROC
PROCEDURE showreplacehistory
Local lcDetail, lcDetailDBC, lcMaster, lnSelect

lnSelect = Select()

lcMaster = Addbs(Home(7)) + 'GF_Replace_History.dbf'
lcDetail = Addbs(Home(7)) + 'GF_Replace_Detail.dbf'
lcDetailDBC = Addbs(Home(7)) + 'GF_Replace_Detail.dbc'

If !File(lcMaster) or !File(lcDetail) or !File(lcDetailDBC) 
	MessageBox('One of your Replace History files is missing. Cannot browse Replace History.', 16, 'File(s) missing')
	Return .f.
Endif

Select Master.Id, ;
			 Date_time, ;
			 scope, ;
			 filepath, ;
			 searchstr, ;
			 replacestr, ;
			 trimmedmatchline, ;
			 trimmedreplaceline, ;
			 matchtype, ;
			 objectname, ;
			 methodname, ;
			 column, ;
			 recno, ;
			 procstart, ;
			 matchstart ;
  From (lcMaster) master ;
		Join (lcDetail) Detail on Master.id = Detail.id ;
	Order By Date_Time desc ;
	Into Cursor GoFishReplaceHistory

Browse NoWait Normal Title "GoFish Replace History"
 
Select (lnSelect)  
ENDPROC
PROCEDURE showreplacepanel
loReplacePanel = Thisform.containerRight.container1.containerReplaceText

If loReplacePanel.visible = .t.
	Return
Endif

lnHeightChange = This.parent.containerReplaceText.Height * -1


ENDPROC
PROCEDURE sortcolumn
Local lcControlSource, lcField, lcNewSortOrder, lcSortField1, lcSortField2, lcSortField3
Local lcSortFields, lcSortOrder, lnSelect, loCalledBy, loHeader, loColumn
Local loColumn, laCurrentEvent[1]

AEvents(laCurrentEvent,0)
loCalledBy = laCurrentEvent[1] && should be a Header object
loHeader = Evl(loHeader, loCalledBy)

lcField = Upper(GetWordNum(loHeader.Parent.ControlSource, 2, '.'))

If Upper(lcField) = 'CODE'
	MessageBox('Cannot sort by this column.', 16, 'Notice:')
	Return .f.
Endif

For each loColumn in This.oGrid.Columns
	loColumn.header1.FontBold = .f.
Endfor
loHeader.FontBold = .t.

*-- Read current Sort fields and Sort Order ------------------
lcSortOrder = Upper(Thisform.cSortOrder)
lcSortFields = Thisform.cSortFields
lcSortField1 = Upper(GetWordNum(lcSortFields, 1, ','))
lcSortField2 = Upper(GetWordNum(lcSortFields, 2, ','))
lcSortField3 = Upper(GetWordNum(lcSortFields, 3, ','))

If 'TIMESTAMP' $ Upper(loHeader.Parent.ControlSource)
	lcNewSortOrder= 'DESCENDING'
Else
	lcNewSortOrder= ''
Endif

Do Case
	Case lcField = lcSortField1 or Empty(lcSortField1) && Same column, so need to reverse Asc/Desc
		lcSortFields= lcField + ',' + lcSortField2 + ',' + lcSortField3
		lcNewSortOrder = Iif(('DESC' $ lcSortOrder), '', 'DESCENDING')
	Case lcField = lcSortField2
		lcSortFields= lcField + ',' + lcSortField1 + ',' + lcSortField3
	Otherwise
		lcSortFields= lcField + ',' + lcSortField1 + ',' + lcSortField2
Endcase

Thisform.cSortFields = lcSortFields
Thisform.cSortOrder = lcNewSortOrder

Thisform.FillSearchResultsCursor()

If thisform.lReplaceMode = .t.
	Thisform.DoReplace(.t.) && .t. means do a "Preview" Replace
Endif

Thisform.oGrid.Setfocus()

Keyboard '{UPARROW}' && Required to get the grid to update and sync with newly built cursor.


ENDPROC
PROCEDURE updateformaftereplace
Lparameters tnRecordId

Thisform.FillSearchResultsCursor()

Select(Thisform.cSearchResultsAlias)
Goto Top

Locate For Id = tnRecordId

Try
	Thisform.oGrid.SetFocus()
Catch
Endtry

Thisform.Refresh()

Thisform.ShowCodeForCurrentRow(.T.)


ENDPROC
PROCEDURE updateformaftersearch
Local loSearchEngine

Thisform.lSearching = .f.

loSearchEngine = Thisform.oSearchEngine

If loSearchEngine.lEscPress
	Messagebox('Processing stopped due to ESCAPE press.', 64, 'Notice:')
EndIf

If loSearchEngine.lResultsLimitReached
	Messagebox('Processing stopped due to maximum results limit.' + Chr(13) + Chr(13) +;
						 'Adjust value in Options if desired.', 64, 'Notice:')
EndIf

If loSearchEngine.nMatchLines > 0
	If Thisform.lApplyFilter
		Thisform.ApplyFilter()
	Else
		Set Filter To in (this.cSearchResultsAlias)	
	Endif
	ThisForm.FillSearchResultsCursor() && Pulls records from the search engine's results cursor.
	Thisform.ShowCodeForCurrentRow()
Else
	Thisform.editSearch.SetFocus()
EndIf

This.FormatProcessColumn()

ThisForm.UpdateTreeView()

  
ENDPROC
PROCEDURE updatesearchenginecursor
*-- This method copies over certain fields from the local cursor to the GFSE cursor
Local lcSearchEngineCursor, lcSearchResultsAlias, lnSelect

lcSearchResultsAlias = Thisform.cSearchResultsAlias
lcSearchEngineCursor = Thisform.oSearchEngine.cSearchResultsAlias

lnSelect = Select()
Select (lcSearchResultsAlias)

MessageBox("start 1")
Scan
	Update (lcSearchEngineCursor) ;
		Set  Process = &lcSearchResultsAlias..Process ;
		Where id = &lcSearchResultsAlias..id  
Endscan 
MessageBox("end 1")



MessageBox("start 2")

Scan
lnId = id
llProcess = process
replace process with llProcess for id = lnId in (lcSearchEngineCursor) 
Endscan 



MessageBox("end 2")
Select (lnSelect) 
ENDPROC
PROCEDURE updatesearchscopevariables
With Thisform
	.cActiveProject = Thisform.oSearchEngine.GetActiveProject()
	.cCurrentDir = Thisform.oSearchEngine.GetCurrentDirectory()
	.oSearchEngine.AddProject(.cActiveProject)

	If Empty(.oSearchEngine.oSearchOptions.cPath)
		.oSearchEngine.oSearchOptions.cPath = .cCurrentDir
	Endif

Endwith



ENDPROC
PROCEDURE updatetreeview
Goto Top In (Thisform.cSearchResultsAlias)

Thisform.Refresh()

If !Eof(Thisform.cSearchResultsAlias)&& Thisform.oSearchEngine.nMatchLines > 0
	Thisform.PopulateTreeview()
	Thisform.oGrid.SetFocus()
Else
	lcResults = Thisform.containerRight.container1.lblResults.Caption
	Thisform.PopulateTreeview(lcResults, 128)
	Thisform.ShowHtml('<h3>&nbsp;&nbsp;&nbsp;' + lcResults + '</h3>')
Endif


ENDPROC
PROCEDURE validateinputs
Local loGrid, loSearchEngine, loSearchOptions, loTimeStampToControl, lcPath

loSearchOptions = Thisform.oSearchEngine.oSearchOptions
lcScope = Thisform.GetCurrentScope()

*-- Validate Directory (for Curr Dir or Browsed Dir)
If InList(loSearchOptions.nSearchScope, 3, 4)

	lcPath = Addbs(lcScope)
	If !Directory(lcPath, 1)
		MessageBox('Invalid Directory [' + lcPath + ']. Please correct.', 0, 'GoFish Error:')
		Return .f.
	Endif
Endif

*-- Validate Project file can be found (for Active Project and Browsed Project)
If InList(loSearchOptions.nSearchScope, 1, 2)
	If !File(lcScope)
		MessageBox('Cannot find project file [' + lcScope + ']. Please correct.', 0, 'GoFish Error:')
		Return .f.
	Endif
Endif

*-- Must Specify a search expression, unless you are searching by TimeStamps
If Empty(loSearchOptions.cSearchExpression) and !loSearchOptions.lTimeStamp
	Messagebox('Please specify a search string.', 16, 'GoFish')
	Return .f.
Endif

*-- Make sure at least one date is supplied if timestamp box is checked.
If loSearchOptions.lTimeStamp = .t. and Empty(loSearchOptions.dTimeStampFrom) and Empty(loSearchOptions.dTimeStampTo)
	MessageBox('At least one TimeStamp date must be entered, or else clear checkbox.', 16, 'GoFish')
EndIf

If !Thisform.ClearSearchResultsCursor()
	Return .f.
EndIf

 
ENDPROC
PROCEDURE validatereplaceexpression
#DEFINE CR Chr(13)

Local laHighRiskCount[1], laSelectedCount[1], lcExample, lcReplaceExpression, lnResponse

lcReplaceExpression = Thisform.oSearchEngine.oSearchOptions.cReplaceExpression
lcUDFCode = Thisform.oSearchEngine.cReplaceUDFCode
lcExample = Strtran(lcReplaceExpression, ' ', '{SPACE}') 


If Thisform.nReplaceMode = 3  && UDF Replace mode
	If Empty(lcUDFCode)
		MessageBox('UDF Replace code is empty.',16, 'WARNING:')
		Return .f.
	Else
		Return .t.
	Endif
Endif

If Len(lcReplaceExpression) = 0
	lnResponse = MessageBox('The Replace expression is an empty string.' + CR + CR + ;
													'Are you sure you want to proceed with an empty Replace string?', 3, 'WARNING:')
	If lnResponse <> 6
		Thisform.oSearchEngine.oSearchOptions.lAllowBlankReplace = .f.
		Return .f.
	EndIf
	
	Thisform.oSearchEngine.oSearchOptions.lAllowBlankReplace = .t.
EndIf

If Empty(lcReplaceExpression) and Len(lcReplaceExpression) > 0
	lnResponse = MessageBox('The Replace expression contains only spaces.' + CR + CR + ;
													'Are you sure you want to proceed with this Replace string?' + CR + CR + ;
													lcExample, 3, 'WARNING:')
	If lnResponse <> 6
		Thisform.oSearchEngine.oSearchOptions.lAllowBlankReplace = .f.
		Return .f.
	EndIf
	
	Thisform.oSearchEngine.oSearchOptions.lAllowBlankReplace = .t.
EndIf

If Left(lcReplaceExpression, 1) = ' ' and Right(lcReplaceExpression, 1) <> ' '
	lnResponse = MessageBox('The Replace expression contains 1 or more leading spaces.' + CR + CR + ;
													'Are you sure you want to proceed with this Replace string?'  + CR + CR + ;
													lcExample, 3, 'WARNING:')
	If lnResponse <> 6
		Return .f.
	EndIf
EndIf

If Left(lcReplaceExpression, 1) <> ' ' and Right(lcReplaceExpression, 1) = ' '
	lnResponse = MessageBox('The Replace expression contains 1 or more trailing spaces.' + CR + CR + ;
													'Are you sure you want to proceed with this Replace string?'  + CR + CR + ;
													lcExample, 3, 'WARNING:')
	If lnResponse <> 6
		Return .f.
	EndIf
EndIf

If Left(lcReplaceExpression, 1) = ' ' and Right(lcReplaceExpression, 1) = ' ' and !Empty(lcReplaceExpression) 
	lnResponse = MessageBox('The Replace expression contains leading and trailing SPACES.' + CR + CR + ;
													'Are you sure you want to proceed with this Replace string?'  + CR + CR + ;
													lcExample, 3, 'WARNING:')
	If lnResponse <> 6
		Return .f.
	EndIf
EndIf

*-- Notify user if they have selected any high-risk rows to replace
Select Count(id) from (thisform.cSearchResultsAlias);
 Where process = .t. and ReplaceRisk > 1;
 Into Array laHighRiskCount

If laHighRiskCount > 0 

	lnResponse = MessageBox('====================================================' + CR +;
													'             W  A  R  N  I  N  G	' + CR + ;
													'====================================================' + CR + CR +;
													'You have one or more high risk Match Types selected which could damage' + CR + ;
													'your files and prevent them from opening if your replace expression ' + CR + ;
													'results in invalid code.' + CR + CR + ;
													'Are you sure you want to proceed?', 3, 'GoFish Replace')
	If lnResponse <> 6
		Return .f.
	EndIf
EndIf 



   
ENDPROC
PROCEDURE viewreport
Local laFields[1], lcAscDesc, lcCursor, lcField, lcFieldList, lcFilename, lcFilter, lcHeader, lcHtml
Local lcOrderBy, lcResultsGridHtmlCursor, lcTable, lnX, loColumn, loShell

lnSelect = Select()
lcCursor = This.cSearchResultsAlias

Dimension laFields[1, 2]
lcFieldList = ''
lnX = 1

*-- Set Header captions from Field name -----------------
For Each loColumn In Thisform.oGrid.Columns
	If loColumn.Visible = .T.
		If lnX > 1
			Dimension laFields[lnX, 2]
		Endif
		laFields[lnX, 1] = Transform(loColumn.ColumnOrder, '999')
		laFields[lnX, 2] = loColumn.ControlSource
		lnX = lnX + 1
	Endif
Endfor

=Asort(laFields)

For lnX = 1 To Alen(laFields) / 2
	If !Empty(lcFieldList)
		lcFieldList = lcFieldList + ','
	Endif
	lcFieldList = lcFieldList + laFields[lnX, 2]
Endfor

If !Empty(This.cFilter) And Thisform.lApplyFilter
	lcFilter = 'Where ' + This.cFilter
Else
	lcFilter = ''
Endif

If !Empty(Thisform.cSortFields)
	lcField = Getwordnum(Thisform.cSortFields, 1, ',')
	lcAscDesc = Getwordnum(Thisform.cSortOrder, 1, ',')
	lcAscDesc = Iif('DESC' $ lcAscDesc, 'DESCENDING', '')

	lcOrderBy = 'Order By ' + lcField + ' ' + lcAscDesc
Else
	lcOrderBy = ''
Endif

lcResultsGridHtmlCursor = 'ResultsGridHtml'
Select &lcFieldList From &lcCursor &lcFilter &lcOrderBy Into Cursor &lcResultsGridHtmlCursor Readwrite

If 'matchtype' $ Lower(lcFieldList)
	Replace matchtype With Strtran(matchtype, '<', '') All
	Replace matchtype With Strtran(matchtype, '>', '') All
Endif

Goto Top

Text To lcHeader Textmerge Noshow
	<Html>
	<Head>

	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

	<script>$(document).ready(function(){
	   $("tr:even").css("background-color", "#F4F4A8");
	   $("tr:odd").css("background-color", "#EFF1D1");});
	</script>

	</Head>

	<Body>
		Scope&nbsp;: &nbsp;&nbsp; <<Thisform.GetCurrentScope()>> &nbsp;&nbsp;&nbsp;&nbsp; <<Thisform.cSearchResultsMessage>> &nbsp;&nbsp;&nbsp;&nbsp; <<Ttoc(DateTime())>> <br />
		Search: &nbsp;&nbsp; <<Thisform.oSearchEngine.oSearchOptions.cSearchExpression>> <br />
		<<Thisform.cResultsMessage>> <br />
		<hr />

Endtext

lcTable = Thisform.oWebControl.CursorToHtml(lcResultsGridHtmlCursor, 'Results')

lcHtml = lcHeader + lcTable + '</body></Html>'

lcFilename = Addbs(Sys(2023)) + 'GF_ResultsGrid.html'

Strtofile(lcHtml, lcFilename)

loShell = Newobject('_ShellExecute', Home(1) + 'Ffc\' + '_environ.vcx')
loShell.ShellExecute(lcFilename)
loShell.Release()

Select (lnSelect)

ENDPROC
[END METHODS]
[START RESERVED3]
*addclassestotreeview 
*adjustformforreplacepanel 
*applyfilter 
*checkall 
*clearall 
*cleargfsefilter 
*clearsearchresultscursor 
*confirmreplace 
*createindex 
*doreplace 
*dosearch 
*editfile 
*expandallnodes 
*fillsearchresultscursor 
*filtergfse 
*findcolumn 
*formatgrid 
*formatgridforreplacemode 
*formatprocesscolumn 
*getcurrentscope Will return the Active Project, Browsed Project, Current Dir, or Browsed Dir depending on current setting of nSearchScope (Values: 1 through 4)
*loadformsettings 
*loadreplaceline 
*lreplacemode_assign 
*mhelpnotes 
*navigatetomasterrecord 
*nreplacemode_assign 
*populatetreeview 
*replace 
*replaceline 
*restoredefaultdir 
*restoreindex 
*restoresearchengineoptions 
*saveformsettings 
*search 
*setcaption 
*seterror 
*setpath 
*setproject 
*setscope 
*setsearchexpression 
*showadvancedform 
*showcodeforcurrentrow 
*showfilterform 
*showform 
*showgofishhelppage 
*showhelpform 
*showhtml 
*showhtmlcodeview 
*showoptionsform 
*showreplacehistory 
*showreplacepanel 
*sortcolumn 
*updateformaftereplace 
*updateformaftersearch 
*updatesearchenginecursor 
*updatesearchscopevariables 
*updatetreeview 
*validateinputs 
*validatereplaceexpression 
*viewreport 
_memberdata XML Metadata for customizable properties
cactiveproject
cbrowseproject
ccurrentdir
cdonotrenderextensions A list of common file types that cannot be rendered in the code viewer on the GoFish form.
cfilter
chtmlcodeviewfilename
cinitialdefaultdir
creplaceline
creplaceudffilename
cresultsmessage
csearchoptionsxmlfile
csearchresultsalias
csearchresultsmessage
csortfields
csortorder
cuisettingsfile
lapplyfilter
lautoyield
linit
lreplaceformvisible
lreplacemode
lsavesettings This property can be used to prevent the form from saving its settings when closed. It will start out .T. each time GoFish is launched.
lsearchformvisible
lsearching
nbrowserzoom
ncurrentid
ndropdowndisplaycount Controls the numbner of history items shown in the Search Expression and Scope history dropdown boxes.
ngridfontsize
noriginalsearchscope The original value of nSearchScope on the SearchOptions after reading the xml files. Used to restore value right before saving the settings upon exit (if SearchScope combo is used).
nreplacemode
nreplacerisk
nsplitterposratio
obrowser
ogrid
osearchengine
osearchoptions
otree
owebcontrol
z_lincludesubdirectoriesbrowsed
z_lincludesubdirectoriescurrent
[END RESERVED3]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CM0QHXUF
[CLASS] checkbox
[BASECLASS] checkbox
[OBJNAME] chkcomment
[PARENT] gofish
[START PROPERTIES]
Alignment = 0
Anchor = 8
AutoSize = .T.
Caption = "Co\<mments"
ControlSource = "Thisform.oSearchEngine.oSearchOptions.lSearchInComments"
FontSize = 8
Height = 16
Left = 658
Name = "chkcomment"
TabIndex = 15
ToolTipText = "Search in comments"
Top = 37
Value = .F.
Width = 68
ZOrderSet = 6
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching &&and !Thisform.lReplaceMode
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CM0QBO7H
[CLASS] checkbox
[BASECLASS] checkbox
[OBJNAME] chkLimitToProjectFolder
[PARENT] gofish
[START PROPERTIES]
Alignment = 0
Anchor = 8
AutoSize = .T.
BackStyle = 0
Caption = "Limit to home..."
ControlSource = "thisform.oSearchOptions.lLimitToProjectFolder"
FontSize = 8
Height = 16
Left = 471
Name = "chkLimitToProjectFolder"
TabIndex = 12
ToolTipText = "Limit search to project home directory and sub-folders"
Top = 37
Width = 89
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching &&and !Thisform.lReplaceMode

This.Visible = ('.PJX' $ Upper(Thisform.comboSearchScopeHistory.Text))

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CM0JH8J3
[CLASS] checkbox
[BASECLASS] checkbox
[OBJNAME] chkMatchWholeWord
[PARENT] gofish
[START PROPERTIES]
Alignment = 0
Anchor = 8
AutoSize = .T.
BackStyle = 0
Caption = "\<Whole word"
ControlSource = "thisform.oSearchEngine.oSearchOptions.lMatchWholeWord"
FontBold = .F.
FontName = "Tahoma"
FontSize = 8
Height = 15
Left = 565
Name = "chkMatchWholeWord"
TabIndex = 14
Top = 37
Value = .T.
Width = 75
ZOrderSet = 7
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Thisform.oSearchEngine.ClearReplaceSettings()
ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching &&and !Thisform.lReplaceMode
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CM0PXGP8
[CLASS] checkbox
[BASECLASS] checkbox
[OBJNAME] chkSubdirectories
[PARENT] gofish
[START PROPERTIES]
Alignment = 0
Anchor = 8
AutoSize = .T.
BackStyle = 0
Caption = "Subdirectories"
ControlSource = "Thisform.oSearchOptions.lIncludeSubDirectories"
FontSize = 8
Height = 16
Left = 471
Name = "chkSubdirectories"
TabIndex = 11
ToolTipText = "Include subdirectories in search"
Top = 37
Width = 88
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching && and !Thisform.lReplaceMode

This.Visible = !('.PJX' $ Upper(Thisform.comboSearchScopeHistory.text))

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdAdvanced
[PARENT] gofish
[START PROPERTIES]
Anchor = 8
Caption = "\<Advanced"
FontSize = 8
Height = 22
Left = 562
Name = "cmdAdvanced"
Picture = ('images\find.bmp')
PicturePosition = 1
SpecialEffect = 2
TabIndex = 5
Top = 7
Width = 76
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Thisform.ShowAdvancedForm()


ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching && and !Thisform.lReplaceMode

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdHelp
[PARENT] gofish
[START PROPERTIES]
Anchor = 9
Caption = ""
FontName = "Tahoma"
Height = 22
Left = 969
Name = "cmdHelp"
Picture = ('images\refhelp.bmp')
PicturePosition = 1
SpecialEffect = 2
TabIndex = 16
Top = 17
Width = 24
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.ShowHelpForm()
ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdOptions
[PARENT] gofish
[START PROPERTIES]
Anchor = 8
Caption = "\<Options"
FontSize = 8
Height = 22
Left = 658
Name = "cmdOptions"
Picture = ('images\properties.bmp')
PicturePosition = 1
SpecialEffect = 2
TabIndex = 9
Top = 7
Width = 62
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.ShowOptionsForm()

ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching&& and !Thisform.lReplaceMode
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdSearch
[PARENT] gofish
[START PROPERTIES]
Anchor = 8
Caption = " \<Go Fish"
FontSize = 8
Height = 22
Left = 468
Name = "cmdSearch"
Picture = ('images\GoFish16.bmp')
PicturePosition = 1
SpecialEffect = 2
TabIndex = 4
Top = 7
Width = 68
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.Search()

ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching &&and !Thisform.lReplaceMode
ENDPROC
PROCEDURE RightClick
Do Form 'GF_Collection_Explorer' with This

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CJ0SZW28
[CLASS] gf_combosearchexpressionhistory
[CLASSLOC] ..\lib\gofishui.vcx
[BASECLASS] combobox
[OBJNAME] comboSearchExpressionHistory
[PARENT] gofish
[START PROPERTIES]
Height = 26
Left = 47
Name = "comboSearchExpressionHistory"
TabIndex = 19
TabStop = .F.
Top = 3
Width = 416
nexpressionstostore = 50
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.DisplayCount = Thisform.nDropDownDisplayCount

DoDefault()

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] combobox
[BASECLASS] combobox
[OBJNAME] comboSearchExpressionHistoryDropDownArrow
[PARENT] gofish
[START PROPERTIES]
Anchor = 8
BorderColor = 255,255,255
Height = 26
Left = 442
Name = "comboSearchExpressionHistoryDropDownArrow"
TabIndex = 24
TabStop = .F.
Top = 14
Width = 21
[END PROPERTIES]
[START METHODS]
PROCEDURE GotFocus
Local loCombo

*-- Store current value of editbox. I the user presses ESCAPE in the actual combobox,
*-- the oringal value can be recovered from here.
This.Tag = This.Parent.editSearch.Value

loCombo = This.Parent.comboSearchExpressionHistory

With loCombo
	.ListIndex = 1
	.Visible = .T.
	.SetFocus()
Endwith

This.ZOrder(1)

*-- Do this to force the combobox to drop down...
Mouse Click At This.Top + Int(This.height / 2), This.Left + Int(This.width/2) PIXELS Window (Thisform.Name)

*Keyboard '{ALT+DNARROW}' && To expand the actual dropdown listbox that holds all the values
ENDPROC
PROCEDURE Init
this.Top = this.Parent.editSearch.top
ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching && and !Thisform.lReplaceMode
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CM0JP1CQ
[CLASS] gf_combosearchscope
[CLASSLOC] ..\lib\gofishui.vcx
[BASECLASS] combobox
[OBJNAME] comboSearchScopeHistory
[PARENT] gofish
[START PROPERTIES]
BoundTo = .T.
ControlSource = "Thisform.oSearchEngine.oSearchOptions.cRecentScope"
Height = 25
Left = 70
Name = "comboSearchScopeHistory"
SelectOnEntry = .T.
TabIndex = 10
Top = 31
Width = 393
nexpressionstostore = 40
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching && and !Thisform.lReplaceMode

This.DisplayCount = Thisform.nDropDownDisplayCount

DoDefault()

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2B8
[CLASS] container
[BASECLASS] container
[OBJNAME] containerLeft
[PARENT] gofish
[START PROPERTIES]
Anchor = 5
BackColor = 255,255,255
Height = 537
Left = 2
Name = "containerLeft"
TabIndex = 17
Top = 58
Width = 187
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2B9
[CLASS] olecontrol
[BASECLASS] olecontrol
[OBJNAME] oTreeView
[PARENT] gofish.containerLeft
[START PROPERTIES]
Anchor = 15
Height = 535
Left = 0
Name = "oTreeView"
Top = 0
Width = 186
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
*** ActiveX Control Event ***

ENDPROC
PROCEDURE DblClick
Local loPBT as 'GF_PEME_BaseTools'
Local lcClass, lcExt, lcFile, lcKey, llClass, lnCount, loNode

lcFile = ''
lcExt = ''
lcClass = ''
llClass = .f.

loNode = This.selectedItem

lcKey = loNode.Key
lnCount = Atc('_', lcKey, 2)
lcFile = Substr(lcKey, lnCount + 1)
lcExt = JustExt(lcFile)

Do Case
	Case loNode.index = 1 or loNode.parent.index = 1 && One of the Main Root Nodes
		lcFile = ''
	
	Case Empty(lcExt) or lnCount = 0
		lcClass = loNode.Text
		lcKey = This.selectedItem.parent.Key
		lnCount = Atc('_', lcKey, 2)
		lcFile = Substr(lcKey, lnCount + 1)
		If File(lcFile) and !Empty(lcClass)
			llClass = .t.
		Endif
		
EndCase

If Empty(lcFile) or !File(lcFile)
	Return
Endif

loPBT = CreateObject('GF_PEME_BaseTools')
loPBT.EditSourceX(lcFile, lcClass, 0, 0, '')


    
ENDPROC
PROCEDURE Init
thisform.oTree = this
ENDPROC
PROCEDURE NodeClick
Lparameters node

Local lcAlias, lcClass, lcFileType, lcFilename, lcFilter, lcFullFileName, lcFullSearchResults
Local lcNewFilter, lnId, lnSelect, loClassLibsNode, loVcxNode

lnSelect = Select()
lcAlias = Thisform.cSearchResultsAlias
lcFilter = ''

*-- Build Filter clause for selected Node----------------------------
Do Case
	Case node.index = 1 && Master top node
		lcFilter = ''
	
	Case node.parent.index = 1 && One of the Main Root Nodes
		lcFileType = Upper(GetWordNum(node.key, 2, '_'))
		If lcFileType $ ' SCX VCX PRG FRX '
			lcFilter = 'Upper(Filetype) = [' + lcFileType + ']'
		Else
			lcFilter = '!(Upper(Filetype) $ [ SCX VCX PRG FRX ])'
		Endif

	Otherwise
		lnId = Val(GetWordNum(node.key, 2, '_'))

		If ThisForm.NavigateToMasterRecord(lnId)
			lcFilter = 'filepath = [' + Alltrim(filepath) + ']'
		Endif
EndCase

If 'CLASS_' $ Upper(node.key)
	lcFilter = lcFilter + ' and class = [' + Alltrim(class) + ']'
Endif

*--- Merge Main form filter and TreeView filter
If thisform.lApplyFilter and !Empty(Thisform.cFilter) and !Empty(lcFilter)
	lcNewFilter = Alltrim(Thisform.cFilter) + ' and ' + lcFilter
Else
	lcNewFilter = lcFilter
Endif

Select(lcAlias) 
Set Filter To &lcNewFilter
Goto top

Thisform.oGrid.SetFocus
This.SetFocus() 

Thisform.Refresh()

Select(lcAlias) 


ENDPROC
[END METHODS]
[BINSTART OLE]
CHECKSUM=8422
[BINEND OLE]
[BINSTART OLE2]
CHECKSUM=12845
[BINEND OLE2]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BA
[CLASS] container
[BASECLASS] container
[OBJNAME] containerRight
[PARENT] gofish
[START PROPERTIES]
Anchor = 15
Height = 537
Left = 199
Name = "containerRight"
TabIndex = 20
Top = 58
Width = 800
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] container
[BASECLASS] container
[OBJNAME] Container1
[PARENT] gofish.containerRight
[START PROPERTIES]
Anchor = 10
Height = 357
Left = 0
Name = "Container1"
TabIndex = 5
Top = 0
Width = 800
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] checkbox
[BASECLASS] checkbox
[OBJNAME] chkApplyFilter
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Alignment = 0
Caption = "Apply"
ControlSource = "Thisform.lApplyFilter"
FontSize = 8
Height = 20
Left = 491
Name = "chkApplyFilter"
TabIndex = 7
Top = 5
Width = 48
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
If this.Value = .t.
	Thisform.ApplyFilter()
Else
	Set Filter To In (Thisform.cSearchResultsAlias)
EndIf

ThisForm.UpdateTreeView()


ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DM1DC447
[CLASS] checkbox
[BASECLASS] checkbox
[OBJNAME] chkReplaceMode
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Alignment = 0
Caption = "\<Replace Mode"
ControlSource = "Thisform.lReplaceMode"
FontSize = 8
Height = 20
Left = 29
Name = "chkReplaceMode"
TabIndex = 7
Top = 5
Width = 93
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
If thisform.oSearchEngine.oSearchOptions.lEnableReplaceMode = .f.
	This.Value = .f.
	MessageBox('You must enable Replace Mode in the Options form before it can be used.', 32, 'Notice')
	Thisform.editSearch.SetFocus()
Endif

DoDefault()

If thisform.lReplaceMode = .t.

	Do Case
		Case Thisform.nReplaceMode = 1
			This.Parent.containerReplaceText.SetFocus()
		Case Thisform.nReplaceMode = 2
			This.Parent.containerReplaceLine.SetFocus()
		Case Thisform.nReplaceMode = 3
			This.Parent.containerAdvancedReplace.Setfocus()
	EndCase

EndIf



ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DN00O630
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdCheckAll
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Caption = "Check All"
Enabled = .T.
FontSize = 8
Height = 19
Left = 3
Name = "cmdCheckAll"
Top = 59
Visible = .T.
Width = 55
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.CheckAll()

ENDPROC
PROCEDURE Refresh
This.Visible = Thisform.lReplaceMode and Thisform.nReplaceMode <> 2

This.Enabled = (Reccount(Thisform.cSearchResultsAlias) > 0)

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DN00O631
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdClearAll
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Caption = "Clear All"
Enabled = .T.
FontSize = 8
Height = 19
Left = 60
Name = "cmdClearAll"
Top = 59
Visible = .T.
Width = 51
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.ClearAll()


ENDPROC
PROCEDURE Refresh
This.Visible = Thisform.lReplaceMode and Thisform.nReplaceMode <> 2

This.Enabled = (Reccount(Thisform.cSearchResultsAlias) > 0)

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DH0VDEB3
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdFilter
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Caption = "\<Filter"
Enabled = .F.
FontName = "Tahoma"
FontSize = 8
Height = 20
Left = 434
Name = "cmdFilter"
Picture = ('images\filter.bmp')
PicturePosition = 1
SpecialEffect = 2
TabIndex = 6
Top = 4
Width = 53
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.ShowFilterForm()
ENDPROC
PROCEDURE Refresh
This.FontBold = !Empty(Thisform.cFilter)&& and Thisform.lApplyFilter

This.Enabled = Reccount(Thisform.cSearchResultsAlias) > 0 and !Thisform.lSearching &&and !Thisform.lReplaceMode

This.Parent.chkApplyFilter.Enabled = This.Enabled and !Empty(Thisform.cFilter)

ENDPROC
PROCEDURE RightClick
Local lcFilter

lcFilter = Filter(thisform.cSearchResultsAlias)

MessageBox(lcFilter, 0, 'GoFish Filter') 
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdReplaceErrors
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Caption = "!"
FontBold = .T.
FontSize = 12
Height = 22
Left = 405
Name = "cmdReplaceErrors"
Picture = ..\images\red_circle_x_16.bmp
PicturePosition = 14
SpecialEffect = 2
ToolTipText = "Show search errors"
Top = 3
Width = 24
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Do Form 'GF_Collection_Explorer' with Thisform.oSearchEngine.oReplaceErrors

*-- For now, Object Inspector slow VFP way down, so can't use it until that gets fixed.
*!*	Local loInspector

*!*	loInspector = ExecScript(_Screen.cThorDispatcher, "Class= inspector from inspector")

*!*	If Vartype(loInspector) = 'O' 
*!*		loInspector.oRoot = Thisform.oSearchEngine.oReplaceErrors
*!*		loInspector.Caption = 'GoFish Replace Errors:'
*!*		loInspector.Show()
*!*	Endif

*!*	 
ENDPROC
PROCEDURE Refresh
This.Visible = (Thisform.oSearchEngine.oReplaceErrors.Count > 0) and !thisform.lSearching
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DN00O632
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdReplaceHistory
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Anchor = 8
Caption = "View Replace History"
Enabled = .T.
FontSize = 8
Height = 22
Left = 676
Name = "cmdReplaceHistory"
Top = 58
Visible = .T.
Width = 116
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Thisform.ShowReplaceHistory()

ENDPROC
PROCEDURE Refresh
This.Visible = Thisform.lReplaceMode

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DH0VDEB2
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdReport
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Caption = "Re\<port"
FontName = "Tahoma"
FontSize = 8
Height = 22
Left = 543
Name = "cmdReport"
Picture = ('images\doc.bmp')
PicturePosition = 1
SpecialEffect = 2
TabIndex = 8
Top = 4
Width = 63
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Thisform.ViewReport()
ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching and !Eof(Thisform.cSearchResultsAlias) && and !Thisform.lReplaceMode
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DH0VDEB4
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdSearchErrors
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Caption = "!"
FontBold = .T.
FontSize = 12
Height = 22
Left = 2
Name = "cmdSearchErrors"
Picture = ..\images\yellow_exclamation_16.bmp
PicturePosition = 14
SpecialEffect = 2
ToolTipText = "Show search errors"
Top = 4
Width = 24
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Do Form 'GF_Collection_Explorer' with Thisform.oSearchEngine.oSearchErrors

*-- For now, Object Inspector slow VFP way down, so can't use it until that gets fixed.
*!*	Local loInspector

*!*	loInspector = ExecScript(_Screen.cThorDispatcher, "Class= inspector from inspector")

*!*	If Vartype(loInspector) = 'O' 
*!*		loInspector.oRoot = Thisform.oSearchEngine.oSearchErrors
*!*		loInspector.Caption = 'GoFish Search Errors:'
*!*		loInspector.Show()
*!*	Endif


 
ENDPROC
PROCEDURE Refresh
This.Visible = (Thisform.oSearchEngine.oSearchErrors.Count > 0) and !thisform.lSearching
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DN00O633
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] Command1
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Caption = ""
FontName = "Tahoma"
Height = 22
Left = 319
Name = "Command1"
Picture = ('images\refhelp.bmp')
PicturePosition = 1
SpecialEffect = 2
TabIndex = 16
Top = 57
Width = 24
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.ShowGoFishHelpPage()
ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching
This.Visible = Thisform.lReplaceMode
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] container
[BASECLASS] container
[OBJNAME] containerAdvancedReplace
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Anchor = 10
BackColor = 199,226,254
Height = 53
Left = 0
Name = "containerAdvancedReplace"
Top = 121
Visible = .F.
Width = 800
[END PROPERTIES]
[START METHODS]
PROCEDURE Init
With This.Parent.containerReplaceText
	This.Top = .Top
	This.Height = .Height
	This.Left = .Left
	This.Width = .Width
	This.Anchor = .Anchor
Endwith



ENDPROC
PROCEDURE Refresh
This.Visible = (Thisform.lReplaceMode and Thisform.nReplaceMode = 3)
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CJ0SZW28
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdBrowse
[PARENT] gofish.containerRight.Container1.containerAdvancedReplace
[START PROPERTIES]
Anchor = 0
Caption = "Select UDF"
FontBold = .F.
FontSize = 8
Height = 20
Left = 80
Name = "cmdBrowse"
Top = 4
Width = 65
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
lcFile = GetFile('PRG', '', 'Select', 0, 'Choose UDF File:')

If Empty(lcFile)
	Thisform.oSearchEngine.cReplaceUDFCode = ''
	Thisform.cReplaceUDFFilename = ''
Else
	Thisform.oSearchEngine.cReplaceUDFCode = FileToStr(lcFile)
	Thisform.cReplaceUDFFilename = lcFile
Endif

Thisform.DoReplace(.t.)
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdEdit
[PARENT] gofish.containerRight.Container1.containerAdvancedReplace
[START PROPERTIES]
Caption = "Edit UDF"
FontSize = 8
Height = 19
Left = 147
Name = "cmdEdit"
Top = 4
Width = 54
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Local lcFile

lcFile = Thisform.cReplaceUDFFilename
Modify Command (lcFile)  
ENDPROC
PROCEDURE Refresh
This.Enabled = !Empty(Thisform.cReplaceUDFFilename)
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CM0QBO7H
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdReplace
[PARENT] gofish.containerRight.Container1.containerAdvancedReplace
[START PROPERTIES]
Anchor = 0
Caption = "Replace checked"
FontSize = 8
Height = 22
Left = 205
Name = "cmdReplace"
Picture = ('images\GoFish16.bmp')
PicturePosition = 1
TabIndex = 3
Top = 28
Width = 113
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.Replace()
ENDPROC
PROCEDURE Refresh
This.Enabled = !Empty(Thisform.cReplaceUDFFilename) and ;
				!Empty(Thisform.oSearchEngine.cReplaceUDFCode) and ;
				Reccount(Thisform.cSearchResultsAlias) > 0


ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3930S0YAF
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.containerAdvancedReplace
[START PROPERTIES]
Anchor = 10
ControlSource = "Thisform.cReplaceUDFFilename"
Enabled = .F.
Height = 23
Left = 205
Name = "Text1"
Top = 4
Width = 590
[END PROPERTIES]
[START METHODS]
PROCEDURE MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord

This.ToolTipText = This.Value

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DM1DC43Z
[CLASS] container
[BASECLASS] container
[OBJNAME] containerReplaceLine
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Anchor = 10
BackColor = 199,226,254
Height = 53
Left = 0
Name = "containerReplaceLine"
Top = 174
Visible = .F.
Width = 800
[END PROPERTIES]
[START METHODS]
PROCEDURE Init
With This.Parent.containerReplaceText
	This.Top = .Top
	This.Height = .Height
	This.Left = .Left
	This.Width = .Width
	This.Anchor = .Anchor
Endwith



ENDPROC
PROCEDURE Refresh
This.Visible = (Thisform.lReplaceMode and Thisform.nReplaceMode = 2)
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DM1DC446
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdSaveLine
[PARENT] gofish.containerRight.Container1.containerReplaceLine
[START PROPERTIES]
Anchor = 0
Caption = "Replace line"
FontSize = 8
Height = 22
Left = 205
Name = "cmdSaveLine"
Picture = ('images\GoFish16.bmp')
PicturePosition = 1
Top = 28
Width = 113
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Thisform.ReplaceLine()
ENDPROC
PROCEDURE Refresh
Local lcCursor, llReplaced, lnRiskLevel

lcCursor = Thisform.cSearchResultsAlias
lnRiskLevel = &lcCursor..ReplaceRisk
llReplaced = &lcCursor..Replaced

This.Enabled = Reccount(Thisform.cSearchResultsAlias) > 0 and (lnRiskLevel <= Thisform.nReplaceRisk) and !llReplaced 
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DM1DC444
[CLASS] editbox
[BASECLASS] editbox
[OBJNAME] editReplaceLine
[PARENT] gofish.containerRight.Container1.containerReplaceLine
[START PROPERTIES]
Anchor = 10
ControlSource = "Thisform.cReplaceLine"
Height = 23
Left = 205
Name = "editReplaceLine"
TabIndex = 2
Top = 3
Width = 590
ZOrderSet = 5
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
Local lcCursor, llReplaced, lnRiskLevel

lcCursor = Thisform.cSearchResultsAlias
lnRiskLevel = &lcCursor..ReplaceRisk
llReplaced = &lcCursor..Replaced

This.Enabled = !Eof(lcCursor) and (lnRiskLevel <= Thisform.nReplaceRisk) and !llReplaced   
ENDPROC
PROCEDURE Valid
Local lcCursor, llReplaced, lnRiskLevel

*!*	Replace ReplaceLine with This.Value in (Thisform.cSearchResultsAlias)
*!*	Replace TrimmedReplaceLine with Thisform.oSearchEngine.TrimWhiteSpace(This.value)	in (Thisform.cSearchResultsAlias)



ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DM1DC445
[CLASS] label
[BASECLASS] label
[OBJNAME] lblReplaceLine
[PARENT] gofish.containerRight.Container1.containerReplaceLine
[START PROPERTIES]
Alignment = 0
AutoSize = .T.
BackStyle = 0
Caption = "Edit Current Line"
FontBold = .F.
FontName = "Tahoma"
FontSize = 8
ForeColor = 0,0,0
Height = 15
Left = 116
Name = "lblReplaceLine"
TabIndex = 7
Top = 8
Width = 82
ZOrderSet = 7
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _0AT01N151
[CLASS] container
[BASECLASS] container
[OBJNAME] containerReplaceText
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Anchor = 10
BackColor = 199,226,254
BorderWidth = 1
Height = 53
Left = 0
Name = "containerReplaceText"
Top = 29
Width = 800
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Visible = (Thisform.lReplaceMode and Thisform.nReplaceMode = 1)

*!*	llEnableControls = (Reccount(Thisform.cSearchResultsAlias) > 0)

*!*	This.SetAll('Enabled', llEnableControls)

*!*	This.cmdHelp.Enabled = .t.
*!*	This.cmdReplaceHistory.Enabled = .t.

*!*	lnColor = Rgb(128,128,128)

*!*	Do Case
*!*		Case Thisform.nReplaceRisk = 1 
*!*			lnColor = Rgb(0,176,80)&& Green

*!*		Case Thisform.nReplaceRisk = 2
*!*			lnColor = Rgb(255,255,128) && Yellow

*!*		Case Thisform.nReplaceRisk = 3
*!*			lnColor = Rgb(255,192,0)&& Orange
*!*	Endcase

*!*	This.BackColor = lnColor


ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdReplace
[PARENT] gofish.containerRight.Container1.containerReplaceText
[START PROPERTIES]
Anchor = 0
Caption = "Replace checked"
FontSize = 8
Height = 22
Left = 205
Name = "cmdReplace"
Picture = ('images\GoFish16.bmp')
PicturePosition = 1
TabIndex = 3
Top = 28
Width = 113
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
ThisForm.Replace()
ENDPROC
PROCEDURE Refresh
This.Enabled = Reccount(Thisform.cSearchResultsAlias) > 0
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BA
[CLASS] editbox
[BASECLASS] editbox
[OBJNAME] editReplaceExpression
[PARENT] gofish.containerRight.Container1.containerReplaceText
[START PROPERTIES]
Anchor = 10
ControlSource = "Thisform.oSearchEngine.oSearchOptions.cReplaceExpression"
Height = 23
Left = 205
Name = "editReplaceExpression"
TabIndex = 2
Top = 3
Width = 590
ZOrderSet = 5
[END PROPERTIES]
[START METHODS]
PROCEDURE GotFocus
This.SelStart = 0
This.SelLength = Len(This.Value)
this.Tag = this.value
ENDPROC
PROCEDURE LostFocus
If this.Value <> this.Tag
	Thisform.DoReplace(.t.) && .t. means do a "Preview" Replace
Endif

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BD
[CLASS] label
[BASECLASS] label
[OBJNAME] Label1
[PARENT] gofish.containerRight.Container1.containerReplaceText
[START PROPERTIES]
Alignment = 0
AutoSize = .T.
BackStyle = 0
Caption = "Replacement Text"
FontBold = .F.
FontName = "Tahoma"
FontSize = 8
ForeColor = 0,0,0
Height = 15
Left = 111
Name = "Label1"
TabIndex = 7
Top = 7
Width = 89
ZOrderSet = 7
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] grid
[BASECLASS] grid
[OBJNAME] GridFiles
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Anchor = 15
Column1.ColumnOrder = 3
Column1.ControlSource = ""
Column1.FontName = "Arial"
Column1.FontSize = 8
Column1.Movable = .F.
Column1.Name = "Column17"
Column1.ReadOnly = .F.
Column1.Visible = .T.
Column1.Width = 49
Column10.FontName = "Arial"
Column10.FontSize = 8
Column10.Name = "Column10"
Column10.ReadOnly = .F.
Column10.Visible = .T.
Column10.Width = 50
Column11.ColumnOrder = 13
Column11.FontName = "Arial"
Column11.FontSize = 8
Column11.Name = "Column11"
Column11.ReadOnly = .F.
Column11.Visible = .T.
Column11.Width = 51
Column12.ColumnOrder = 12
Column12.FontName = "Arial"
Column12.FontSize = 8
Column12.Name = "Column12"
Column12.ReadOnly = .F.
Column12.Visible = .T.
Column12.Width = 50
Column13.ColumnOrder = 11
Column13.FontName = "Arial"
Column13.FontSize = 8
Column13.Name = "Column16"
Column13.ReadOnly = .F.
Column13.Visible = .T.
Column13.Width = 45
Column14.FontName = "Arial"
Column14.FontSize = 8
Column14.Name = "Column2"
Column14.Width = 54
Column15.FontName = "Arial"
Column15.FontSize = 8
Column15.Name = "Column13"
Column15.Width = 51
Column16.FontName = "Arial"
Column16.FontSize = 8
Column16.Name = "Column14"
Column16.Width = 41
Column17.FontName = "Arial"
Column17.FontSize = 8
Column17.Name = "Column15"
Column17.Width = 45
Column18.FontName = "Arial"
Column18.FontSize = 8
Column18.Name = "Column1"
Column18.Width = 49
Column19.FontName = "Arial"
Column19.FontSize = 8
Column19.Name = "Column5"
Column2.ColumnOrder = 4
Column2.FontName = "Arial"
Column2.FontSize = 8
Column2.Movable = .F.
Column2.Name = "Column3"
Column2.ReadOnly = .F.
Column2.Visible = .T.
Column2.Width = 46
Column20.ColumnOrder = 20
Column20.CurrentControl = "Text1"
Column20.FontName = "Arial"
Column20.FontSize = 8
Column20.Name = "Column19"
Column20.Sparse = .F.
Column21.FontName = "Arial"
Column21.FontSize = 8
Column21.Name = "Column20"
Column22.FontName = "Arial"
Column22.FontSize = 8
Column22.Name = "Column21"
Column23.FontName = "Arial"
Column23.FontSize = 8
Column23.Name = "Column22"
Column24.FontName = "Arial"
Column24.FontSize = 8
Column24.Name = "Column23"
Column25.FontName = "Arial"
Column25.FontSize = 8
Column25.Name = "Column25"
Column3.ColumnOrder = 5
Column3.FontName = "Arial"
Column3.FontSize = 8
Column3.Movable = .F.
Column3.Name = "Column4"
Column3.ReadOnly = .F.
Column3.Visible = .T.
Column3.Width = 44
Column4.ColumnOrder = 2
Column4.FontName = "Arial"
Column4.FontSize = 8
Column4.Movable = .F.
Column4.Name = "Column18"
Column4.ReadOnly = .F.
Column4.Visible = .T.
Column4.Width = 52
Column5.Alignment = 2
Column5.ColumnOrder = 1
Column5.CurrentControl = "Check1"
Column5.FontName = "Arial"
Column5.FontSize = 8
Column5.Name = "colProcess"
Column5.ReadOnly = .F.
Column5.Sparse = .F.
Column5.Visible = .T.
Column5.Width = 49
Column6.ColumnOrder = 6
Column6.FontName = "Arial"
Column6.FontSize = 8
Column6.Name = "Column7"
Column6.ReadOnly = .F.
Column6.Visible = .T.
Column6.Width = 55
Column7.ColumnOrder = 7
Column7.FontName = "Arial"
Column7.FontSize = 8
Column7.Name = "Column8"
Column7.ReadOnly = .F.
Column7.Visible = .T.
Column7.Width = 57
Column8.FontName = "Arial"
Column8.FontSize = 8
Column8.Name = "Column6"
Column8.ReadOnly = .F.
Column8.Visible = .T.
Column8.Width = 58
Column9.FontName = "Arial"
Column9.FontSize = 8
Column9.Name = "Column9"
Column9.ReadOnly = .F.
Column9.Visible = .T.
Column9.Width = 49
ColumnCount = 25
DeleteMark = .F.
DragMode = 0
FontName = "Arial"
FontSize = 8
GridLineColor = 192,192,192
Height = 276
HighlightForeColor = 0,0,0
HighlightStyle = 2
Left = 1
Name = "GridFiles"
Panel = 1
RecordMark = .F.
RowHeight = 17
TabIndex = 36
Tag = ""
Top = 81
Width = 798
[END PROPERTIES]
[START METHODS]
PROCEDURE AfterRowColChange
Lparameters nColIndex

ThisForm.ShowCodeForCurrentRow()


 
ENDPROC
PROCEDURE Init
Local lcFormatGridPrg, lcPRG, lcPRGColor, lcResultsCursor, lcSCX, lcSCXColor, lcVCX, lcVCXColor

Thisform.oGrid = This

lcResultsCursor = Thisform.cSearchResultsAlias

lcFormatGridPrg = 'GoFish_FormatGrid.PRG'
If File (lcFormatGridPrg) && Call user file to assign colors, if present, otherwise use default
      Do &lcFormatGridPrg with This, lcResultsCursor
Else

	lcSCX = 'Upper(' + lcResultsCursor + '.filetype) = "SCX"'
	lcSCXColor = 'RGB(0,0,128)'

	lcVCX = 'Upper(' + lcResultsCursor + '.filetype) = "VCX"'
	lcVCXColor = 'RGB(0,128,0)'

	lcPRG = 'Upper(' + lcResultsCursor + '.filetype) $ "PRG TXT H INI XML HTM HTML ASP ASPX"'
	lcPRGColor = 'RGB(255,0,0)'

	This.SetAll('DynamicForeColor', 'Iif(' + lcSCX + ', ' + lcSCXColor + ', ' +  ;
			'Iif(' + lcVCX + ', ' + lcVCXColor + ', ' + ;
			'Iif(' + lcPRG + ',' + lcPRGColor + ', RGB(0,0,0))' + ;
			')' + ;
			')', 'COLUMN')

Endif

This.ReadOnly = .F.
This.SetAll('Width', 80, 'Column')
This.SetAll('ReadOnly', .T., 'Column')
This.colProcess.ReadOnly = .F.

This.SetAll('Movable', .t., 'Column') 
ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.colProcess
[START PROPERTIES]
Alignment = 2
Caption = "Process"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _0AT01N151
[CLASS] checkbox
[BASECLASS] checkbox
[OBJNAME] Check1
[PARENT] gofish.containerRight.Container1.GridFiles.colProcess
[START PROPERTIES]
Alignment = 2
Caption = ""
Centered = .T.
FontSize = 8
Height = 17
Left = 25
Name = "Check1"
ReadOnly = .F.
Top = 101
Visible = .T.
Width = 60
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Local lcCursor, llValue

DoDefault()

llProcess = Evaluate(Thisform.cSearchResultsAlias + '.process')
lnId = Evaluate(Thisform.cSearchResultsAlias + '.id')

*-- Update GFSE cursor for same Id
Replace process with llProcess in (Thisform.oSearchEngine.cSearchResultsAlias) for id = lnId

If Thisform.nReplaceMode = 3 and (Empty(Thisform.cReplaceUDFFilename) or Empty(Thisform.oSearchEngine.cReplaceUdfCode))
	Return
Endif

Thisform.oSearchEngine.oSearchOptions.lPreviewReplace = .T.
Thisform.oSearchEngine.ReplaceFromCurrentRow(Thisform.cSearchResultsAlias)

Thisform.ShowCodeForCurrentRow(.T.)

*This.Parent.Parent.AfterRowColChange()


ENDPROC
PROCEDURE When
Local lcCursor

lcCursor = thisform.cSearchResultsAlias

Return !(Evaluate(lcCursor + '.replaced')) 
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] image
[BASECLASS] image
[OBJNAME] imageCheck
[PARENT] gofish.containerRight.Container1.GridFiles.colProcess
[START PROPERTIES]
Height = 16
Left = 23
Name = "imageCheck"
Picture = ..\images\check.bmp
Top = 89
Width = 50
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] label
[BASECLASS] label
[OBJNAME] Label1
[PARENT] gofish.containerRight.Container1.GridFiles.colProcess
[START PROPERTIES]
Caption = ""
Height = 17
Left = 22
Name = "Label1"
Top = 68
Width = 40
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.colProcess
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BT
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column1
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BU
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column1
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3940IQK04
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column10
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39A11F1FC
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column10
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column11
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BG
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column11
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BH
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column12
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BI
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column12
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BN
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column13
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BO
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column13
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BP
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column14
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BQ
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column14
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BR
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column15
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BS
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column15
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BJ
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column16
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BK
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column16
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3960Z2FOS
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column17
[START PROPERTIES]
Alignment = 2
BackColor = 128,128,128
Caption = "Header1"
FontName = "Arial"
FontSize = 8
ForeColor = 255,255,255
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3970KUB7P
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column17
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontName = "Arial"
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
SelectedBackColor = 255,255,0
SelectedForeColor = 0,0,0
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39819UYBB
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column18
[START PROPERTIES]
Alignment = 2
BackColor = 128,128,128
Caption = "Header1"
FontSize = 8
ForeColor = 255,255,255
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39819UYBC
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column18
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontName = "Arial"
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
SelectedBackColor = 255,255,0
SelectedForeColor = 0,0,0
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BX
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column19
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BY
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column19
[START PROPERTIES]
Alignment = 3
BackColor = 255,255,255
BorderStyle = 0
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BL
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column2
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BM
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column2
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BZ
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column20
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C0
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column20
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C1
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column21
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C2
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column21
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C3
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column22
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C4
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column22
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C5
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column23
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C6
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column23
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C7
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column25
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2C8
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column25
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _0AT01N151
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column3
[START PROPERTIES]
Alignment = 2
BackColor = 128,128,128
Caption = "Header1"
FontName = "Arial"
FontSize = 8
ForeColor = 255,255,255
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39819UYB8
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column3
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontName = "Arial"
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
SelectedBackColor = 255,255,0
SelectedForeColor = 0,0,0
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39819UYB9
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column4
[START PROPERTIES]
Alignment = 2
BackColor = 128,128,128
Caption = "Header1"
FontSize = 8
ForeColor = 255,255,255
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39819UYBA
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column4
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
SelectedBackColor = 255,255,0
SelectedForeColor = 0,0,0
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BV
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column5
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BW
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column5
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BB
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column6
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BC
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column6
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3880U32GV
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column7
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2B8
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column7
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2B9
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column8
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BA
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column8
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BD
[CLASS] header
[BASECLASS] header
[OBJNAME] Header1
[PARENT] gofish.containerRight.Container1.GridFiles.Column9
[START PROPERTIES]
Caption = "Header1"
FontSize = 8
Name = "Header1"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BE
[CLASS] textbox
[BASECLASS] textbox
[OBJNAME] Text1
[PARENT] gofish.containerRight.Container1.GridFiles.Column9
[START PROPERTIES]
BackColor = 255,255,255
BorderStyle = 0
FontSize = 8
ForeColor = 0,0,0
Margin = 0
Name = "Text1"
ReadOnly = .F.
Visible = .T.
[END PROPERTIES]
[START METHODS]
PROCEDURE DblClick
Thisform.EditFile()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] label
[BASECLASS] label
[OBJNAME] lblResults
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
Alignment = 1
Anchor = 10
BackStyle = 0
Caption = "0 Instances found"
FontName = "Tahoma"
FontSize = 8
ForeColor = 128,128,128
Height = 16
Left = 609
Name = "lblResults"
TabIndex = 24
Top = 7
Width = 182
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh

Local laFileCount[1], laRecordCount[1], lcCursor, lcFilter, lcMessage, llFiltered, lnRecords
Local lnSeconds, loSearchEngine

loSearchEngine = Thisform.oSearchEngine

lcCursor = Thisform.cSearchResultsAlias
lcFilter = Filter(lcCursor)
lnSeconds = thisform.oSearchEngine.nSearchTime
lcMessage = ''

If Empty(lcFilter)
	lcFilter = '1=1'
EndIf

lnRecords = Reccount(lcCursor)

Select Count(*) from (Select filename distinct from &lcCursor where &lcFilter order by 1) temp into array laFileCount
Select Count(*) from (Select matchline from &lcCursor where &lcFilter) temp into array laRecordCount

llFiltered = !Empty(Filter(lcCursor))

Do Case
	*-- If we have a filter, but it results in no results being displayed...
	Case !Thisform.lInit
		lcMessage = ''
		
	Case Thisform.oSearchEngine.nMatchLines = 0 and Thisform.oSearchEngine.lEscPress = .t.
		lcMessage = 'No Results'

	Case Thisform.lSearching = .t.
		lcMessage = 'Searching...'

	Case Thisform.oSearchEngine.nMatchLines > 0 and !Empty(Thisform.cFilter) and Eof(Thisform.cSearchResultsAlias) 
		lcMessage = 'No matches on specified filter.'
		
	Case Thisform.oSearchEngine.nMatchLines = 0
		lcMessage = 'No matches found.'

	Otherwise 
		lcMessage = Iif(llFiltered, 'Filtered to ', '') + ; 
								Alltrim(Str(laRecordCount)) + ;
								Iif(Empty(thisform.oSearchEngine.oSearchOptions.cSearchExpression), ' matches ', ' match lines') + ;
								' in ' + Alltrim(Str(laFileCount)) + ' File(s)'
Endcase

Thisform.cResultsMessage = lcMessage

This.Caption = lcMessage


ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DM1F16J4
[CLASS] optiongroup
[BASECLASS] optiongroup
[OBJNAME] optiongroupReplaceMode
[PARENT] gofish.containerRight.Container1
[START PROPERTIES]
AutoSize = .T.
ButtonCount = 3
ControlSource = "Thisform.nReplaceMode"
Height = 27
Left = 120
Name = "optiongroupReplaceMode"
Option1.AutoSize = .F.
Option1.Caption = "\<Replace Text"
Option1.FontSize = 8
Option1.Height = 17
Option1.Left = 5
Option1.Name = "optionReplaceText"
Option1.Style = 0
Option1.Top = 5
Option1.Value = 0
Option1.Width = 83
Option2.AutoSize = .F.
Option2.Caption = "Edit L\<ine"
Option2.FontSize = 8
Option2.Height = 17
Option2.Left = 92
Option2.Name = "optionReplaceLine"
Option2.Style = 0
Option2.Top = 5
Option2.Width = 67
Option3.AutoSize = .F.
Option3.Caption = "Ad\<vanced Replace"
Option3.FontSize = 8
Option3.Height = 17
Option3.Left = 158
Option3.Name = "optionAdvancedReplace"
Option3.Style = 0
Option3.Top = 5
Option3.Width = 120
Top = 1
Value = 0
Width = 283
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Visible = (Thisform.nReplaceRisk > 0) And ;
				Thisform.oSearchEngine.oSearchOptions.lEnableReplaceMode = .T. ;
				And Thisform.lReplaceMode = .T.

If Thisform.oSearchEngine.oSearchOptions.lEnableReplaceMode = .F.
	Thisform.lReplaceMode = .F.
Endif




ENDPROC
PROCEDURE optionAdvancedReplace.Click
This.Parent.Parent.containerAdvancedReplace.cmdBrowse.SetFocus()
ENDPROC
PROCEDURE optionReplaceLine.Click
This.Parent.Parent.containerReplaceLine.editReplaceLine.SetFocus()
ENDPROC
PROCEDURE optionReplaceText.Click
This.Parent.Parent.containerReplaceText.editReplaceExpression.SetFocus()
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BB
[CLASS] container
[BASECLASS] container
[OBJNAME] Container2
[PARENT] gofish.containerRight
[START PROPERTIES]
Anchor = 15
Height = 169
Left = 1
Name = "Container2"
TabIndex = 6
Top = 367
Width = 798
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BD
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] cmdEdit
[PARENT] gofish.containerRight.Container2
[START PROPERTIES]
Caption = "\<Edit"
Height = 19
Left = 26
Name = "cmdEdit"
Top = 3
Width = 39
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Thisform.EditFile()
ENDPROC
PROCEDURE Refresh
Local lcFile

This.Enabled = Reccount(Thisform.cSearchResultsAlias) > 0

lcFile = Alltrim(Evaluate(Thisform.cSearchResultsAlias + '.filepath'))
This.visible = !Empty(lcFile)
 
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2BC
[CLASS] gf_webcontrol
[CLASSLOC] ..\lib\gofishwebtools.vcx
[BASECLASS] container
[OBJNAME] containerWebControl
[PARENT] gofish.containerRight.Container2
[START PROPERTIES]
Anchor = 15
BorderWidth = 0
Height = 195
Left = 0
Name = "containerWebControl"
Top = 1
Width = 799
cmdZoomIn.Caption = ""
cmdZoomIn.Left = 714
cmdZoomIn.Name = "cmdZoomIn"
cmdZoomIn.Picture = ..\images\gf_large_letter.bmp
cmdZoomIn.SpecialEffect = 2
cmdZoomIn.ToolTipText = "Zoom in on HTML Code View"
cmdZoomIn.Top = 1
cmdZoomOut.Caption = ""
cmdZoomOut.Left = 739
cmdZoomOut.Name = "cmdZoomOut"
cmdZoomOut.Picture = ..\images\gf_small_letter.bmp
cmdZoomOut.SpecialEffect = 2
cmdZoomOut.ToolTipText = "Zoom out from HTML Code View"
cmdZoomOut.Top = 1
obrowser.Height = 144
obrowser.Left = 1
obrowser.Name = "obrowser"
obrowser.Top = 23
obrowser.Width = 794
[END PROPERTIES]
[START METHODS]
PROCEDURE Init
Thisform.oWebControl = This

DoDefault()
ENDPROC
PROCEDURE cmdZoomIn.Refresh
This.Enabled = Reccount(Thisform.cSearchResultsAlias) > 0
ENDPROC
PROCEDURE cmdZoomOut.Refresh
This.Enabled = Reccount(Thisform.cSearchResultsAlias) > 0
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3AV0W80TY
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] Command1
[PARENT] gofish.containerRight.Container2.containerWebControl
[START PROPERTIES]
Caption = ""
Height = 20
Left = 1
Name = "Command1"
Picture = ..\images\browsefolder.bmp
SpecialEffect = 2
ToolTipText = "Open Explorer window to this path."
Top = 1
Width = 22
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
Local lcPath, lcFile

lcFile = Alltrim(Evaluate(Thisform.cSearchResultsAlias + '.filepath'))

If Empty(lcFile)
	Return
Endif

lcCommand = 'Explorer /select,' + lcFile

Run /N  &lcCommand


ENDPROC
PROCEDURE Refresh
Local lcFile

lcFile = Alltrim(Evaluate(Thisform.cSearchResultsAlias + '.filepath'))

This.visible = !Empty(lcFile)

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DH1CX348
[CLASS] commandbutton
[BASECLASS] commandbutton
[OBJNAME] Command2
[PARENT] gofish.containerRight.Container2.containerWebControl
[START PROPERTIES]
Anchor = 8
Caption = ""
Height = 20
Left = 768
Name = "Command2"
Picture = ..\images\gf_dnarrow.bmp
SpecialEffect = 2
Top = 1
Width = 25
[END PROPERTIES]
[START METHODS]
PROCEDURE Click
loSplitter = This.Parent.Parent.Parent.splitter1

If This.Parent.Height > 55
	Thisform.nSplitterPosRatio = loSplitter.Top / Thisform.Height
	loSplitter.MoveSplitterToPosition(Thisform.Height-30)
Else
	lnRestorePos = Int(Evl(Thisform.nSplitterPosRatio, .50) * Thisform.Height)
	loSplitter.MoveSplitterToPosition(lnRestorePos)
Endif

This.Refresh()

Thisform.editSearch.SetFocus()




ENDPROC
PROCEDURE Refresh
If This.Parent.Height > 55
	This.picture = 'images\gf_DnArrow.bmp'
	This.ToolTipText = 'Collapse code view'
Else
	This.picture = 'images\gf_UpArrow.bmp'
	This.ToolTipText = 'Expand code view'
Endif

ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39S0QVJQX
[CLASS] label
[BASECLASS] label
[OBJNAME] lblFilePath
[PARENT] gofish.containerRight.Container2.containerWebControl
[START PROPERTIES]
Anchor = 11
BackStyle = 0
Caption = "Filename and path here..."
FontName = "Tahoma"
FontSize = 9
ForeColor = 128,128,128
Height = 16
Left = 72
Name = "lblFilePath"
TabIndex = 24
Top = 3
Width = 634
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
Local lcFilePath, lcTimeStamp, ltTimeStamp

lcFilePath = Alltrim(Evaluate(Thisform.cSearchResultsAlias + '.filepath'))

ltTimeStamp = Evaluate(Thisform.cSearchResultsAlias + '.timestamp')

lcTimeStamp = Iif(!Empty(ltTimeStamp), Ttoc(ltTimeStamp), '')

This.Caption =  lcFilePath + Space(5) + lcTimeStamp    
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2CM
[CLASS] sfsplitterv
[CLASSLOC] ..\lib\sfsplitter.vcx
[BASECLASS] control
[OBJNAME] Splitter1
[PARENT] gofish.containerRight
[START PROPERTIES]
Anchor = 10
BackColor = 210,210,210
Height = 10
Left = 0
Name = "Splitter1"
TabIndex = 14
Top = 357
Width = 800
cobject1name = Container1
cobject2name = Container2
gripper.GripperDot1.Name = "GripperDot1"
gripper.GripperDot1.ShapeDark.Name = "ShapeDark"
gripper.GripperDot1.ShapeLight.Name = "ShapeLight"
gripper.GripperDot1.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot2.Name = "GripperDot2"
gripper.GripperDot2.ShapeDark.Name = "ShapeDark"
gripper.GripperDot2.ShapeLight.Name = "ShapeLight"
gripper.GripperDot2.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot3.Name = "GripperDot3"
gripper.GripperDot3.ShapeDark.Name = "ShapeDark"
gripper.GripperDot3.ShapeLight.Name = "ShapeLight"
gripper.GripperDot3.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot4.Name = "GripperDot4"
gripper.GripperDot4.ShapeDark.Name = "ShapeDark"
gripper.GripperDot4.ShapeLight.Name = "ShapeLight"
gripper.GripperDot4.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot5.Name = "GripperDot5"
gripper.GripperDot5.ShapeDark.Name = "ShapeDark"
gripper.GripperDot5.ShapeLight.Name = "ShapeLight"
gripper.GripperDot5.ShapeMiddle.Name = "ShapeMiddle"
gripper.Name = "gripper"
nobject2minsize = 25
[END PROPERTIES]
[START METHODS]
PROCEDURE movesplittertoposition
lparameters tnPosition

DoDefault(tnPosition)

If This.Parent.container2.Height < 55	
	Thisform.ShowHtmlCodeView()
Endif

Thisform.Refresh() 
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3930S0YAF
[CLASS] editbox
[BASECLASS] editbox
[OBJNAME] editSearch
[PARENT] gofish
[START PROPERTIES]
Anchor = 10
ControlSource = "Thisform.oSearchEngine.oSearchOptions.cSearchExpression"
Height = 26
Left = 47
Name = "editSearch"
SelectOnEntry = .T.
TabIndex = 2
Top = 3
Width = 396
[END PROPERTIES]
[START METHODS]
PROCEDURE GotFocus
This.Tag = Upper(This.Value)

This.SelStart = 0
This.SelLength = Len(This.Value)
ENDPROC
PROCEDURE InteractiveChange
Local lcFillerChar, lcIllegalCharacters, lcValue

lcValue = This.value
lcFillerChar = Chr(8)

For x = 1 to 31
	If !lcIllegalCharacters 
		lcIllegalCharacters = Chr(x) $ lcValue
	Endif
	
	lcValue = Strtran(lcValue, Chr(x), lcFillerChar) 
EndFor

If lcIllegalCharacters
	MessageBox('The search expression contains invalid characters, which will be replaced with "' + lcFillerChar + '"' + ;
				Chr(13) + Chr(13) +;
				'You must correct the search expression before searching will work correctly.', 16, 'GoFish notice:')
Endif

This.value = lcValue
this.Parent.comboSearchExpressionHistory.Value = lcValue
  
ENDPROC
PROCEDURE KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl

lcControlSource = This.ControlSource

Store this.value to &lcControlSource

If nKeyCode = 13
	Thisform.Search()
EndIf

If nKeyCode = 160 && '{ALT+DNARROW}'
	Thisform.comboSearchExpressionHistoryDropDownArrow.SetFocus()
Endif

ENDPROC
PROCEDURE LostFocus
Return


*!*	If Upper(This.Value) <> This.Tag
*!*		Thisform.nCurrentId = 0
*!*		Thisform.oTree.Nodes.Clear()
*!*		Thisform.ClearSearchResultsCursor()
*!*		lcFilter = Thisform.cFilter
*!*		Set Filter To &lcFilter in (thisform.cSearchResultsAlias) && Need to remove any filter that the Treeview has applied	
*!*		Thisform.ShowHtml('&nbsp')	
*!*		Thisform.Refresh()
*!*	EndIf


ENDPROC
PROCEDURE MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord

This.ToolTipText = This.value
ENDPROC
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching && and !Thisform.lReplaceMode
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3D00JW9MF
[CLASS] gf_versionlabel
[CLASSLOC] ..\lib\gofishui.vcx
[BASECLASS] label
[OBJNAME] Gf_versionlabel1
[PARENT] gofish
[START PROPERTIES]
Left = 762
Name = "Gf_versionlabel1"
TabIndex = 13
Top = 0
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DU0SVVDF
[CLASS] image
[BASECLASS] image
[OBJNAME] imgScopeIcon
[PARENT] gofish
[START PROPERTIES]
Height = 16
Left = 49
Name = "imgScopeIcon"
Top = 36
Width = 16
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3CM018VMU
[CLASS] label
[BASECLASS] label
[OBJNAME] lblScope
[PARENT] gofish
[START PROPERTIES]
BackColor = 0,128,0
BackStyle = 0
Caption = "Scope:"
FontBold = .F.
FontItalic = .F.
FontName = "Tahoma"
FontSize = 8
ForeColor = 0,0,0
Height = 13
Left = 10
Name = "lblScope"
TabIndex = 18
Top = 35
Width = 67
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] label
[BASECLASS] label
[OBJNAME] lblSearch
[PARENT] gofish
[START PROPERTIES]
BackColor = 0,128,0
BackStyle = 0
Caption = "\<Search:"
FontBold = .F.
FontItalic = .F.
FontName = "Tahoma"
FontSize = 8
ForeColor = 0,0,0
Height = 13
Left = 9
Name = "lblSearch"
TabIndex = 1
Top = 9
Width = 67
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
This.Enabled = !Thisform.lSearching
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37I1CP1E1
[CLASS] label
[BASECLASS] label
[OBJNAME] lblSearchTime
[PARENT] gofish
[START PROPERTIES]
Alignment = 1
Anchor = 8
BackStyle = 0
Caption = "Search time displayed here"
FontName = "Tahoma"
FontSize = 8
ForeColor = 128,128,128
Height = 16
Left = 744
Name = "lblSearchTime"
TabIndex = 21
Top = 41
Width = 247
[END PROPERTIES]
[START METHODS]
PROCEDURE Refresh
Local lcFiles, lcMatchLines, lnSeconds

lnSeconds = Thisform.oSearchEngine.nSearchTime
lcMatchLines = Transform(Thisform.oSearchEngine.nMatchLines)
lcFiles = Transform(Thisform.oSearchEngine.nFileCount)

If Thisform.lInit and !thisform.lSearching
	Thisform.cSearchResultsMessage =  lcMatchLines + ' match lines in ' + lcFiles + ' file(s) in ' + Alltrim(Transform(lnSeconds, '99999.9')) + ' seconds'
Else
 Thisform.cSearchResultsMessage = ''
Endif

This.Caption = Thisform.cSearchResultsMessage 


ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _39B1BH22S
[CLASS] gf_progressbar
[CLASSLOC] ..\lib\gofishui.vcx
[BASECLASS] container
[OBJNAME] ProgressBar
[PARENT] gofish
[START PROPERTIES]
Box.Name = "Box"
Image1.Name = "Image1"
Label1.Name = "Label1"
Label2.Name = "Label2"
Left = 235
Name = "ProgressBar"
TabIndex = 23
Top = 294
bar.Image1.Name = "Image1"
bar.Name = "bar"
[END PROPERTIES]
[START METHODS]
PROCEDURE Init
This.Visible = .f.

ENDPROC
PROCEDURE start
Lparameters tnMaxValue

This.Left = Thisform.splitter2.Left + 20
This.Top = Thisform.oGrid.Top + 85

DoDefault(tnMaxValue)
ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _37M17S2CN
[CLASS] sfsplitterh
[CLASSLOC] ..\lib\sfsplitter.vcx
[BASECLASS] control
[OBJNAME] splitter2
[PARENT] gofish
[START PROPERTIES]
Anchor = 5
BackColor = 210,210,210
Height = 537
Left = 189
Name = "splitter2"
TabIndex = 22
Top = 58
Width = 10
cobject1name = containerLeft
cobject2name = containerRight
gripper.GripperDot1.Name = "GripperDot1"
gripper.GripperDot1.ShapeDark.Name = "ShapeDark"
gripper.GripperDot1.ShapeLight.Name = "ShapeLight"
gripper.GripperDot1.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot2.Name = "GripperDot2"
gripper.GripperDot2.ShapeDark.Name = "ShapeDark"
gripper.GripperDot2.ShapeLight.Name = "ShapeLight"
gripper.GripperDot2.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot3.Name = "GripperDot3"
gripper.GripperDot3.ShapeDark.Name = "ShapeDark"
gripper.GripperDot3.ShapeLight.Name = "ShapeLight"
gripper.GripperDot3.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot4.Name = "GripperDot4"
gripper.GripperDot4.ShapeDark.Name = "ShapeDark"
gripper.GripperDot4.ShapeLight.Name = "ShapeLight"
gripper.GripperDot4.ShapeMiddle.Name = "ShapeMiddle"
gripper.GripperDot5.Name = "GripperDot5"
gripper.GripperDot5.ShapeDark.Name = "ShapeDark"
gripper.GripperDot5.ShapeLight.Name = "ShapeLight"
gripper.GripperDot5.ShapeMiddle.Name = "ShapeMiddle"
gripper.Name = "gripper"
[END PROPERTIES]

[ RECORD]
[PLATFORM] WINDOWS 
[UNIQUEID] _3DH1CGI51
[CLASS] timer
[BASECLASS] timer
[OBJNAME] timerShowAdvancedForm
[PARENT] gofish
[START PROPERTIES]
Height = 25
Left = 24
Name = "timerShowAdvancedForm"
Top = 564
Width = 25
[END PROPERTIES]
[START METHODS]
PROCEDURE Timer
If thisform.lInit = .t.
	This.Interval = 0
	Thisform.ShowAdvancedForm()
Endif



ENDPROC
[END METHODS]

[ RECORD]
[PLATFORM] COMMENT 
[UNIQUEID] RESERVED  
[START PROPERTIES]
Arial, 0, 11, 7, 17, 14, 40, 3, 0
Arial, 0, 8, 5, 14, 11, 29, 3, 0
Arial, 0, 9, 5, 15, 12, 32, 3, 0
Arial, 1, 12, 8, 20, 15, 42, 4, 1
Tahoma, 0, 8, 5, 13, 11, 23, 2, 0
Tahoma, 0, 9, 5, 14, 12, 25, 2, 0
[END PROPERTIES]
[EOF]