forked from fdbozzo/foxbin2prg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fb2p_diff.sc2
1482 lines (1225 loc) · 43.6 KB
/
fb2p_diff.sc2
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
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (ES) AUTOGENERADO - ¡¡ATENCIÓN!! - ¡¡NO PENSADO PARA EJECUTAR!! USAR SOLAMENTE PARA INTEGRAR CAMBIOS Y ALMACENAR CON HERRAMIENTAS SCM!!
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.19" SourceFile="fb2p_diff.scx" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS dataenvironment AS dataenvironment
*< CLASSDATA: Baseclass="dataenvironment" Timestamp="" Scale="" Uniqueid="" ClassIcon="1" />
DataSource = .NULL.
Height = 0
Left = 0
Name = "Dataenvironment"
Top = 0
Width = 0
ENDDEFINE
DEFINE CLASS frmdiff AS form
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="pgfDiff" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.lbl_File1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.lbl_File2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.txtFile1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.txtFile2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.cmdFile1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.cmdFile2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.txtDiffToolName" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.lbl_DiffTool" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.cmdDiff" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.shpFile1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.shpFile2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagFilesDiff.chkShowCall" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.lbl_DiffTool" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.txtDiffToolConfig" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.cboDiffToolName" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.Label1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.cmgEditPanel" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.cmdResetAll" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.cmdSave" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.cmdCancel" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.cmdSetDefault" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.txtDiffToolPath" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.Label2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="pgfDiff.pagDiffToolConfig.cmdDiffToolPath" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="chkAlwaysOnTop" UniqueID="" Timestamp="" />
*<DefinedPropArrayMethod>
*m: cancel && Specifies if a CommandButton is the Cancel button.
*m: checkfilenames_dt
*m: create_default_cfg
*m: deletetool
*m: difftoolchanged
*m: difftoolcombo_refresh
*m: edittool
*m: filesdiff
*m: initialize
*m: load_cfg_data
*m: newtool
*m: resetalltools
*m: savetool
*m: save_cfg_data
*m: updateglobalenabled
*p: colorgreen
*p: coloryellow
*p: c_cfg_data && Contenido del archivo de configuración
*p: c_cfg_file && Ruta del archivo de configuración
*p: c_curdir && Ruta actual de la llamada
*p: c_fb2p_diff_fullpath && Ruta de este form
*p: difftoolconfig && Configuration for the Diff tool
*p: difftoolname && Name of the Diff tool
*p: difftoolpath
*p: filename1
*p: filename1_dt
*p: filename2
*p: filename2_dt
*p: lastfilename1
*p: lastfilename2
*p: l_editmode
*p: l_showcallonly && Show Diff Call Only, but don't Diff. (For testing)
*p: n_editoption
*p: n_selectedtoolindex
*p: n_toolcount
*p: ofb2p
*a: a_tools[1,3]
*p: _memberdata && XML Metadata for customizable properties
*</DefinedPropArrayMethod>
AllowOutput = .F.
AlwaysOnTop = .T.
AutoCenter = .T.
BackColor = 255,255,255
Caption = "Diff VFP 9 binary files (scx,vcx,mnx,pjx,frx,lbx,dbc,dbf)"
colorgreen = (RGB(35,245,24))
coloryellow = (RGB(239,245,165))
c_cfg_data = && Contenido del archivo de configuración
c_cfg_file = && Ruta del archivo de configuración
c_curdir = && Ruta actual de la llamada
c_fb2p_diff_fullpath = && Ruta de este form
difftoolconfig = && Configuration for the Diff tool
difftoolname = && Name of the Diff tool
difftoolpath =
DoCreate = .T.
filename1 =
filename1_dt = {}
filename2 =
filename2_dt = {}
Height = 191
Icon = fb2p_diff.ico
lastfilename1 =
lastfilename2 =
l_editmode = .F.
l_showcallonly = .F. && Show Diff Call Only, but don't Diff. (For testing)
MaxButton = .F.
Name = "frmDiff"
n_editoption = 0
n_selectedtoolindex = 0
n_toolcount = 0
ofb2p = .NULL.
ShowTips = .T.
ShowWindow = 2
Width = 760
_memberdata = <VFPData>
<memberdata name="updateglobalenabled" display="updateGlobalEnabled"/>
<memberdata name="filesdiff" display="filesDiff"/>
<memberdata name="l_editmode" display="l_EditMode"/>
<memberdata name="difftoolconfig" display="diffToolConfig"/>
<memberdata name="newtool" display="newTool"/>
<memberdata name="edittool" display="editTool"/>
<memberdata name="n_editoption" display="n_EditOption"/>
<memberdata name="deletetool" display="deleteTool"/>
<memberdata name="savetool" display="saveTool"/>
<memberdata name="resetalltools" display="resetAllTools"/>
<memberdata name="n_toolcount" display="n_ToolCount"/>
<memberdata name="n_selectedtoolindex" display="n_SelectedToolIndex"/>
<memberdata name="difftoolchanged" display="diffToolChanged"/>
<memberdata name="c_cfg_file" display="c_CFG_File"/>
<memberdata name="c_cfg_data" display="c_CFG_Data"/>
<memberdata name="load_cfg_data" display="load_CFG_Data"/>
<memberdata name="save_cfg_data" display="save_CFG_Data"/>
<memberdata name="ofb2p" display="oFB2P"/>
<memberdata name="create_default_cfg" display="create_Default_CFG"/>
<memberdata name="difftoolcombo_refresh" display="diffToolCombo_Refresh"/>
<memberdata name="checkfilenames_dt" display="checkFilenames_dt"/>
<memberdata name="lastfilename1" display="lastFilename1"/>
<memberdata name="lastfilename2" display="lastFilename2"/>
<memberdata name="colorgreen" display="colorGreen"/>
<memberdata name="coloryellow" display="colorYellow"/>
<memberdata name="difftoolname" display="diffToolName"/>
<memberdata name="difftoolpath" display="diffToolPath"/>
<memberdata name="a_tools" display="a_Tools"/>
<memberdata name="l_showcallonly" display="l_ShowCallOnly"/>
<memberdata name="c_curdir" display="c_CurDir"/>
<memberdata name="c_fb2p_diff_fullpath" display="c_fb2p_diff_FullPath"/>
</VFPData> && XML Metadata for customizable properties
ADD OBJECT 'chkAlwaysOnTop' AS checkbox WITH ;
Alignment = 0, ;
Anchor = 8, ;
BackStyle = 0, ;
Caption = "Always on top", ;
ControlSource = "thisform.alwaysontop", ;
Height = 17, ;
Left = 652, ;
Name = "chkAlwaysOnTop", ;
TabIndex = 2, ;
Top = 8, ;
Value = .F., ;
Width = 96
*< END OBJECT: BaseClass="checkbox" />
ADD OBJECT 'pgfDiff' AS pageframe WITH ;
Anchor = 15, ;
ErasePage = .T., ;
Height = 180, ;
Left = 8, ;
Name = "pgfDiff", ;
PageCount = 2, ;
TabIndex = 1, ;
TabStyle = 1, ;
Top = 4, ;
Width = 744, ;
Page1.Caption = "Files Diff", ;
Page1.Name = "pagFilesDiff", ;
Page2.Caption = "Diff tool configure", ;
Page2.Name = "pagDiffToolConfig"
*< END OBJECT: BaseClass="pageframe" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.cboDiffToolName' AS combobox WITH ;
Anchor = 10, ;
BorderColor = 0,128,192, ;
Height = 24, ;
Left = 63, ;
Name = "cboDiffToolName", ;
SelectOnEntry = .T., ;
SpecialEffect = 1, ;
Style = 2, ;
TabIndex = 1, ;
Top = 12, ;
Width = 572
*< END OBJECT: BaseClass="combobox" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.cmdCancel' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "Cancel", ;
Height = 27, ;
Left = 639, ;
Name = "cmdCancel", ;
TabIndex = 8, ;
Top = 116, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.cmdDiffToolPath' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "...", ;
Height = 27, ;
Left = 695, ;
Name = "cmdDiffToolPath", ;
TabIndex = 3, ;
Top = 42, ;
Width = 28
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.cmdResetAll' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "Reset All", ;
Height = 27, ;
Left = 399, ;
Name = "cmdResetAll", ;
TabIndex = 6, ;
Top = 116, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.cmdSave' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "Save", ;
Height = 27, ;
Left = 551, ;
Name = "cmdSave", ;
TabIndex = 7, ;
Top = 116, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.cmdSetDefault' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "Set Default", ;
Height = 27, ;
Left = 639, ;
Name = "cmdSetDefault", ;
TabIndex = 9, ;
Top = 10, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.cmgEditPanel' AS commandgroup WITH ;
Anchor = 2, ;
BackStyle = 0, ;
BorderStyle = 0, ;
ButtonCount = 3, ;
ControlSource = "THISFORM.n_EditOption", ;
Height = 36, ;
Left = 63, ;
Name = "cmgEditPanel", ;
SpecialEffect = 1, ;
TabIndex = 5, ;
Top = 112, ;
Value = 1, ;
Width = 268, ;
Command1.Caption = "New tool", ;
Command1.Height = 27, ;
Command1.Left = 4, ;
Command1.Name = "cmdNew", ;
Command1.Top = 4, ;
Command1.Width = 84, ;
Command2.Caption = "Edit tool", ;
Command2.Height = 27, ;
Command2.Left = 92, ;
Command2.Name = "cmdEdit", ;
Command2.Top = 4, ;
Command2.Width = 84, ;
Command3.Caption = "Delete tool", ;
Command3.Height = 27, ;
Command3.Left = 180, ;
Command3.Name = "cmdDelete", ;
Command3.Top = 4, ;
Command3.Width = 84
*< END OBJECT: BaseClass="commandgroup" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.Label1' AS label WITH ;
BackStyle = 0, ;
Caption = "Config", ;
Height = 17, ;
Left = 15, ;
Name = "Label1", ;
TabIndex = 11, ;
Top = 80, ;
Width = 48
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.Label2' AS label WITH ;
BackStyle = 0, ;
Caption = "Path", ;
Height = 17, ;
Left = 15, ;
Name = "Label2", ;
TabIndex = 12, ;
Top = 48, ;
Width = 48
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.lbl_DiffTool' AS label WITH ;
BackStyle = 0, ;
Caption = "Diff tool", ;
Height = 17, ;
Left = 15, ;
Name = "lbl_DiffTool", ;
TabIndex = 10, ;
Top = 16, ;
Width = 48
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.txtDiffToolConfig' AS textbox WITH ;
Anchor = 10, ;
BorderColor = 0,128,192, ;
Enabled = .F., ;
Format = "T", ;
Height = 23, ;
Left = 63, ;
MaxLength = 255, ;
Name = "txtDiffToolConfig", ;
SelectOnEntry = .T., ;
SpecialEffect = 1, ;
TabIndex = 4, ;
ToolTipText = "Keywords: <<Filename1>>, <<Filename2>>", ;
Top = 76, ;
Width = 660
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'pgfDiff.pagDiffToolConfig.txtDiffToolPath' AS textbox WITH ;
Anchor = 10, ;
BorderColor = 0,128,192, ;
Enabled = .F., ;
Format = "T", ;
Height = 23, ;
Left = 63, ;
MaxLength = 255, ;
Name = "txtDiffToolPath", ;
SelectOnEntry = .T., ;
SpecialEffect = 1, ;
TabIndex = 2, ;
ToolTipText = "Keywords: <<FoxBin2PrgDir>>, <<ProgramFiles>>", ;
Top = 44, ;
Width = 628
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'pgfDiff.pagFilesDiff.chkShowCall' AS checkbox WITH ;
Alignment = 0, ;
Anchor = 8, ;
BackStyle = 0, ;
Caption = "Only show Diff call (for testing)", ;
ControlSource = "THISFORM.l_ShowCallOnly", ;
Height = 17, ;
Left = 443, ;
Name = "chkShowCall", ;
TabIndex = 2, ;
Top = 116, ;
Value = .F., ;
Width = 192
*< END OBJECT: BaseClass="checkbox" />
ADD OBJECT 'pgfDiff.pagFilesDiff.cmdDiff' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "Diff", ;
Height = 60, ;
Left = 643, ;
Name = "cmdDiff", ;
TabIndex = 6, ;
Top = 80, ;
Width = 84
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagFilesDiff.cmdFile1' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "...", ;
Height = 27, ;
Left = 667, ;
Name = "cmdFile1", ;
TabIndex = 2, ;
Top = 10, ;
Width = 28
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagFilesDiff.cmdFile2' AS commandbutton WITH ;
Anchor = 8, ;
Caption = "...", ;
Height = 27, ;
Left = 667, ;
Name = "cmdFile2", ;
TabIndex = 4, ;
Top = 42, ;
Width = 28
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'pgfDiff.pagFilesDiff.lbl_DiffTool' AS label WITH ;
BackStyle = 0, ;
Caption = "Diff tool", ;
Height = 17, ;
Left = 11, ;
Name = "lbl_DiffTool", ;
TabIndex = 9, ;
Top = 88, ;
Width = 48
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'pgfDiff.pagFilesDiff.lbl_File1' AS label WITH ;
BackStyle = 0, ;
Caption = "File 1", ;
Height = 17, ;
Left = 11, ;
Name = "lbl_File1", ;
TabIndex = 7, ;
Top = 16, ;
Width = 36
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'pgfDiff.pagFilesDiff.lbl_File2' AS label WITH ;
BackStyle = 0, ;
Caption = "File 2", ;
Height = 17, ;
Left = 11, ;
Name = "lbl_File2", ;
TabIndex = 8, ;
Top = 48, ;
Width = 36
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'pgfDiff.pagFilesDiff.shpFile1' AS shape WITH ;
Anchor = 8, ;
BorderStyle = 0, ;
Curvature = 10, ;
Height = 23, ;
Left = 699, ;
Name = "shpFile1", ;
SpecialEffect = 1, ;
ToolTipText = "TXTStatus: Green=Unchanged, Yellow=Changed", ;
Top = 12, ;
Width = 24
*< END OBJECT: BaseClass="shape" />
ADD OBJECT 'pgfDiff.pagFilesDiff.shpFile2' AS shape WITH ;
Anchor = 8, ;
BorderStyle = 0, ;
Curvature = 10, ;
Height = 23, ;
Left = 699, ;
Name = "shpFile2", ;
SpecialEffect = 1, ;
ToolTipText = "TXTStatus: Green=Unchanged, Yellow=Changed", ;
Top = 44, ;
Width = 24
*< END OBJECT: BaseClass="shape" />
ADD OBJECT 'pgfDiff.pagFilesDiff.txtDiffToolName' AS textbox WITH ;
Anchor = 10, ;
BorderColor = 232,232,232, ;
ControlSource = "THISFORM.diffToolName", ;
Enabled = .F., ;
Format = "T", ;
Height = 23, ;
Left = 63, ;
MaxLength = 255, ;
Name = "txtDiffToolName", ;
SelectOnEntry = .T., ;
SpecialEffect = 1, ;
TabIndex = 5, ;
Top = 84, ;
Width = 564
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'pgfDiff.pagFilesDiff.txtFile1' AS textbox WITH ;
Anchor = 10, ;
BorderColor = 0,128,192, ;
ControlSource = "THISFORM.filename1", ;
Format = "T", ;
Height = 23, ;
Left = 63, ;
MaxLength = 255, ;
Name = "txtFile1", ;
OLEDropMode = 1, ;
SelectOnEntry = .T., ;
SpecialEffect = 1, ;
TabIndex = 1, ;
Top = 12, ;
Width = 600
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'pgfDiff.pagFilesDiff.txtFile2' AS textbox WITH ;
Anchor = 10, ;
BorderColor = 0,128,192, ;
ControlSource = "THISFORM.filename2", ;
Format = "T", ;
Height = 23, ;
Left = 63, ;
MaxLength = 255, ;
Name = "txtFile2", ;
OLEDropMode = 1, ;
SelectOnEntry = .T., ;
SpecialEffect = 1, ;
TabIndex = 3, ;
Top = 44, ;
Width = 600
*< END OBJECT: BaseClass="textbox" />
PROCEDURE Activate
*-- activate
THISFORM.updateGlobalEnabled()
ENDPROC
PROCEDURE cancel && Specifies if a CommandButton is the Cancel button.
*-- cancel
THISFORM.l_EditMode = .F.
THISFORM.updateGlobalEnabled()
WITH THISFORM.pgfDiff.pagDiffToolConfig.cboDiffToolName
.Style = 2 && Dropdown List
.RowSourceType= 5
.RowSource = 'THISFORM.a_Tools'
.ControlSource = 'THISFORM.diffToolName'
.Value = THISFORM.diffToolName
THISFORM.pgfDiff.pagDiffToolConfig.txtDiffToolConfig.Value = THISFORM.diffToolConfig
THISFORM.pgfDiff.pagDiffToolConfig.txtDiffToolPath.Value = THISFORM.diffToolPath
.SetFocus()
ENDWITH
ENDPROC
PROCEDURE checkfilenames_dt
LPARAMETERS tnFilename
LOCAL laFile1(1,5), laFile2(1,5), ltFilename1_dt, ltFilename2_dt, lnCodError, lcMessage, lnIcon ;
, lcFilename1, lcFilename2, lcExt, lcExt2, lcDir, lcFilename1_dt, lcFilename2_dt ;
, loFB2P as c_foxbin2prg OF foxbin2prg.prg
#DEFINE CR_LF CHR(13)+CHR(10)
TRY
lnCodError = 0
STORE '' TO lcMessage, lcFilename1, lcFilename2, lcExt, lcExt2, lcDir
loFB2P = THIS.oFB2P
tnFilename = EVL(tnFilename, 0)
DO CASE
CASE INLIST(tnFilename, 0, 1) AND EMPTY(THIS.filename1)
EXIT
CASE INLIST(tnFilename, 0, 2) AND EMPTY(THIS.filename2)
EXIT
ENDCASE
IF INLIST(tnFilename, 0, 1) THEN
lcExt = JUSTEXT(THIS.filename1)
lcDir = JUSTPATH(THIS.filename1)
lcExt2 = loFB2P.get_Ext2FromExt( lcExt, lcDir )
lcFilename1 = FORCEEXT( THIS.filename1, lcExt2 )
IF ADIR(laFile1, lcFilename1) = 1 THEN
lcFilename1_dt = '{^' + TRANSFORM( DTOS( laFile1(1,3) ), '@R ####/##/##' ) + ' ' + laFile1(1,4) + '}'
ltFilename1_dt = EVALUATE( lcFilename1_dt )
DO CASE
CASE EMPTY(THIS.filename1_dt)
THIS.filename1_dt = ltFilename1_dt
THIS.pgfDiff.pagFilesDiff.shpFile1.BackColor= THIS.colorGreen
THIS.lastFilename1 = THIS.filename1
CASE NOT THIS.filename1 == THIS.lastFilename1
THIS.filename1_dt = ltFilename1_dt
THIS.pgfDiff.pagFilesDiff.shpFile1.BackColor= THIS.colorGreen
THIS.lastFilename1 = THIS.filename1
CASE THIS.filename1_dt <> ltFilename1_dt
THIS.pgfDiff.pagFilesDiff.shpFile1.BackColor= THIS.colorYellow
OTHERWISE
THIS.pgfDiff.pagFilesDiff.shpFile1.BackColor= THIS.colorGreen
ENDCASE
ENDIF
ENDIF
IF INLIST(tnFilename, 0, 2) THEN
lcExt = JUSTEXT(THIS.filename2)
lcDir = JUSTPATH(THIS.filename2)
lcExt2 = loFB2P.get_Ext2FromExt( lcExt, lcDir )
lcFilename2 = FORCEEXT( THIS.filename2, lcExt2 )
IF ADIR(laFile2, lcFilename2) = 1 THEN
lcFilename2_dt = '{^' + TRANSFORM( DTOS( laFile2(1,3) ), '@R ####/##/##' ) + ' ' + laFile2(1,4) + '}'
ltFilename2_dt = EVALUATE( lcFilename2_dt )
DO CASE
CASE EMPTY(THIS.filename2_dt)
THIS.filename2_dt = ltFilename2_dt
THIS.pgfDiff.pagFilesDiff.shpFile2.BackColor= THIS.colorGreen
THIS.lastFilename2 = THIS.filename2
CASE NOT THIS.filename2 == THIS.lastFilename2
THIS.filename2_dt = ltFilename2_dt
THIS.pgfDiff.pagFilesDiff.shpFile2.BackColor= THIS.colorGreen
THIS.lastFilename2 = THIS.filename2
CASE THIS.filename2_dt <> ltFilename2_dt
THIS.pgfDiff.pagFilesDiff.shpFile2.BackColor= THIS.colorYellow
OTHERWISE
THIS.pgfDiff.pagFilesDiff.shpFile2.BackColor= THIS.colorGreen
ENDCASE
ENDIF
ENDIF
CATCH TO loEx
lnCodError = loEx.ErrorNo
lnIcon = 16
*IF NOT EMPTY(loEx.UserValue)
loEx.UserValue = CR_LF ;
+ 'lcDir = ' + TRANSFORM(lcDir) + CR_LF ;
+ 'lcExt = ' + TRANSFORM(lcExt) + CR_LF ;
+ 'lcExt2 = ' + TRANSFORM(lcExt2) + CR_LF ;
+ 'tnFilename = ' + TRANSFORM(tnFilename) + CR_LF ;
+ 'filename1 = "' + THIS.filename1 + '"' + CR_LF ;
+ 'lcFilename1 = "' + lcFilename1 + '"' + CR_LF ;
+ 'lcFilename1_dt = ' + TRANSFORM(lcFilename1_dt) + CR_LF ;
+ 'laFile1(1,3) = ' + TRANSFORM(laFile1(1,3)) + CR_LF ;
+ 'laFile1(1,4) = ' + TRANSFORM(laFile1(1,4)) + CR_LF ;
+ 'filename2 = "' + THIS.filename2 + '"' + CR_LF ;
+ 'lcFilename2 = "' + lcFilename2 + '"' + CR_LF ;
+ 'lcFilename2_dt = ' + TRANSFORM(lcFilename2_dt) + CR_LF ;
+ 'laFile2(1,3) = ' + TRANSFORM(laFile2(1,3)) + CR_LF ;
+ 'laFile2(1,4) = ' + TRANSFORM(laFile2(1,4)) + CR_LF
*ENDIF
TEXT TO lcMessage TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2+4
Error <<loEx.ErrorNo>>, <<loEx.Message>>
Procedure <<loEx.Procedure>>, Line <<loEx.LineNo>>
LineContents: <<loEx.LineContents>>
Details: <<loEx.Details>>
UserValue: <<loEx.UserValue>>
ENDTEXT
FINALLY
IF lnCodError > 0 THEN
MESSAGEBOX( lcMessage, 0+lnIcon, 'FoxBin2Prg checkFilenames_dt' )
ENDIF
ENDTRY
#UNDEF CR_LF
ENDPROC
PROCEDURE create_default_cfg
*-- create_Default_CFG
LOCAL lcPath
lcPath = EVL( JUSTPATH(THISFORM.c_CFG_File), JUSTPATH(SYS(16)) )
IF LEFT(lcPath,10) == 'PROCEDURE ' THEN
lcPath = SUBSTR( lcPath, AT(' ', lcPath, 2) + 1 )
ENDIF
*-- Configuración de Herramientas DIFF predefinidas
THIS.n_ToolCount = 1
DIMENSION THIS.a_Tools( THIS.n_ToolCount, 3 )
THIS.a_Tools( THIS.n_ToolCount, 1 ) = 'WinMergePortable'
THIS.a_Tools( THIS.n_ToolCount, 2 ) = '/e /x /u /maximize <<filename1>> <<filename2>>'
THIS.a_Tools( THIS.n_ToolCount, 3 ) = '<<FoxBin2PrgDir>>WinMergePortable\WinMergePortable.exe'
THIS.n_ToolCount = 2
DIMENSION THIS.a_Tools( THIS.n_ToolCount, 3 )
THIS.a_Tools( THIS.n_ToolCount, 1 ) = 'Beyond Compare 2'
THIS.a_Tools( THIS.n_ToolCount, 2 ) = '<<filename1>> <<filename2>>'
THIS.a_Tools( THIS.n_ToolCount, 3 ) = '<<ProgramFiles>>Beyond Compare 2\BC2.exe'
*--
THIS.diffToolName = THIS.a_Tools( 1, 1 )
THIS.diffToolConfig = THIS.a_Tools( 1, 2 )
THIS.diffToolPath = THIS.a_Tools( 1, 3 )
THIS.save_CFG_Data()
THIS.diffToolCombo_Refresh()
THIS.diffToolChanged()
THIS.Refresh()
ENDPROC
PROCEDURE deletetool
*-- deleteTool
LOCAL locboDiffToolName as ComboBox, loTxtDiffToolCfg as TextBox, loTxtDiffToolPath as TextBox, lnListIndex
locboDiffToolName = THIS.pgfDiff.pagDiffToolConfig.cboDiffToolName
loTxtDiffToolCfg = THIS.pgfDiff.pagDiffToolConfig.txtDiffToolConfig
loTxtDiffToolPath = THIS.pgfDiff.pagDiffToolConfig.txtDiffToolPath
IF MESSAGEBOX( '¿Confirm Delete?',4+32+256+4096, 'FoxBin2Prg: Delete tool config' ) = 6 THEN
IF THIS.n_ToolCount > 0 THEN
lnListIndex = locboDiffToolName.ListIndex
THIS.n_ToolCount = THIS.n_ToolCount - 1
IF THIS.n_ToolCount > 0 THEN
ADEL(THIS.a_Tools, lnListIndex)
DIMENSION THIS.a_Tools( THIS.n_ToolCount, 3 )
ELSE
THIS.a_Tools = ''
ENDIF
IF THIS.n_ToolCount > 0 THEN
IF lnListIndex > THIS.n_ToolCount THEN
lnListIndex = THIS.n_ToolCount
ENDIF
locboDiffToolName.ListIndex = lnListIndex
THIS.diffToolConfig = THIS.a_Tools(lnListIndex,2)
THIS.diffToolPath = THIS.a_Tools(lnListIndex,3)
loTxtDiffToolCfg.Value = THIS.diffToolConfig
loTxtDiffToolPath.Value = THIS.diffToolPath
ELSE
locboDiffToolName.ListIndex = 0
THIS.diffToolName = ''
THIS.diffToolPath = ''
THIS.diffToolConfig = ''
loTxtDiffToolCfg.Value = ''
loTxtDiffToolPath.Value = ''
ENDIF
locboDiffToolName.RowSource = locboDiffToolName.RowSource
locboDiffToolName.Refresh()
THIS.save_CFG_Data()
THIS.updateGlobalEnabled()
ENDIF
ENDIF
ENDPROC
PROCEDURE Destroy
*-- destroy
THIS.oFB2P = NULL
IF _VFP.StartMode = 0 THEN
lcFB2P_App = 'foxbin2prg.prg'
ELSE
lcFB2P_App = 'foxbin2prg.exe'
ENDIF
DO CASE
CASE ATC( lcFB2P_App, SET("Procedure") ) > 0
RELEASE PROCEDURE (lcFB2P_App)
CASE ATC( FORCEEXT(lcFB2P_App, 'FXP'), SET("Procedure") ) > 0
RELEASE PROCEDURE (FORCEEXT(lcFB2P_App, 'FXP'))
ENDCASE
ENDPROC
PROCEDURE difftoolchanged
*-- diffToolChanged
WITH THISFORM.pgfDiff.pagDiffToolConfig.cboDiffToolName
IF .ListCount > 0 THEN
THISFORM.diffToolConfig = THISFORM.a_Tools(.ListIndex,2)
THISFORM.diffToolPath = THISFORM.a_Tools(.ListIndex,3)
THISFORM.n_SelectedToolIndex = .ListIndex
.Parent.txtDiffToolConfig.Value = THISFORM.diffToolConfig
.Parent.txtDiffToolPath.Value = THISFORM.diffToolPath
ENDIF
ENDWITH
ENDPROC
PROCEDURE difftoolcombo_refresh
WITH THIS.pgfDiff.pagDiffToolConfig.cboDiffToolName
IF THIS.l_EditMode THEN
.Clear()
.ControlSource = ''
.RowSourceType = 1 && Value
.RowSource = ''
.Style = 0 && Dropdown Combo
.AddItem(THIS.diffToolName)
.Value = THIS.diffToolName
.SelectOnEntry = .T.
ELSE
.Style = 2 && Dropdown List
.RowSourceType = 5 && Array
.RowSource = 'THISFORM.a_Tools'
.ControlSource = 'THISFORM.diffToolName'
.Value = THIS.diffToolName
IF .ListIndex > THIS.n_ToolCount THEN
.ListIndex = THIS.n_ToolCount
ENDIF
THIS.n_SelectedToolIndex = .ListIndex
ENDIF
ENDWITH
ENDPROC
PROCEDURE edittool
*-- editTool
THISFORM.l_EditMode = .T.
THISFORM.updateGlobalEnabled()
WITH THISFORM.pgfDiff.pagDiffToolConfig.cboDiffToolName
THISFORM.diffToolCombo_Refresh()
.SetFocus()
ENDWITH
ENDPROC
PROCEDURE filesdiff
*-- filesDiff
LOCAL laFile(1,5), lcMessage, lnIcon, lcFilename1, lcFilename2, lcDiffToolConfig ;
, llAlwaysOnTop, lnCodError, lcDiffToolPath ;
, loShell AS WScript.Shell ;
, loEx as Exception ;
, loFB2P as c_foxbin2prg OF foxbin2prg.prg
#DEFINE CR_LF CHR(13)+CHR(10)
TRY
loFB2P = THIS.oFB2P
lnCodError = 0
WITH THISFORM as Form
llAlwaysOnTop = .AlwaysOnTop
lcFilename1 = '"' + FORCEEXT( .filename1, loFB2P.get_Ext2FromExt( JUSTEXT(.filename1), JUSTPATH(.filename1) ) ) + '"'
lcFilename2 = '"' + FORCEEXT( .filename2, loFB2P.get_Ext2FromExt( JUSTEXT(.filename2), JUSTPATH(.filename2) ) ) + '"'
lcDiffToolConfig = THIS.diffToolConfig
lcDiffToolConfig = STRTRAN( lcDiffToolConfig, '<<filename1>>', '<<lcFilename1>>', 1, 1, 1 )
lcDiffToolConfig = STRTRAN( lcDiffToolConfig, '<<filename2>>', '<<lcFilename2>>', 1, 1, 1 )
lcDiffToolConfig = TEXTMERGE(lcDiffToolConfig)
lcDiffToolPath = '"' + THISFORM.diffToolPath + '"'
lcDiffToolPath = STRTRAN( lcDiffToolPath, '<<ProgramFiles>>', '<<ADDBS(GETENV("ProgramFiles"))>>', 1, 1, 1 )
lcDiffToolPath = STRTRAN( lcDiffToolPath, '<<FoxBin2PrgDir>>', '<<ADDBS(JUSTPATH(loFB2P.c_Foxbin2prg_FullPath))>>', 1, 1, 1 )
lcDiffToolPath = TEXTMERGE(lcDiffToolPath)
IF THISFORM.l_ShowCallOnly THEN
MESSAGEBOX( lcDiffToolPath + ' ' + lcDiffToolConfig )
EXIT
ENDIF
IF ADIR(laFile, .Filename1) = 0 THEN
lcMessage = 'File not found'
ERROR lcMessage + ': [' + .Filename1 + ']'
ENDIF
IF ADIR(laFile, .Filename2) = 0 THEN
lcMessage = 'File not found'
ERROR lcMessage + ': [' + .Filename2 + ']'
ENDIF
IF ADIR(laFile, lcDiffToolPath) = 0 THEN
lcMessage = 'File not found'
ERROR lcMessage + ': [' + lcDiffToolPath + ']'
ENDIF
IF NOT loFB2P.hasSupport_Bin2Prg( .filename1 )
lcMessage = 'File type not supported'
ERROR lcMessage + ': [' + .filename1 + ']'
ENDIF
lcMessage = 'File is in use [' + .filename1 + ']'
USE (.filename1) EXCLUSIVE
USE
IF NOT loFB2P.hasSupport_Bin2Prg( .filename2 )
lcMessage = 'File type not supported'
ERROR lcMessage + ': [' + .filename1 + ']'
ENDIF
lcMessage = 'File is in use [' + .filename2 + ']'
USE (.filename2) EXCLUSIVE
USE
lcMessage = .Filename1
loFB2P.execute( .Filename1, '', '', '', '1', '0', '0', NULL, NULL, .T. )
lcMessage = .Filename2
loFB2P.execute( .Filename2, '', '', '', '1', '0', '0', NULL, NULL, .T. )
lcMessage = ''
IF llAlwaysOnTop THEN
THIS.AlwaysOnTop = .F.
ENDIF
loShell = CREATEOBJECT('WScript.Shell')
THIS.filename1_dt = {//::}
THIS.filename2_dt = {//::}
THIS.checkFilenames_dt()
lnResp = loShell.Run( lcDiffToolPath + ' ' + lcDiffToolConfig, 1, 1)
IF lnResp = 0 THEN
*-- OK
THIS.checkFilenames_dt()
ELSE
MESSAGEBOX( 'DIFF operation returned the code ' + TRANSFORM(lnResp), 0+48, 'FoxBin2Prg: Diff VFP 9 binary files' )
ENDIF
*THIS.lastFilename1 = THIS.filename1
*THIS.lastFilename2 = THIS.filename2
ENDWITH
CATCH TO loEx WHEN loEx.ErrorNo = 3
lnCodError = loEx.ErrorNo
lnIcon = 48
CATCH TO loEx WHEN loEx.ErrorNo = 1098
lnCodError = loEx.ErrorNo
lnIcon = 48
lcMessage = loEx.Message
CATCH TO loEx
lnCodError = loEx.ErrorNo
lnIcon = 16
IF NOT EMPTY(lcMessage)
loEx.UserValue = lcMessage
ENDIF
TEXT TO lcMessage TEXTMERGE NOSHOW FLAGS 1 PRETEXT 1+2+4
Error <<loEx.ErrorNo>>, <<loEx.Message>>
Procedure <<loEx.Procedure>>, Line <<loEx.LineNo>>
LineContents: <<loEx.LineContents>>
Details: <<loEx.Details>>
UserValue: <<loEx.UserValue>>
ENDTEXT
FINALLY
IF lnCodError > 0 THEN
MESSAGEBOX( lcMessage, 0+lnIcon, 'FoxBin2Prg Diff Status' )
ENDIF
THIS.AlwaysOnTop = llAlwaysOnTop
STORE NULL TO loShell, loFB2P
RELEASE loShell, loFB2P
ENDTRY
#UNDEF CR_LF
RETURN
ENDPROC
PROCEDURE Init
LOCAL lcSys16, lnPosProg
*-- init
THISFORM.MinHeight = THISFORM.Height
THISFORM.MaxHeight = THISFORM.Height
THISFORM.MinWidth = THISFORM.Width
THISFORM.a_Tools = ''
lcSys16 = SYS(16)
IF LEFT(lcSys16,10) == 'PROCEDURE '
lnPosProg = AT(" ", lcSys16, 2) + 1
ELSE
lnPosProg = 1
ENDIF
THIS.c_CurDir = SYS(5) + CURDIR() && Directorio actual, que no necesariamente es donde está FoxBin2Prg
THIS.c_fb2p_diff_FullPath = SUBSTR( lcSys16, lnPosProg )
THIS.c_CFG_File = FORCEEXT( THIS.c_fb2p_diff_FullPath, 'CFG' )
ENDPROC
PROCEDURE initialize
*-- initialize
LOCAL lcFB2P_App
IF VARTYPE(THIS.oFB2P) <> "O" OR ISNULL(THIS.oFB2P)
IF _VFP.StartMode = 0 THEN
lcFB2P_App = 'foxbin2prg.prg'
ELSE
lcFB2P_App = 'foxbin2prg.exe'
ENDIF
SET PROCEDURE TO (lcFB2P_App)
THIS.oFB2P = CREATEOBJECT('c_foxbin2prg')
ENDIF