Project

General

Profile

Statistics
| Revision:

vdfsplat / AppSrc / ObjectInspector.dg @ 67

History | View | Annotate | Download (92.4 KB)

1
Use Windows
2
Use DfError
3
Use MsgBox
4
Use DfTreeVw
5
Use DfSpnFrm
6
Use File_Dlg
7
Use Seq_Chnl
8
Use DfTimer
9
Use DfOtPanl     // TopMostMixin class
10
Use cOutputWindow.pkg // include getclassname declaration
11
Use cWorkingPanel.pkg
12
Use cProgramObjects.pkg
13
Use cImageList32.pkg
14
Use cCJGrid.pkg
15
Use cReadOnlyCheckbox.pkg
16
Use Windows.pkg
17

    
18
Define CS_CRLF   For (Character(13)+Character(10))
19

    
20

    
21
Struct tFieldOptions
22
  Boolean   bAutoFind
23
  Boolean   bAutofindGE
24
  Boolean   bCapsLock
25
  Boolean   bCommit
26
  Boolean   bForcePut
27
  Boolean   bNoEnter
28
  Boolean   bNoPut
29
  Boolean   bDisplayOnly
30
  Boolean   bZeroSuppress
31
  Boolean   bRequired
32
  Boolean   bFindReq
33
  Boolean   bRetain
34
  Boolean   bRetainAll
35
  Boolean   bSkipFound
36
  Boolean   bKeyField
37
End_Struct
38

    
39
Struct tForeignFieldOptions
40
  Boolean   bAllowNewSave
41
  Boolean   bReadOnly
42
  tFieldOptions ddDefault
43
  tFieldOptions ddIndex
44
  tFieldOptions ddKey
45
End_Struct
46

    
47
Struct tColumn
48
  Integer   iNr
49
  String    sName
50
  Integer   eDfType
51
  Integer   iLength
52
  Integer   iPrecision
53
  Boolean   bChanged
54
  String    sDDValue
55
  String    sRBValue
56
  Integer   iMainIndex
57
End_Struct
58

    
59
Struct tServer
60
  Handle    hoDD
61
  Integer   iFile
62
  String    sName
63
  Boolean   bNullAllowed
64
  Boolean   bNoSwitch
65
End_Struct
66

    
67
Struct tClient
68
  Handle    hoDD
69
  Integer   iFile
70
  String    sName
71
End_Struct
72

    
73
Struct tTable
74
  Integer   iNr
75
  String    sName
76
  Boolean   bChangedState
77
  Boolean   bShouldSave
78
  Boolean   bInUse
79
  Boolean   bAutoFill
80
  Boolean   bFillFromFirst
81
  Boolean   bProtectKey
82
  Boolean   bReadOnly
83
  Boolean   bCascadeDelete
84
  Boolean   bNoDelete
85
  Boolean   bNoCascadeDeleteStrict
86
  Boolean   bNoRelate
87
  Boolean   bParentChanged
88
  Boolean   bInheritConstraints
89
  Boolean   bUseDDRelates
90
  Integer   iOrdering
91
  tForeignFieldOptions Foreign
92
  tColumn[] Columns
93
  tServer[] Servers
94
  tClient[] Clients
95
End_Struct
96

    
97

    
98
Class ObjectTreeView Is A TreeView
99
  
100
   Procedure Private_VScroll
101
   End_Procedure //
102
   
103
   Procedure Private_MouseWheel
104
   End_Procedure //
105
   
106
   Function Child_Object_Name Handle hoChild Returns String
107
     String sChildName
108
     
109
     Get ShortName of oProgram hoChild To sChildName
110
     Move (sChildName+", id=("+trim(hoChild)+")") to sChildName
111
     Function_Return sChildName
112
   End_Function
113
  
114

    
115
   Procedure AddChildren Integer hoRoot Handle hRoot Integer hoTarget
116
      Integer iChildren  iChild
117
      String  sChildName
118
      Handle  hChild hoPrevChild hoChild
119
      String  sClassname
120
      Integer iImage
121
      Integer iItemData
122
      Boolean bClientArea
123

    
124
      Move -1 to hoChild
125
      If hoRoot Ne 0 Begin
126
         Get ChildCount Of oProgram hoRoot To iChildren
127

    
128
         For iChild From 1 To iChildren
129

    
130
            If (hoChild=-1) Begin
131
              Get FirstChild Of oProgram hoRoot To hoChild
132
            End
133
            Else Begin
134
              If (hoChild>0) Begin
135
                Move hoChild To hoPrevChild
136
                //Get NextChild Of oProgram hoRoot hoPrevChild To hoChild
137
                Get NextChild Of oProgram hoPrevChild To hoChild
138
                If (hoChild=hoPrevChild) Begin
139
                  Move 0 To hoChild
140
                End
141
              End // hoChild
142
            End
143
            
144
            
145
            If (hoChild > 0) Begin
146
               Get Child_Object_Name hoChild to sChildName
147
               Get xBitmapIDForObj of oProgram hoChild To iImage
148
               Get Debuggee_Client_Area_State of oProgram hoChild to bClientArea
149
               If (bClientArea) Begin
150
                 Move (tvPDSClient * 65536 + hoChild) To iItemData
151
               End
152
               Else Begin
153
                 Move (tvPDSNormal * 65536 + hoChild) To iItemData
154
               End
155
               Get AddTreeItem sChildName hRoot iItemData iImage iImage To hChild
156
               Send AddChildren hoChild hChild hoTarget
157
               If (hoChild = hoTarget) Begin
158
                 Set CurrentTreeItem To hChild
159
                 Set ItemBold hChild To True   // Object equal to Self is in Bold
160
               End
161
            End
162
         Loop
163
      End
164
   End_Procedure // AddChildren
165

    
166

    
167
   Procedure AddDesktopChildren Handle hRoot Integer hoCurrentDesktopBranch Integer hoTarget
168
      Integer iChildren hoChild iChild
169
      Integer iChildCount
170
      String sChildName
171
      Boolean bClientArea
172
      Handle hChild hoPrevChild
173

    
174
      Get ChildCount of oProgram Desktop to iChildren
175
      Move -1 to hoChild
176
      For iChild From 1 To iChildren
177

    
178
         If (hoChild=-1) Begin // **WvA
179
           Get FirstChild Of oProgram Desktop To hoChild
180
         End
181
         Else Begin
182
           If (hoChild>0) Begin
183
             Move hoChild To hoPrevChild
184
             //Get NextChild Of oProgram Desktop hoPrevChild To hoChild
185
             Get NextChild Of oProgram hoPrevChild To hoChild
186
           End
187
         End
188
         If (hoChild > 0) Begin
189
           Get Child_Object_Name hoChild to sChildName
190
           Get PropertyBooleanEval of oProgram "Client_Area_State" hoChild To bClientArea
191
           If (bClientArea) Begin
192
             Get AddTreeItem sChildName hRoot (tvPDSClient * 65536 + hoChild) bmpPDSClient bmpPDSClient to hChild
193
           End
194
           Else Begin
195
             Get AddTreeItem sChildName hRoot (tvPDSNormal * 65536 + hoChild) bmpPDSNormal bmpPDSNormal to hChild
196
           End
197
           If hoChild Eq hoCurrentDesktopBranch Begin
198
             Send AddChildren hoChild hChild hoTarget
199
             Send DoExpandItem hChild
200
           End
201
           Else Begin
202
             If (hoChild=hoTarget) Set CurrentTreeItem to hChild
203
             Get ChildCount of oProgram hoChild to iChildCount
204
             If (iChildCount>0) Set ItemChildCount hChild to 1
205
           End
206
         End
207
      Loop
208
   End_Procedure // AddDesktopChildren
209

    
210
   //****************************************************************************
211
   // $Module type: PROCEDURE
212
   // $Module name: OnItemChanged
213
   // $Author     : VOO
214
   // Created     : 23/12/96 @ 10:37
215
   //
216
   // Description
217
   //    This method will allow us to change the current target object
218
   //
219
   // $Rev History
220
   //    23/12/96  Module header created
221
   //****************************************************************************
222
   Procedure OnItemChanged Handle hItem Handle hItemOld
223
      Integer iData
224
      Handle  hoNewTarget
225

    
226
      Get ItemData hItem To iData
227
      Move (Low (iData)) To hoNewTarget
228
      Delegate Set phoTarget To hoNewTarget
229
      Delegate Send DisplayCurrentObjectDetails
230
   End_Procedure // OnItemChanged
231

    
232
   //****************************************************************************
233
   // $Module type: PROCEDURE
234
   // $Module name: OnItemExpanding
235
   // $Author     : VOO
236
   // Created     : 22/12/96 @ 16:09
237
   //
238
   // Description
239
   //    This method is used when the [+] in front of an item is clicked
240
   //
241
   // $Rev History
242
   //    22/12/96  Module header created
243
   //****************************************************************************
244
   Procedure OnItemExpanding Handle hItem
245
      Integer bExpanded iData hoChild
246
      Handle hChild
247

    
248
      Get ItemExpandedState hItem To bExpanded
249
      If (bExpanded=False) Begin
250
         Get ChildItem hItem To hChild
251
         If (hChild=0) Begin
252
            Get ItemData hItem To iData
253
            Move (Low (iData)) To hoChild
254
            Send AddChildren hoChild hItem 0
255
         End
256
      End
257
   End_Procedure // OnItemExpanding
258

    
259
   //****************************************************************************
260
   // $Module type: PROCEDURE
261
   // $Module name: Error_Report
262
   // $Author     : VOO
263
   // Created     : 23/12/96 @ 12:06
264
   //
265
   // Description
266
   //    Cancelled method.
267
   //
268
   // $Rev History
269
   //    23/12/96  Module header created
270
   //****************************************************************************
271
   Procedure Error_Report
272
   End_Procedure // Error_Report
273

    
274
   Procedure OnGetInfoTip Handle hItem String ByRef sInfoTip
275
     Boolean bBold
276
     String  sVal
277
     String  sSelected
278
  
279
     Get ItemLabel hItem to sVal
280
     Get ItemBold  hItem To bBold
281
     If (bBold) Move "<- has focus" To sSelected
282
     Else Move "" To sSelected
283
     Move ("Object with (object id):" * sVal * sSelected) to sInfoTip
284
   End_Procedure
285

    
286

    
287
   //****************************************************************************
288
   // $Module type: PROCEDURE
289
   // $Module name: OnCreateTree
290
   // $Author     : VINCENT
291
   // Created     : 18-12-96 @ 15:49
292
   //
293
   // Description
294
   //
295
   // $Rev History
296
   //    18-12-96 VINCENT Module header created
297
   //****************************************************************************
298
   Procedure OnCreateTree
299
      Handle  hRoot
300
      Handle  hoTarget
301
      Handle  hoLastChild
302
      Handle  hoOldErrorBox
303
      
304
      Move Error_Object_Id To hoOldErrorBox
305
      Move Self To Error_Object_Id
306

    
307
      Delegate Get phoTarget To hoTarget
308

    
309
      While hoTarget Gt Desktop
310
         Move hoTarget To hoLastChild
311
         Get PropertyHandleEval of oProgram "Parent" hoTarget To hoTarget
312
      End
313

    
314
      Get AddTreeItem 'Desktop' 0 (tvPDSRoot * 65536 + Desktop) bmpPDSRoot bmpPDSRoot To hRoot
315

    
316
      Delegate Get phoTarget To hoTarget
317
      Send AddDesktopChildren hRoot hoLastChild hoTarget
318

    
319
      Move hoOldErrorBox To Error_Object_Id
320

    
321
      Send DoExpandItem hRoot
322
   End_Procedure // OnCreateTree
323
                            
324
   //// **WvA
325
   //Procedure OnResize
326
   //  Integer hoPanel
327
   //  Integer hoSelf
328
   //  Integer iPy iPy1
329
   //  Integer iPx iPx1
330
   //  Integer iPxy iPxy1
331
   //
332
   //  Forward Send OnResize
333
   //  Get Main_Panel_Id To hoPanel
334
   //  Move Self To hoSelf
335
   //  If (hoSelf<>0) Begin
336
   //    Get GuiLocation   To iPxy
337
   //    Move (Hi(iPxy))   To iPy
338
   //    Move (Low(iPxy))  To iPx
339
   //
340
   //    Move (iPy+ hi(GuiSize(hoSelf))+3)  To iPy1
341
   //    If (hoPanel <> 0) Begin
342
   //
343
   //      Set GuiSize      To (Hi(Client_Size(hoPanel))-iPy-10) (Low(GUISize(hoPanel))-iPx-10)
344
   //      //Set GuiLocation  To iPy iPx
345
   //      Send Adjust_Logicals
346
   //    End
347
   //  End
348
   //End_Procedure // OnResize
349
   
350
End_Class // ObjectTreeView
351

    
352

    
353

    
354
Class cObjectInspector Is A ModalPanel//ToolPanel
355

    
356
   Procedure Construct_Object
357
     //Integer hoCurrent
358
     //Integer hoSelf
359

    
360
     Forward Send Construct_Object
361

    
362
     Set Border_Style To Border_Thick
363
     //Set Caption_Bar  To True
364
     //Set Sysmenu_Icon To True
365
     //Set Modal_State  To True
366
     Set Locate_mode  To Center_on_screen
367

    
368
     On_Key Kcancel Send Close_Panel
369

    
370
     Property Integer phoTarget Public
371
     //Property Integer pbIsResizing False
372
     Property Integer Main_Panel_Id 0
373
     
374
     Object oProgram is a cProgramObjects
375
     End_Object
376
     
377
     Set Main_Panel_Id To Self
378
   End_Procedure // Construct_Object
379

    
380

    
381
   Procedure DisplayCurrentObjectDetails
382
     Send DisplayObjectDetails To oDetailsGroup
383
   End_Procedure
384
   
385
   Function Debuggee_Focus_Object Returns Handle
386
     String  sResult
387
     Handle  hObjectID
388
     Handle  hoDebugger
389
     Boolean bOK
390
     
391
     Move 0 To hObjectID
392
     Get phoDebugger To hoDebugger
393
     If (hoDebugger) Begin
394
       Move "" To sResult
395
       Get ComEval of hoDebugger ("focus(desktop)") (&sResult) to bOK
396
       If (bOk) begin
397
         Move (sResult) To hObjectID
398
       End
399
     End
400
     Function_Return hObjectID
401
   End_Function //
402

    
403
   Procedure ActivateObjectInspectorPanel
404
      Integer hoFocus
405
      Handle  hoPopup
406

    
407
      Get Debuggee_Focus_Object To hoFocus
408
      Set phoTarget To hoFocus
409
      
410
      // Show a "working" panel if this is called from within a GUI
411
      Get Create U_cWorkingPanel To hoPopup
412
      If (hoPopup) Begin
413
        Send Show Of hoPopup "Please hold on.. "  "The program is busy enumerating all objects in the running application."
414
      End
415
      Send Cursor_Wait of Cursor_Control
416
      
417
      Send CreateObjectArray of oProgram
418
      
419
      Send Cursor_Ready of Cursor_Control
420
      If (hoPopup) begin
421
        Send Hide Of hoPopup
422
        Send Destroy of hoPopup
423
      End
424
      
425
      Send Popup_Modal
426
      Send DisplayCurrentObjectDetails
427
   End_Procedure // ActivateObjectInspectorPanel
428
   
429
   //// **WvA
430
   //Procedure OnResize
431
   //  //If BuildingObjectID Ne 0 Begin
432
   //  //  Forward Send OnResize
433
   //  If ((active_State(Self)) And (pbIsResizing(Self)=False)) Begin
434
   //    Set pbIsResizing To True
435
   //    Send OnResize Of ObjectTree
436
   //    Set pbIsResizing To False
437
   //  End
438
   //End_Procedure // OnResize
439
   
440
   
441
End_Class // cObjectInspector
442

    
443

    
444
Object oObjectInspectorPanel Is A cObjectInspector
445
  Set Size To 220 545
446
  Set Location To 28 4
447
  Set Label To "Object Inspector"
448

    
449
   Object ObjectTree Is A ObjectTreeView
450
     Set Size To 200 260
451
     Set Location To 10 3
452
     Set Label To 'Runtime application objects'
453
     Set Label_Justification_Mode To jMode_Top
454
     Set Label_Col_Offset To 1
455
     Set peAnchors To anTopBottomLeft
456

    
457

    
458
     Object oObjectTreeBitmaps is an cImageList32
459
       Set piImageHeight to 16
460
       Set piImageWidth  to 16
461
       
462
       Procedure OnCreate
463
         Integer iImg
464
 
465
         Get AddImage 'Desktop.bmp'        to iImg // Rootobject bitmap
466
         Get AddImage 'AbView.bmp'         to iImg // Clientobject bitmap
467
         Get AddImage 'AbConPal.bmp'       to iImg // Normalobject bitmap
468
                                           
469
         Get AddImage 'ttbitmap16.bmp'     to iImg // bmpPDSBitmap
470
         Get AddImage 'ttchkbox16.bmp'     to iImg // bmpPDSCheckbox
471
         Get AddImage 'ttcombo16.bmp'      to iImg // bmpPDSCombo
472
         Get AddImage 'ttcontainer16.bmp'  to iImg // bmpPDSContainer
473
         Get AddImage 'ttedit16.bmp'       to iImg // bmpPDSEdit
474
         Get AddImage 'ttf_sellst16.bmp'   to iImg // bmpPDSSellist
475
         Get AddImage 'ttform16.bmp'       to iImg // bmpPDSForm
476
         Get AddImage 'ttgrid16.bmp'       to iImg // bmpPDSGrid
477
         Get AddImage 'ttgroup16.bmp'      to iImg // bmpPDSGroup
478
         Get AddImage 'ttlist16.bmp'       to iImg // bmpPDSList
479
         Get AddImage 'ttmodalpanel16.bmp' to iImg // bmpPDSModalPanel
480
         Get AddImage 'ttradio16.bmp'      to iImg // bmpPDSRadio
481
         Get AddImage 'ttspin16.bmp'       to iImg // bmpPDSSpin
482
         Get AddImage 'tttab16.bmp'        to iImg // bmpPDSTabpage
483
         Get AddImage 'tttabdlg16.bmp'     to iImg // bmpPDSTabDialog
484
         Get AddImage 'tttextbox16.bmp'    to iImg // bmpPDSTextbox
485
         Get AddImage 'tttrack16.bmp'      to iImg // bmpPDSTrack
486
         Get AddImage 'tttreeview16.bmp'   to iImg // bmpPDSTreeview
487
         Get AddImage 'ttview16.bmp'       to iImg // bmpPDSView
488
         Get AddImage 'ttradiogroup16.bmp' to iImg // bmpPDSRadioGroup
489
         Get AddImage 'ttmenu16.bmp'       to iImg // bmpPDSMenu
490
         Get AddImage 'ttbutton16.bmp'     to iImg // bmpPDSButton
491
         Get AddImage 'ttobject16.bmp'     to iImg // bmpPDSActiveX
492
       End_Procedure
493

    
494
     End_Object // ObjectIdBitmaps
495

    
496
     Set ImageListObject    To (oObjectTreeBitmaps(Self))
497
     Set TreeRootLinesState To False
498
     Set pbEnableInfoTips   To True
499
   End_Object // ObjectTree
500

    
501
   Object oDetailsGroup Is A Group
502
     Set Label To "Details"
503
     Set Size to 204 274
504
     Set Location To 6 266
505
     Set peAnchors To anAll
506
   
507
     Function ComplexToString Integer ciValue Returns String
508
        Function_Return (String (Hi (ciValue)) - ',' - String (Low (ciValue)))
509
     End_Function // ComplexToString
510
     
511
     Function BooleanToString Boolean bValue Returns String
512
       String sValue
513
       If (bValue) Move "True" To sValue
514
       Else Move "False" To sValue
515
       Function_Return sValue
516
     End_Function
517
     
518
     Function AnchorsToString Integer eAnchors Returns String
519
       String sAnchors
520
       
521
       Move "unknown" to sAnchors
522
       Case Begin
523
         Case (eAnchors= anNone)
524
           Move "anNone" To sAnchors
525
           Case Break
526
         Case (eAnchors= anAll)
527
           Move "anAll" To sAnchors
528
           Case Break
529
         Case (eAnchors= anBottomLeft)
530
           Move "anBottomLeft" To sAnchors
531
           Case Break
532
         Case (eAnchors= anBottomLeftRight)
533
           Move "anBottomLeftRight" To sAnchors
534
           Case Break
535
         Case (eAnchors= anBottomRight)
536
           Move "anBottomRight" To sAnchors
537
           Case Break
538
         Case (eAnchors= anTopBottomLeft)
539
           Move "anTopBottomLeft" To sAnchors
540
           Case Break
541
         Case (eAnchors= anTopBottomRight)
542
           Move "anTopBottomRight" To sAnchors
543
           Case Break
544
         Case (eAnchors= anTopLeftRight)
545
           Move "anTopLeftRight" To sAnchors
546
           Case Break
547
         Case (eAnchors= anTopRight)
548
           Move "anTopRight" To sAnchors
549
           Case Break
550
         Case (eAnchors= anTopLeft)
551
           Move "anTopLeft" To sAnchors
552
           Case Break
553
       Case End
554
       Function_Return sAnchors
555
     End_Function
556
     
557
     Function BorderStyleToString Integer eStyle Returns String
558
       String sStyle
559
       
560
       Move "unknown" to sStyle
561
       Case Begin
562
         Case (eStyle=Border_None)
563
           Move "Border_None" To sStyle
564
           Case Break
565
         Case (eStyle=Border_Dialog)
566
           Move "Border_Dialog" To sStyle
567
           Case Break
568
         Case (eStyle=Border_Normal)
569
           Move "Border_Normal" To sStyle
570
           Case Break
571
         Case (eStyle=Border_Thick)
572
           Move "Border_Thick" To sStyle
573
           Case Break
574
         Case (eStyle=Border_ClientEdge)
575
           Move "Border_ClientEdge" To sStyle
576
           Case Break
577
         Case (eStyle=Border_StaticEdge)
578
           Move "Border_StaticEdge" To sStyle
579
           Case Break
580
         Case (eStyle=Border_WindowEdge)
581
           Move "Border_WindowEdge" To sStyle
582
           Case Break
583
       Case End
584
       Function_Return sStyle
585
     End_Function
586
     
587
     Function JustificationModeToString Integer eMode Returns String
588
       String sMode
589
       
590
       Move "unknown" To sMode
591
       Case Begin
592
         Case (eMode=jmode_top)
593
           Move "jmode_top" to sMode
594
           Case break
595
         Case (eMode=jmode_left)
596
           Move "jmode_left" to sMode
597
           Case break
598
         Case (eMode=jmode_right)
599
           Move "jmode_right" to sMode
600
           Case break
601
       Case End
602
       Function_Return sMode
603
     End_Function
604
  
605
      
606
     Function TableName handle hoDD Integer iMainFile Returns String
607
       Integer iRuntimeVersion
608
       Integer iPos
609
       Integer iField
610
       String  sValue
611
       String  sTableName
612
       String  sDDfileText
613
       String  sExtMess
614
       Handle  hoDebugger
615
       
616
       Get phoDebugger To hoDebugger
617
       If (hoDebugger) Begin
618
         Get piRuntimeVersion of hoDebugger To iRuntimeVersion
619
         If (iRuntimeVersion>=180) Begin
620
       
621
           Get StringEval of oProgram ("ErrorMessageTableName("+trim(hoDD)+","+trim(iMainFile)+")") To sValue
622
           Move sValue To sTableName
623
         End
624
         Else Begin
625
           // Unfortunately before DF18.0 we don't have a clean function for getting the logic_file_name
626
           // of the table, so we need to parse it out by hand.
627
           //Move (DD_FILE_TEXT* string(iFile) * "-" * sFile) to sExtMess
628
           Get StringEval of oProgram ("Current_Validate_Field("+trim(hoDD)+")") To iField
629
           If (iField=0) Begin
630
             Get StringEval of oProgram ("Extended_Error_Message("+trim(hoDD)+")") To sValue
631
             Move (Pos("\n",sValue)) To iPos
632
             If (iPos>0) Begin
633
               Move (Left(sValue,iPos-1)) To sExtMess
634
             End
635
             Else Move sValue To sExtMess
636
             Move (DD_FILE_TEXT* string(iMainFile) + " - ") To sDDfileText
637
             Move (Replace(sDDfileText,sExtMess,"")) To sTableName
638
           End
639
           Else Begin
640
             // ugh, we're in a validation can't use the above logic as it resets the current_validate_field
641
             // property, and we've got to clean means to restore that.
642
             // Let's fallback on something ugly, because without table name we're gonna get runtime errors.
643
             Get ShortName Of oProgram hoDD To sValue
644
             If (Pos("o",sValue)=1) Move (Replace("o",sValue,"")) To sValue
645
             Move (Replace("_DD",sValue,"")) To sTableName
646
           End
647
         End
648
       End
649
       Function_Return sTableName
650
     End_Function
651

    
652

    
653
     
654
     Procedure DisplayObjectDetails
655
       Handle  hoTarget
656
       Handle  hoDD
657
       Integer eWindowsClass
658
       Integer iMainFile
659
       Boolean bState
660
       Boolean bIsDD
661
       Boolean bIsDbView
662
       Boolean bIsDeo
663
       String  sValue
664
       String  sLine
665
       
666
       Move False To bIsDD
667
       Move False To bIsDbView
668
       Move False To bIsDeo
669

    
670
       Get phoTarget To hoTarget
671

    
672
       Get ShortName of oProgram hoTarget To sValue
673
       Set Value of oShortName To sValue
674
       
675
       Get xBitmapIDForObj of oProgram hoTarget To eWindowsClass
676
       Get PropertyHandleEval of oProgram "Server" hoTarget to hoDD
677
       If (hoDD=0 and eWindowsClass=bmpPDSModalPanel) Begin
678
         Get PropertyHandleEval of oProgram "Main_DD" hoTarget to hoDD
679
       End
680
       If (hoDD and eWindowsClass<>bmpPDSView and eWindowsClass<>bmpPDSContainer and eWindowsClass<>bmpPDSModalPanel and eWindowsClass<>bmpPDSClient) Begin
681
         Move True To bIsDeo
682
       End
683
       Else If (hoDD and (eWindowsClass=bmpPDSView or eWindowsClass=bmpPDSContainer or eWindowsClass=bmpPDSModalPanel or eWindowsClass=bmpPDSClient)) Begin
684
         // view/container or datadictionary
685
         Get PropertyIntegerEval Of oProgram "Main_File" hoTarget To iMainFile
686
         If (iMainFile<>0) Begin
687
           Move True To bIsDD
688
         End
689
         Else Begin
690
           Move True To bIsDbView
691
         End
692
       End
693
       
694
       If (hoTarget>Desktop) Begin
695
         Get PropertyBooleanEval of oProgram "Active_State" hoTarget To bState
696
         Set Checked_State of oActiveState To bState
697
       End
698
       
699
       If (bIsDD=false) Begin
700
         Set Visible_State of oDDGroup To False
701
         Set Visible_State of oObjectDetailsEdit to True
702
         Send DisplayObjectDetails of oObjectDetailsEdit
703

    
704
         Get ObjectWindowsClassName of oProgram hoTarget to sValue
705
         Set Value Of oWindowsClass To sValue
706
       End
707
       Else Begin
708
         Set Value Of oWindowsClass To ""
709
       End
710

    
711
       If (bIsDeo) Begin
712
         Send DisplayDeoDetails Of oObjectDetailsEdit hoDD
713
       End
714
       Else if (bIsDD) Begin
715
         Set Visible_State of oObjectDetailsEdit To False
716
         Set Visible_State of oDDGroup To True
717
         Send DisplayDataDictionaryDetails of oDDGroup iMainFile
718
       End
719
       Else if (bIsDbView) Begin
720
         Send DisplayViewDetails Of oObjectDetailsEdit
721
       End
722
       Else Begin
723
        // Not a DEO or DD or View
724
        Send DisplayNonDeoDetails of oObjectDetailsEdit
725
       End
726
         
727
     End_Procedure
728
     
729
     Object oShortName is a Form
730
        Set Location To 8 60
731
        Set Size To 13 106
732
        Set Label To "Name:"
733
        Set Label_Col_Offset to 2
734
        Set Label_Justification_Mode to jMode_Right
735
        Set Enabled_State to False
736
     End_Object
737

    
738
     Object oActiveState is a cReadOnlyCheckbox
739
        Set Location To 23 60
740
        Set Size To 10 50
741
        Set Label To "Active State"
742
     End_Object
743
     
744
     Object oWindowsClass is a Form
745
        Set Location To 38 60
746
        Set Size To 13 106
747
        Set Label To "Windows Class:"
748
        Set Label_Col_Offset to 2
749
        Set Label_Justification_Mode to jMode_Right
750
        Set Enabled_State to False
751
     End_Object
752
     
753
     Object oDDGroup is a Group
754
        Set Location To 53 3
755
        Set Size to 144 267
756
        Set Label To "DataDictionary"
757
        Set peAnchors To anAll
758
        
759
        Property Handle phoCurrentDD 0
760
        Property tTable pTable
761

    
762
        //
763
        // Returns field options
764
        //
765
        Function DDFieldOption Handle hoDD Integer iField String sOption Returns Boolean
766
          String  sValue
767
          Boolean bState
768
          
769
          Move False To bState
770
          Get StringEval of oProgram ("Field_Option("+trim(hoDD)+","+trim(iField)+","+sOption+")") To sValue
771
          If (sValue=True) Move True To bState  // string evaluates to boolean
772
          Function_Return bState
773
        End_Function
774

    
775
        //
776
        // Returns foreign field options
777
        // iField can also be:
778
        //   DD_Default, DD_IndexField, DD_KeyField as those are negative values, they do not collide
779
        //   with Fields
780
        //
781
        Function DDForeignFieldOption Handle hoDD Integer iField String sOption Returns Boolean
782
          String  sValue
783
          Boolean bState
784
          Integer iRuntimeVersion
785
          Integer iOption
786
          Integer iOptions
787
          Handle  hoDebugger
788
          
789
          Get phoDebugger To hoDebugger
790
          If (hoDebugger) Begin
791
            Get piRuntimeVersion of hoDebugger To iRuntimeVersion
792
            If (iRuntimeVersion>=141) Begin
793
              Move False To bState
794
              Get StringEval of oProgram ("Foreign_Field_Option("+trim(hoDD)+","+trim(iField)+","+sOption+")") To sValue
795
              If (sValue=True) Move True To bState  // string evaluates to boolean
796
            End
797
            Else Begin
798
              Move False To bState
799
              Get StringEval of oProgram ("Foreign_Field_Options("+trim(hoDD)+","+trim(iField)+")") To sValue
800
              Move sValue To iOptions
801
              Get FieldOptionStringToInteger sOption To iOption
802
              If (iOption<>0) Begin
803
                If ((iOptions iAnd iOption)=iOption) Begin
804
                  Move True To bState
805
                End
806
              End
807
            End
808
          End
809
          Function_Return bState
810
        End_Function
811
        
812
        // Obsolete
813
        // Returns field options as a string
814
        //
815
        Function DDFieldOptionsToString Handle hoDD Integer iField Returns String
816
          Boolean bState
817
          String  sOption
818
          String  sOptions
819
          
820
          Move "" To sOptions
821
          Move "DD_Autofind" To sOption
822
          Get DDFieldOption hoDD iField sOption To bState
823
          If (bState) Move (sOption+",") To sOptions
824
          
825
          Move "DD_Autofind_GE" To sOption
826
          Get DDFieldOption hoDD iField sOption To bState
827
          If (bState) Move (sOptions+sOption+",") To sOptions
828
          
829
          Move "DD_CapsLock" To sOption
830
          Get DDFieldOption hoDD iField sOption To bState
831
          If (bState) Move (sOptions+sOption+",") To sOptions
832
          
833
          Move "DD_Commit" To sOption
834
          Get DDFieldOption hoDD iField sOption To bState
835
          If (bState) Move (sOptions+sOption+",") To sOptions
836
          
837
          Move "DD_ForcePut" To sOption
838
          Get DDFieldOption hoDD iField sOption To bState
839
          If (bState) Move (sOptions+sOption+",") To sOptions
840
          
841
          Move "DD_NoEnter" To sOption
842
          Get DDFieldOption hoDD iField sOption To bState
843
          If (bState) Move (sOptions+sOption+",") To sOptions
844
          
845
          Move "DD_NoPut" To sOption
846
          Get DDFieldOption hoDD iField sOption To bState
847
          If (bState) Move (sOptions+sOption+",") To sOptions
848
          
849
          // is noenter+noput
850
          //Move "DD_DisplayOnly" To sOption
851
          //Get DDFieldOption hoDD iField sOption To bState
852
          //If (bState) Move (sOptions+","+sOption) To sOptions
853
          
854
          Move "DD_Zero_Suppress" To sOption
855
          Get DDFieldOption hoDD iField sOption To bState
856
          If (bState) Move (sOptions+sOption+",") To sOptions
857
          
858
          Move "DD_Required" To sOption
859
          Get DDFieldOption hoDD iField sOption To bState
860
          If (bState) Move (sOptions+sOption+",") To sOptions
861
          
862
          Move "DD_FindReq" To sOption
863
          Get DDFieldOption hoDD iField sOption To bState
864
          If (bState) Move (sOptions+sOption+",") To sOptions
865
          
866
          Move "DD_Retain" To sOption
867
          Get DDFieldOption hoDD iField sOption To bState
868
          If (bState) Move (sOptions+sOption+",") To sOptions
869
          
870
          Move "DD_RetainAll" To sOption
871
          Get DDFieldOption hoDD iField sOption To bState
872
          If (bState) Move (sOptions+","+sOption) To sOptions
873
          
874
          Move "DD_SkipFound" To sOption
875
          Get DDFieldOption hoDD iField sOption To bState
876
          If (bState) Move (sOptions+sOption+",") To sOptions
877
          
878
          If (sOptions<>"") Begin
879
            Move (Replaces("DD_",sOptions," ")) To sOptions // DD_ in the name just takes up more space, replace by space character
880
            Move (Left(sOptions,Length(sOptions)-1)) To sOptions // remove trailing comma
881
          End
882
          Function_Return sOptions
883
        End_Function
884
        
885
        Function FieldOptionStringToInteger String sOption Returns Integer
886
          Integer iOption
887
          Move 0 To iOption
888
          Case Begin
889
            Case (sOption="DD_Autofind")
890
              Move DD_Autofind To iOption
891
              Case Break
892
            Case (sOption="DD_Autofind_GE")
893
              Move DD_Autofind_GE To iOption
894
              Case Break
895
            Case (sOption="DD_CapsLock")
896
              Move DD_CapsLock To iOption
897
              Case Break
898
            Case (sOption="DD_Commit")
899
              Move DD_Commit To iOption
900
              Case Break
901
            Case (sOption="DD_ForcePut")
902
              Move DD_ForcePut To iOption
903
              Case Break
904
            Case (sOption="DD_NoEnter")
905
              Move DD_NoEnter To iOption
906
              Case Break
907
            Case (sOption="DD_NoPut")
908
              Move DD_NoPut To iOption
909
              Case Break
910
            Case (sOption="DD_DisplayOnly")
911
              Move DD_DisplayOnly To iOption
912
              Case Break
913
            Case (sOption="DD_Zero_Suppress")
914
              Move DD_Zero_Suppress To iOption
915
              Case Break
916
            Case (sOption="DD_Required")
917
              Move DD_Required To iOption
918
              Case Break
919
            Case (sOption="DD_FindReq")
920
              Move DD_FindReq To iOption
921
              Case Break
922
            Case (sOption="DD_Retain")
923
              Move DD_Retain To iOption
924
              Case Break
925
            Case (sOption="DD_RetainAll")
926
              Move DD_RetainAll to iOption
927
              Case Break
928
            Case (sOption="DD_SkipFound")
929
              Move DD_SkipFound To iOption
930
              Case Break
931
          Case End
932
          Function_Return iOption
933
        End_Function
934
        
935
        //
936
        // Returns field options into the tFieldOptions structure
937
        //
938
        Function DDFieldOptions Handle hoDD Integer iField Returns tFieldOptions
939
          Boolean bState
940
          String  sOption
941
          tFieldOptions Options
942

    
943
          Move "DD_Autofind" To sOption
944
          Get DDFieldOption hoDD iField sOption To bState
945
          If (bState) Move True To Options.bAutoFind
946
          
947
          Move "DD_Autofind_GE" To sOption
948
          Get DDFieldOption hoDD iField sOption To bState
949
          If (bState) Move True To Options.bAutoFindGE
950
          
951
          Move "DD_CapsLock" To sOption
952
          Get DDFieldOption hoDD iField sOption To bState
953
          If (bState) Move True To Options.bCapsLock
954
          
955
          Move "DD_Commit" To sOption
956
          Get DDFieldOption hoDD iField sOption To bState
957
          If (bState) Move True To Options.bCommit
958
          
959
          Move "DD_ForcePut" To sOption
960
          Get DDFieldOption hoDD iField sOption To bState
961
          If (bState) Move True To Options.bForcePut
962
          
963
          Move "DD_NoEnter" To sOption
964
          Get DDFieldOption hoDD iField sOption To bState
965
          If (bState) Move True To Options.bNoEnter
966
          
967
          Move "DD_NoPut" To sOption
968
          Get DDFieldOption hoDD iField sOption To bState
969
          If (bState) Move True To Options.bNoPut
970
          
971
          // is noenter+noput, no need to query or display again.
972
          //Move "DD_DisplayOnly" To sOption
973
          //Get DDFieldOption hoDD iField sOption To bState
974
          //If (bState) Move True to Options.bDisplayOnly
975
          
976
          Move "DD_Zero_Suppress" To sOption
977
          Get DDFieldOption hoDD iField sOption To bState
978
          If (bState) Move True To Options.bZeroSuppress
979
          
980
          Move "DD_Required" To sOption
981
          Get DDFieldOption hoDD iField sOption To bState
982
          If (bState) Move True To Options.bRequired
983
          
984
          Move "DD_FindReq" To sOption
985
          Get DDFieldOption hoDD iField sOption To bState
986
          If (bState) Move True To Options.bFindReq
987
          
988
          Move "DD_Retain" To sOption
989
          Get DDFieldOption hoDD iField sOption To bState
990
          If (bState) Move True to Options.bRetain
991
          
992
          Move "DD_RetainAll" To sOption
993
          Get DDFieldOption hoDD iField sOption To bState
994
          If (bState) Move True To Options.bRetainAll
995
          
996
          Move "DD_SkipFound" To sOption
997
          Get DDFieldOption hoDD iField sOption To bState
998
          If (bState) Move True To Options.bSkipFound
999
          
1000
          Get StringEval of oProgram ("Key_Field_State("+trim(hoDD)+","+trim(iField)+")") To bState
1001
          If (bState) Move True To Options.bKeyField
1002
          
1003
          Function_Return Options
1004
        End_Function
1005
        
1006
        //
1007
        // Returns field options into the tFieldOptions structure
1008
        //
1009
        Function DDForeignFieldOptions Handle hoDD Integer iField Returns tFieldOptions
1010
          Boolean bState
1011
          String  sOption
1012
          tFieldOptions Options
1013

    
1014
          Move "DD_Autofind" To sOption
1015
          Get DDForeignFieldOption hoDD iField sOption To bState
1016
          If (bState) Move True To Options.bAutoFind
1017
          
1018
          Move "DD_Autofind_GE" To sOption
1019
          Get DDForeignFieldOption hoDD iField sOption To bState
1020
          If (bState) Move True To Options.bAutoFindGE
1021
          
1022
          Move "DD_CapsLock" To sOption
1023
          Get DDForeignFieldOption hoDD iField sOption To bState
1024
          If (bState) Move True To Options.bCapsLock
1025
          
1026
          Move "DD_Commit" To sOption
1027
          Get DDForeignFieldOption hoDD iField sOption To bState
1028
          If (bState) Move True To Options.bCommit
1029
          
1030
          Move "DD_ForcePut" To sOption
1031
          Get DDForeignFieldOption hoDD iField sOption To bState
1032
          If (bState) Move True To Options.bForcePut
1033
          
1034
          Move "DD_NoEnter" To sOption
1035
          Get DDForeignFieldOption hoDD iField sOption To bState
1036
          If (bState) Move True To Options.bNoEnter
1037
          
1038
          Move "DD_NoPut" To sOption
1039
          Get DDForeignFieldOption hoDD iField sOption To bState
1040
          If (bState) Move True To Options.bNoPut
1041
          
1042
          // is noenter+noput, no need to query or display again.
1043
          //Move "DD_DisplayOnly" To sOption
1044
          //Get DDFieldOption hoDD iField sOption To bState
1045
          //If (bState) Move True to Options.bDisplayOnly
1046
          
1047
          Move "DD_Zero_Suppress" To sOption
1048
          Get DDForeignFieldOption hoDD iField sOption To bState
1049
          If (bState) Move True To Options.bZeroSuppress
1050
          
1051
          Move "DD_Required" To sOption
1052
          Get DDForeignFieldOption hoDD iField sOption To bState
1053
          If (bState) Move True To Options.bRequired
1054
          
1055
          Move "DD_FindReq" To sOption
1056
          Get DDForeignFieldOption hoDD iField sOption To bState
1057
          If (bState) Move True To Options.bFindReq
1058
          
1059
          Move "DD_Retain" To sOption
1060
          Get DDForeignFieldOption hoDD iField sOption To bState
1061
          If (bState) Move True to Options.bRetain
1062
          
1063
          Move "DD_RetainAll" To sOption
1064
          Get DDForeignFieldOption hoDD iField sOption To bState
1065
          If (bState) Move True To Options.bRetainAll
1066
          
1067
          Move "DD_SkipFound" To sOption
1068
          Get DDForeignFieldOption hoDD iField sOption To bState
1069
          If (bState) Move True To Options.bSkipFound
1070
          
1071
          Function_Return Options
1072
        End_Function
1073

    
1074
  
1075
        
1076
        Object oTable_TD is a TabDialog
1077
          Set Location To 8 3
1078
          Set Size to 134 258
1079
          Set peAnchors to anAll
1080
          
1081
          Object oTable_TP is a TabPage
1082
            Set Label to "Table"
1083

    
1084
            Object oTableName is a Form
1085
               Set Location to 8 35
1086
               Set Size to 13 106
1087
               Set Label to "Name:"
1088
               Set Label_Col_Offset to 2
1089
               Set Label_Justification_Mode to jMode_Right
1090
               Set Enabled_State to False
1091
            End_Object
1092

    
1093
            Object oOrdering is a Form
1094
               Set Location to 8 193
1095
               Set Size to 13 46
1096
               Set Label to "Ordering:"
1097
               Set Label_Col_Offset to 2
1098
               Set Label_Justification_Mode to jMode_Right
1099
               Set Enabled_State to False
1100
            End_Object
1101

    
1102
            Object oShouldSave_cb is a cReadOnlyCheckbox
1103
              Set Size to 10 50
1104
              Set Location to 27 12
1105
              Set Label to "Should Save"
1106
              Set psTooltip To "Should_Save"
1107
            End_Object
1108

    
1109
            Object oChangedState_cb is a cReadOnlyCheckbox
1110
              Set Size to 10 50
1111
              Set Location to 42 12
1112
              Set Label to "Changed"
1113
              Set psTooltip to "Changed_State"
1114
            End_Object
1115

    
1116
            Object oInUse_cb is a cReadOnlyCheckbox
1117
              Set Size to 10 50
1118
              Set Location to 57 12
1119
              Set Label to "In Use"
1120
              Set psTooltip To "In_Use_State"
1121
            End_Object
1122

    
1123
            Object oAutoFill_cb is a cReadOnlyCheckbox
1124
              Set Size to 10 50
1125
              Set Location to 72 12
1126
              Set Label to "Auto Fill"
1127
              Set psTooltip To "Auto_Fill_State"
1128
            End_Object
1129

    
1130
            Object oFillFromFirst_cb is a cReadOnlyCheckbox
1131
              Set Size to 10 50
1132
              Set Location to 87 12
1133
              Set Label to "Fill From First"
1134
              Set psTooltip To "pbAutoFillFromFirst"
1135
            End_Object
1136

    
1137
            Object oProtectKey_cb is a cReadOnlyCheckbox
1138
              Set Size to 10 50
1139
              Set Location to 27 82
1140
              Set Label to "Protect Key"
1141
              set psTooltip To "Protect_Key_State"
1142
            End_Object
1143

    
1144
            Object oReadOnly_cb is a cReadOnlyCheckbox
1145
              Set Size to 10 50
1146
              Set Location to 42 82
1147
              Set Label to "Read Only"
1148
              Set psTooltip to "Read_Only_State"
1149
            End_Object
1150

    
1151
            Object oNoDelete_cb is a cReadOnlyCheckbox
1152
              Set Size to 10 50
1153
              Set Location to 57 82
1154
              Set Label to "No Delete"
1155
              Set psTooltip To "No_Delete_State"
1156
            End_Object
1157

    
1158
            Object oNoRelate_cb is a cReadOnlyCheckbox
1159
              Set Size to 10 50
1160
              Set Location to 72 82
1161
              Set Label to "No Relate"
1162
              Set psTooltip To "No_Relate_State"
1163
            End_Object
1164

    
1165
            Object oParentChanged_cb is a cReadOnlyCheckbox
1166
              Set Size to 10 50
1167
              Set Location to 87 82
1168
              Set Label to "Parent Changed"
1169
              Set psTooltip To "Parent_Changed_State"
1170
            End_Object
1171

    
1172
            Object oInheritConstraints_cb is a cReadOnlyCheckbox
1173
              Set Size to 10 50
1174
              Set Location to 27 152
1175
              Set Label to "Inherit Constraints"
1176
              Set psTooltip To "pbInheritConstraints"
1177
            End_Object
1178

    
1179
            Object oUseDDRelates_cb is a cReadOnlyCheckbox
1180
              Set Size to 10 50
1181
              Set Location to 42 152
1182
              Set Label to "DD Relates"
1183
              Set psTooltip to "pbUseDDRelates"
1184
            End_Object
1185

    
1186
            Object oNoCascadeDeleteStrict is a cReadOnlyCheckbox
1187
              Set Size to 10 50
1188
              Set Location to 72 152
1189
              Set Label to "No Cascade Delete Strict"
1190
              Set psTooltip To "pbNoCascadeDeleteStrict"
1191
            End_Object
1192

    
1193
            Object oCascadeDelete_cb is a cReadOnlyCheckbox
1194
              Set Size to 10 50
1195
              Set Location to 87 152
1196
              Set Label to "Cascade Delete"
1197
              Set psTooltip To "Cascade_Delete_State"
1198
            End_Object
1199
                        
1200
            Procedure DisplayTabDetails
1201
              Handle  hoDD
1202
              String  sName
1203
              Boolean bState
1204
              tTable  Table
1205
            
1206
              Get phoCurrentDD  to hoDD
1207
              If (hoDD) Begin
1208
                Get pTable To Table
1209
                
1210
                Set Value         Of oTableName          To Table.sName
1211
                Set Checked_State Of oShouldSave_cb      To Table.bShouldSave
1212
                Set Checked_State Of oChangedState_cb    To Table.bChangedState
1213
                Set Checked_State Of oInUse_cb           To Table.bInUse
1214
                Set Checked_State Of oAutoFill_cb        To Table.bAutoFill
1215
                Set Checked_State Of oFillFromFirst_cb   To Table.bFillFromFirst
1216
                Set Checked_State Of oProtectKey_cb      To Table.bProtectKey
1217
                Set Checked_State Of oReadOnly_cb        To Table.bReadOnly
1218
                Set Checked_State Of oNoDelete_cb        To Table.bNoDelete
1219
                Set Checked_State Of oNoRelate_cb        To Table.bNoRelate
1220
                Set Checked_State Of oParentChanged_cb   To Table.bParentChanged
1221
                Set Checked_State Of oInheritConstraints_cb To Table.bInheritConstraints
1222
                Set Checked_State Of oUseDDRelates_cb    To Table.bUseDDRelates
1223
                Set Checked_State Of oNoCascadeDeleteStrict To Table.bNoCascadeDeleteStrict
1224
                Set Checked_State Of oCascadeDelete_cb   To Table.bCascadeDelete
1225
                Set Value         Of oOrdering           To Table.iOrdering
1226
              End
1227
            End_Procedure
1228
          End_Object
1229
          
1230
          Object oData_TP is a TabPage
1231
            Set Label to "Data"
1232
                
1233
      
1234
            Object oDataList is a cCJGrid
1235
              Set Size to 124 220
1236
              Set Location to 4 3
1237
              Set pbSelectionEnable To True
1238
              Set peAnchors to anAll
1239
              Set pbReadOnly to True
1240
      
1241
              Object oDataColumnNo is a cCJGridColumn
1242
                Set piWidth to 30
1243
                Set psCaption to "#"
1244
                Set psTooltip To "Column Number"
1245
                Set peDataType to Mask_Numeric_Window
1246
                Set pbResizable to False
1247
              End_Object
1248
      
1249
              Object oDataColumnName is a cCJGridColumn
1250
                Set piWidth to 70
1251
                Set psCaption to "Column"
1252
              End_Object
1253
      
1254
              Object oDataColumnChanged is a cCJGridColumn
1255
                Set piWidth to 25
1256
                Set pbCheckbox to True
1257
                //Set pbVisible To False
1258
                Set psCaption to "Changed"
1259
              End_Object
1260
      
1261
              Object oDataColumnDDValue is a cCJGridColumn
1262
                Set piWidth to 60
1263
                Set psCaption to "DD Value"
1264
                Set psTooltip To "DataDictionary Column Value"
1265
              End_Object
1266
      
1267
              Object oDataColumnRBValue is a cCJGridColumn
1268
                Set piWidth to 60
1269
                Set psCaption to "Rec.Buffer"
1270
                Set psTooltip To "Record Buffer Column Value"
1271
              End_Object
1272
              
1273
              
1274
              Procedure LoadData
1275
                Handle  hoDataSource
1276
                Handle  hoDD
1277
                Boolean bChanged
1278
                Boolean bIsCreated
1279
                Integer iRows
1280
                Integer iNo
1281
                Integer iName
1282
                Integer iChanged
1283
                Integer iDDValue
1284
                Integer iRBValue
1285
                Integer iItem
1286
                Integer iCount
1287
                Integer iField
1288
                String  sDDValue
1289
                String  sRBValue
1290
                String  sField
1291
                tTable  Table
1292
                tColumn[] Columns
1293
                tDataSourceRow[] TheData
1294
                
1295
                Get phoDataSource to hoDataSource
1296
                Get phoCurrentDD  to hoDD
1297
                
1298
                // Get the datasource indexes of the various columns
1299
                Get piColumnId of oDataColumnNo      To iNo
1300
                Get piColumnId of oDataColumnName    To iName
1301
                Get piColumnId of oDataColumnChanged To iChanged
1302
                Get piColumnId of oDataColumnDDValue To iDDValue
1303
                Get piColumnId Of oDataColumnRBValue To iRBValue
1304
        
1305
                // Load all data into the datasource array
1306
                If (hoDD) Begin
1307
                  Get pTable To Table
1308
                  Move Table.Columns To Columns
1309
                  Move (SizeOfArray(Columns)) To iCount
1310
                  For iItem From 0 To (iCount-1)
1311
                    Move Columns[iItem].iNr      To iField
1312
                    Move Columns[iItem].sName    To sField
1313
                    Move Columns[iItem].bChanged To bChanged
1314
                    Move Columns[iItem].sDDValue To sDDValue
1315
                    Move Columns[iItem].sRBValue To sRBValue
1316
      
1317
                    Move iField   To TheData[iRows].sValue[iNo]
1318
                    Move sField   To TheData[iRows].sValue[iName]
1319
                    Move bChanged To TheData[iRows].sValue[iChanged]
1320
                    Move sDDValue To TheData[iRows].sValue[iDDValue]
1321
                    Move sRBValue To TheData[iRows].sValue[iRBValue]
1322
                    
1323
                    Increment iRows
1324
                  Loop
1325
    
1326
                End
1327
                
1328
                Get IsComObjectCreated To bIsCreated
1329
                If (bIsCreated) Begin
1330
                  // Initialize Grid with new data
1331
                  Send InitializeData TheData
1332
                  Send MovetoFirstRow
1333
                End
1334
              End_Procedure
1335
            End_Object
1336
            
1337
                        
1338
            Procedure DisplayTabDetails
1339
              Send LoadData of oDataList
1340
            End_Procedure
1341
          End_Object
1342
          
1343
          Object oFieldOptions_TP is a TabPage
1344
            Set Label to "Options"
1345
    
1346
            Object oFieldOptionsColumnsList is a cCJGrid
1347
              Set Size to 114 80
1348
              Set Location to 4 3
1349
              Set pbSelectionEnable To True
1350
              Set peAnchors to anTopBottomLeft
1351
              Set pbReadOnly to True
1352
      
1353
              Object oOptionsColumnNo is a cCJGridColumn
1354
                Set piWidth to 30
1355
                Set psCaption to "#"
1356
                Set peDataType to Mask_Numeric_Window
1357
                Set pbResizable to False
1358
              End_Object
1359
      
1360
              Object oOptionsColumnName is a cCJGridColumn
1361
                Set piWidth to 50
1362
                Set psCaption to "Column"
1363
              End_Object
1364
      
1365
              Object oOptionsColumnChanged is a cCJGridColumn
1366
                Set piWidth to 35
1367
                Set pbCheckbox to True
1368
                Set psCaption to "Changed"
1369
                Set pbVisible To False
1370
                Set pbShowInFieldChooser To False
1371
              End_Object
1372
              
1373
              Function CurrentRow Returns Integer
1374
                Handle  hoDataSource
1375
                Integer iRow
1376
                
1377
                Move -1 To iRow
1378
                Get phoDataSource to hoDataSource
1379
                If (hoDataSource) Begin
1380
                  Get SelectedRow of hoDataSource to iRow
1381
                End
1382
                Function_Return irow
1383
              End_Function
1384
              
1385
              Procedure OnRowChanged Integer iOld Integer iNew
1386
                Forward Send OnRowChanged iOld iNew
1387
                If (iOld<>iNew) begin
1388
                  Send DisplayFieldOptions
1389
                End
1390
              End_Procedure
1391
              
1392
              
1393
              Procedure LoadData
1394
                Handle  hoDataSource
1395
                Handle  hoDD
1396
                Boolean bChanged
1397
                Boolean bIsCreated
1398
                Integer iRows
1399
                Integer iNo
1400
                Integer iName
1401
                Integer iChanged
1402
                Integer iCount
1403
                Integer iField
1404
                Integer iItem
1405
                String  sValue
1406
                String  sField
1407
                tTable  Table
1408
                tColumn[] Columns
1409
                tDataSourceRow[] TheData
1410
                
1411
                Get phoDataSource to hoDataSource
1412
                Get phoCurrentDD  to hoDD
1413
                
1414
                // Get the datasource indexes of the various columns
1415
                Get piColumnId of oOptionsColumnNo      To iNo
1416
                Get piColumnId of oOptionsColumnName    To iName
1417
                Get piColumnId of oOptionsColumnChanged To iChanged
1418
        
1419
                // Load all data into the datasource array
1420
                If (hoDD) Begin
1421
                  Get pTable To Table
1422
                  Move Table.Columns To Columns
1423
                  Move (SizeOfArray(Columns)) To iCount
1424
                  For iItem From 0 To (iCount-1)
1425
                    Move Columns[iItem].iNr      To iField
1426
                    Move Columns[iItem].sName    To sField
1427
                    Move Columns[iItem].bChanged To bChanged
1428
      
1429
                    Move iField   To TheData[iRows].sValue[iNo]
1430
                    Move sField   To TheData[iRows].sValue[iName]
1431
                    Move bChanged To TheData[iRows].sValue[iChanged]
1432
                    Increment iRows
1433
                  Loop
1434
    
1435
                End
1436
                
1437
                Get IsComObjectCreated To bIsCreated
1438
                If (bIsCreated) Begin
1439
                  // Initialize Grid with new data
1440
                  Send InitializeData TheData
1441
                  Send MovetoFirstRow
1442
                End
1443
              End_Procedure
1444
            End_Object
1445

    
1446

    
1447

    
1448

    
1449

    
1450
            Object oAutoFind_cb is a cReadOnlyCheckbox
1451
              Set Size to 10 50
1452
              Set Location to 13 92
1453
              Set Label to "Auto Find"
1454
            End_Object
1455

    
1456
            Object oAutoFindGE_cb is a cReadOnlyCheckbox
1457
              Set Size to 10 50
1458
              Set Location to 25 92
1459
              Set Label to "Auto Find GE"
1460
            End_Object
1461

    
1462
            Object oCapslock_cb is a cReadOnlyCheckbox
1463
              Set Size to 10 50
1464
              Set Location to 37 92
1465
              Set Label to "Capslock"
1466
            End_Object
1467

    
1468
            //Object oDisplayOnly_cb is a cReadOnlyCheckbox
1469
            //  Set Size to 10 50
1470
            //  Set Location to 49 92
1471
            //  Set Label to "DisplayOnly"
1472
            //End_Object
1473

    
1474
            Object oFindReq_cb is a cReadOnlyCheckbox
1475
              Set Size to 10 50
1476
              Set Location to 61 92
1477
              Set Label to "FindReq"
1478
            End_Object
1479

    
1480
            Object oForcePut_cb is a cReadOnlyCheckbox
1481
              Set Size to 10 50
1482
              Set Location to 73 92
1483
              Set Label to "ForcePut"
1484
            End_Object
1485

    
1486
            Object oKeyfield_cb is a cReadOnlyCheckbox
1487
              Set Size to 10 50
1488
              Set Location to 85 92
1489
              Set Label to "Keyfield"
1490
            End_Object
1491

    
1492
            Object oNoEnter_cb is a cReadOnlyCheckbox
1493
              Set Size to 10 50
1494
              Set Location to 97 92
1495
              Set Label to "NoEnter"
1496
            End_Object
1497

    
1498
            Object oNoPut_cb is a cReadOnlyCheckbox
1499
              Set Size to 10 50
1500
              Set Location to 109 92
1501
              Set Label to "NoPut"
1502
            End_Object
1503

    
1504
            Object oRetain_cb is a cReadOnlyCheckbox
1505
              Set Size to 10 50
1506
              Set Location to 13 175
1507
              Set Label to "Retain"
1508
            End_Object
1509

    
1510
            Object oRequired_cb is a cReadOnlyCheckbox
1511
              Set Size to 10 50
1512
              Set Location to 25 175
1513
              Set Label to "Required"
1514
            End_Object
1515

    
1516
            Object oSkipFound_cb is a cReadOnlyCheckbox
1517
              Set Size to 10 50
1518
              Set Location to 37 175
1519
              Set Label to "SkipFound"
1520
            End_Object
1521

    
1522
            Object oZeroSuppress_cb is a cReadOnlyCheckbox
1523
              Set Size to 10 50
1524
              Set Location to 49 175
1525
              Set Label to "ZeroSuppress"
1526
            End_Object
1527

    
1528
            Object oCommit_cb is a cReadOnlyCheckbox
1529
              Set Size to 10 50
1530
              Set Location to 61 175
1531
              Set Label to "Commit"
1532
            End_Object
1533
            
1534
            Procedure DisplayFieldOptions
1535
              Handle  hoDD
1536
              Integer iRow
1537
              Integer iField
1538
              tFieldOptions Options
1539
              
1540
              Get phoCurrentDD To hoDD
1541
              Get CurrentRow Of oFieldOptionsColumnsList To iRow
1542
              If (iRow<>-1 and hoDD) Begin
1543
                Get SelectedRowValue of oOptionsColumnNo to iField
1544
                Get DDFieldOptions hoDD iField To Options
1545
                Set Checked_State of oAutoFind_cb       To Options.bAutoFind
1546
                Set Checked_State of oAutoFindGE_cb     To Options.bAutoFindGE
1547
                Set Checked_State of oCapslock_cb       To Options.bCapslock
1548
                //Set Checked_State of oDisplayOnly_cb    To Options.bDisplayOnly
1549
                Set Checked_State of oFindReq_cb        To Options.bFindReq
1550
                Set Checked_State of oForcePut_cb       To Options.bForcePut
1551
                Set Checked_State Of oKeyfield_cb       To Options.bKeyField
1552
                Set Checked_State Of oNoEnter_cb        To Options.bNoEnter
1553
                Set Checked_State Of oNoPut_cb          To Options.bNoPut
1554
                Set Checked_State Of oRetain_cb         To Options.bRetain
1555
                Set Checked_State Of oRequired_cb       To Options.bRequired
1556
                Set Checked_State Of oSkipFound_cb      To Options.bSkipFound
1557
                Set Checked_State Of oZeroSuppress_cb   To Options.bZeroSuppress
1558
                Set Checked_State Of oCommit_cb         To Options.bCommit
1559
              End
1560
            End_Procedure
1561
            
1562
            Procedure DisplayTabDetails
1563
              Send LoadData  Of oFieldOptionsColumnsList
1564
              Send DisplayFieldOptions
1565
            End_Procedure
1566
          End_Object
1567
          
1568
                    
1569
          Object oForeignFieldOptions_TP is a TabPage
1570
            Set Label to "Foreign Options"
1571

    
1572
            //Object oDisplayOnly_cb is a cReadOnlyCheckbox
1573
            //  Set Size to 10 50
1574
            //  Set Location to 49 92
1575
            //  Set Label to "DisplayOnly"
1576
            //End_Object
1577

    
1578
            Object oForeignKeyGrp is a Group
1579
              Set Size to 86 73
1580
              Set Location to 6 8
1581
              Set Label to "Key Fields"
1582

    
1583
              Object oAutoFind_cb is a cReadOnlyCheckbox
1584
                Set Size to 10 50
1585
                Set Location to 10 10
1586
                Set Label to "Auto Find"
1587
              End_Object
1588
              Object oAutoFindGE_cb is a cReadOnlyCheckbox
1589
                Set Size to 10 50
1590
                Set Location to 22 10
1591
                Set Label to "Auto Find GE"
1592
              End_Object
1593
              Object oFindReq_cb is a cReadOnlyCheckbox
1594
                Set Size to 10 50
1595
                Set Location to 34 10
1596
                Set Label to "FindReq"
1597
              End_Object
1598
              Object oNoEnter_cb is a cReadOnlyCheckbox
1599
                Set Size to 10 50
1600
                Set Location to 46 10
1601
                Set Label to "NoEnter"
1602
              End_Object
1603
              Object oNoPut_cb is a cReadOnlyCheckbox
1604
                Set Size to 10 50
1605
                Set Location to 58 10
1606
                Set Label to "NoPut"
1607
              End_Object
1608
              Object oSkipFound_cb is a cReadOnlyCheckbox
1609
                Set Size to 10 50
1610
                Set Location to 70 10
1611
                Set Label to "SkipFound"
1612
                Set psTooltip to "DD_SkipFound"
1613
              End_Object
1614
              
1615
              Procedure DisplayFieldOptions tFieldOptions Options
1616
                Set Checked_State of oAutoFind_cb       To Options.bAutoFind
1617
                Set Checked_State of oAutoFindGE_cb     To Options.bAutoFindGE
1618
                Set Checked_State of oCapslock_cb       To Options.bCapslock
1619
                //Set Checked_State of oDisplayOnly_cb    To Options.bDisplayOnly
1620
                Set Checked_State of oFindReq_cb        To Options.bFindReq
1621
                Set Checked_State Of oNoEnter_cb        To Options.bNoEnter
1622
                Set Checked_State Of oNoPut_cb          To Options.bNoPut
1623
                Set Checked_State Of oSkipFound_cb      To Options.bSkipFound
1624
              End_Procedure
1625
            End_Object
1626

    
1627
            Object oForeignIndexGrp is a Group
1628
              Set Size to 86 73
1629
              Set Location to 6 88
1630
              Set Label to "Index Fields"
1631

    
1632
              Object oAutoFind_cb is a cReadOnlyCheckbox
1633
                Set Size to 10 50
1634
                Set Location to 10 10
1635
                Set Label to "Auto Find"
1636
              End_Object
1637
              Object oAutoFindGE_cb is a cReadOnlyCheckbox
1638
                Set Size to 10 50
1639
                Set Location to 22 10
1640
                Set Label to "Auto Find GE"
1641
              End_Object
1642
              Object oFindReq_cb is a cReadOnlyCheckbox
1643
                Set Size to 10 50
1644
                Set Location to 34 10
1645
                Set Label to "FindReq"
1646
              End_Object
1647
              Object oNoEnter_cb is a cReadOnlyCheckbox
1648
                Set Size to 10 50
1649
                Set Location to 46 10
1650
                Set Label to "NoEnter"
1651
              End_Object
1652
              Object oNoPut_cb is a cReadOnlyCheckbox
1653
                Set Size to 10 50
1654
                Set Location to 58 10
1655
                Set Label to "NoPut"
1656
              End_Object
1657
              Object oSkipFound_cb is a cReadOnlyCheckbox
1658
                Set Size to 10 50
1659
                Set Location to 70 10
1660
                Set Label to "SkipFound"
1661
                Set psTooltip to "DD_SkipFound"
1662
              End_Object
1663
              
1664
              Procedure DisplayFieldOptions tFieldOptions Options
1665
                Set Checked_State of oAutoFind_cb       To Options.bAutoFind
1666
                Set Checked_State of oAutoFindGE_cb     To Options.bAutoFindGE
1667
                Set Checked_State of oCapslock_cb       To Options.bCapslock
1668
                //Set Checked_State of oDisplayOnly_cb    To Options.bDisplayOnly
1669
                Set Checked_State of oFindReq_cb        To Options.bFindReq
1670
                Set Checked_State Of oNoEnter_cb        To Options.bNoEnter
1671
                Set Checked_State Of oNoPut_cb          To Options.bNoPut
1672
                Set Checked_State Of oSkipFound_cb      To Options.bSkipFound
1673
              End_Procedure
1674
            End_Object
1675

    
1676
            Object oForeignDefaultGrp is a Group
1677
              Set Size to 86 73
1678
              Set Location to 6 167
1679
              Set Label to "Default"
1680
              Object oNoEnter_cb is a cReadOnlyCheckbox
1681
                Set Size to 10 50
1682
                Set Location to 46 10
1683
                Set Label to "NoEnter"
1684
              End_Object
1685
              Object oNoPut_cb is a cReadOnlyCheckbox
1686
                Set Size to 10 50
1687
                Set Location to 58 10
1688
                Set Label to "NoPut"
1689
              End_Object
1690
              Object oSkipFound_cb is a cReadOnlyCheckbox
1691
                Set Size to 10 50
1692
                Set Location to 70 10
1693
                Set Label to "SkipFound"
1694
                Set psTooltip to "DD_SkipFound"
1695
              End_Object
1696
              
1697
              Procedure DisplayFieldOptions tFieldOptions Options
1698
                Set Checked_State Of oNoEnter_cb        To Options.bNoEnter
1699
                Set Checked_State Of oNoPut_cb          To Options.bNoPut
1700
                Set Checked_State Of oSkipFound_cb      To Options.bSkipFound
1701
              End_Procedure
1702
            End_Object
1703

    
1704
            Object oForeignReadonly_cb is a cReadOnlyCheckbox
1705
              Set Size to 10 50
1706
              Set Location to 102 55
1707
              Set Label to "Foreign Readonly"
1708
              Set psTooltip to "pbForeignReadOnly"
1709
            End_Object
1710
            Object oForeignNewSave_cb is a cReadOnlyCheckbox
1711
              Set Size to 10 50
1712
              Set Location to 102 152
1713
              Set Label to "Foreign New Save"
1714
              Set psTooltip to "Allow_Foreign_New_Save_State"
1715
            End_Object
1716
            
1717
            
1718
            Procedure DisplayForeignFieldOptions tForeignFieldOptions Foreign
1719
              Send DisplayFieldOptions Of oForeignKeyGrp     Foreign.ddKey
1720
              Send DisplayFieldOptions Of oForeignIndexGrp   Foreign.ddIndex
1721
              Send DisplayFieldOptions Of oForeignDefaultGrp Foreign.ddDefault
1722
            End_Procedure
1723
                        
1724
            Procedure DisplayTabDetails
1725
              Handle  hoDD
1726
              tTable  Table
1727
            
1728
              Get phoCurrentDD  to hoDD
1729
              If (hoDD) Begin
1730
                Get pTable To Table
1731
                
1732
                Set Checked_State Of oForeignReadonly_cb To Table.Foreign.bReadOnly
1733
                Set Checked_State Of oForeignNewSave_cb  To Table.Foreign.bAllowNewSave
1734
              End
1735
              Send DisplayForeignFieldOptions Table.Foreign
1736
            End_Procedure
1737
            
1738
          End_Object
1739
      
1740
          Object oRelationships_TP is a TabPage
1741
            Set Label to "Relationships"
1742

    
1743
            Object oParentGroup is a Group
1744
              Set Size to 58 234
1745
              Set Location to 1 4
1746
              Set Label to "Parents"
1747

    
1748
              Object oParentList is a cCJGrid
1749
                Set Size to 50 155
1750
                Set Location to 7 3
1751
                Set pbSelectionEnable to True
1752
                Set peAnchors to anAll
1753
                Set pbReadOnly to True
1754
        
1755
                Object oParentColumnNo is a cCJGridColumn
1756
                  Set piWidth to 40
1757
                  Set psCaption to "#"
1758
                  Set psTooltip to "File Number"
1759
                  Set peDataType to Mask_Numeric_Window
1760
                  Set pbResizable to False
1761
                End_Object
1762
        
1763
                Object oParentColumnName is a cCJGridColumn
1764
                  Set piWidth to 270
1765
                  Set psCaption to "Name"
1766
                End_Object
1767
                
1768
                Procedure LoadData
1769
                  Handle  hoDataSource
1770
                  Handle  hoDD
1771
                  Boolean bIsCreated
1772
                  Integer iRows
1773
                  Integer iNo
1774
                  Integer iName
1775
                  Integer iItem
1776
                  Integer iCount
1777
                  Integer iFile
1778
                  String  sFile
1779
                  tTable  Table
1780
                  tServer[] Servers
1781
                  tDataSourceRow[] TheData
1782
                  
1783
                  Get phoDataSource to hoDataSource
1784
                  Get phoCurrentDD  to hoDD
1785
                  
1786
                  // Get the datasource indexes of the various columns
1787
                  Get piColumnId of oDataColumnNo      to iNo
1788
                  Get piColumnId of oDataColumnName    to iName
1789
          
1790
                  // Load all data into the datasource array
1791
                  If (hoDD) Begin
1792
                    Get pTable to Table
1793
                    Move Table.Servers to Servers
1794
                    Move (SizeOfArray(Servers)) to iCount
1795
                    For iItem from 0 to (iCount-1)
1796
                      Move Servers[iItem].iFile    to iFile
1797
                      Move Servers[iItem].sName    to sFile
1798
        
1799
                      Move iFile   to TheData[iRows].sValue[iNo]
1800
                      Move sFile   to TheData[iRows].sValue[iName]
1801
                      
1802
                      Increment iRows
1803
                    Loop
1804
      
1805
                  End
1806
                  
1807
                  Get IsComObjectCreated to bIsCreated
1808
                  If (bIsCreated) Begin
1809
                    // Initialize Grid with new data
1810
                    Send InitializeData TheData
1811
                    Send MovetoFirstRow
1812
                  End
1813
                End_Procedure
1814
                
1815
                Function CurrentRow Returns Integer
1816
                  Handle  hoDataSource
1817
                  Integer iRow
1818
                  
1819
                  Move -1 To iRow
1820
                  Get phoDataSource to hoDataSource
1821
                  If (hoDataSource) Begin
1822
                    Get SelectedRow of hoDataSource to iRow
1823
                  End
1824
                  Function_Return irow
1825
                End_Function
1826
                
1827
                Procedure OnRowChanged Integer iOld Integer iNew
1828
                  Forward Send OnRowChanged iOld iNew
1829
                  If (iOld<>iNew) begin
1830
                    Send DisplayParentDetails
1831
                  End
1832
                End_Procedure
1833
                
1834
              End_Object
1835

    
1836
              Object oParentNullAllowed_cb is a cReadOnlyCheckBox
1837
                Set Size to 10 50
1838
                Set Location to 18 169
1839
                Set Label to "Null Allowed"
1840
                Set psToolTip to "ParentNullAllowed"
1841
              End_Object
1842

    
1843
              Object oParentNoSwitch_cb is a cReadOnlyCheckBox
1844
                Set Size to 10 50
1845
                Set Location to 30 169
1846
                Set Label to "No Switch"
1847
                Set psToolTip to "ParentNoSwitchIfCommitted"
1848
              End_Object
1849
              
1850
              Procedure DisplayParentDetails
1851
                Integer iRow
1852
                Integer iFile
1853
                Handle  hoDD
1854
                tTable  Table
1855
                tServer[] Servers
1856
                
1857
                Get phoCurrentDD To hoDD
1858
                Get CurrentRow Of oParentList To iRow
1859
                If (iRow<>-1 and hoDD) Begin
1860
                  Get pTable to Table
1861
                  Move Table.Servers to Servers
1862
                  
1863
                  Get SelectedRowValue of oParentColumnNo to iFile
1864
                  If (Servers[iRow].iFile=iFile) Begin
1865
                     Set Checked_State of oParentNullAllowed_cb To Servers[iRow].bNullAllowed
1866
                     Set Checked_State of oParentNoSwitch_cb    To Servers[iRow].bNoSwitch
1867
                  End
1868
                  Else Begin
1869
                    Send Info_Box ("DisplayParentDetails assert grid ifile"+trim(Servers[iRow].iFile)+"<>"+trim(iFile)+"ifile")
1870
                  End
1871
                End
1872
              End_Procedure
1873
            End_Object
1874

    
1875
            Object oChildGroup is a Group
1876
              Set Size to 58 234
1877
              Set Location to 60 4
1878
              Set Label to "Childs"
1879

    
1880
              Object oChildList is a cCJGrid
1881
                Set Size to 50 154
1882
                Set Location to 8 3
1883
                Set pbSelectionEnable to True
1884
                Set peAnchors to anAll
1885
                Set pbReadOnly to True
1886
        
1887
                Object oChildColumnNo is a cCJGridColumn
1888
                  Set piWidth to 38
1889
                  Set psCaption to "#"
1890
                  Set psTooltip to "File Number"
1891
                  Set peDataType to Mask_Numeric_Window
1892
                  Set pbResizable to False
1893
                End_Object
1894
        
1895
                Object oChildColumnName is a cCJGridColumn
1896
                  Set piWidth to 270
1897
                  Set psCaption to "Name"
1898
                End_Object
1899
                
1900
                Procedure LoadData
1901
                  Handle  hoDataSource
1902
                  Handle  hoDD
1903
                  Boolean bIsCreated
1904
                  Integer iRows
1905
                  Integer iNo
1906
                  Integer iName
1907
                  Integer iItem
1908
                  Integer iCount
1909
                  Integer iFile
1910
                  String  sFile
1911
                  tTable  Table
1912
                  tClient[] Clients
1913
                  tDataSourceRow[] TheData
1914
                  
1915
                  Get phoDataSource to hoDataSource
1916
                  Get phoCurrentDD  to hoDD
1917
                  
1918
                  // Get the datasource indexes of the various columns
1919
                  Get piColumnId of oDataColumnNo      to iNo
1920
                  Get piColumnId of oDataColumnName    to iName
1921
          
1922
                  // Load all data into the datasource array
1923
                  If (hoDD) Begin
1924
                    Get pTable to Table
1925
                    Move Table.Clients to Clients
1926
                    Move (SizeOfArray(Clients)) to iCount
1927
                    For iItem from 0 to (iCount-1)
1928
                      Move Clients[iItem].iFile    to iFile
1929
                      Move Clients[iItem].sName    to sFile
1930
        
1931
                      Move iFile   to TheData[iRows].sValue[iNo]
1932
                      Move sFile   to TheData[iRows].sValue[iName]
1933
                      
1934
                      Increment iRows
1935
                    Loop
1936
      
1937
                  End
1938
                  
1939
                  Get IsComObjectCreated to bIsCreated
1940
                  If (bIsCreated) Begin
1941
                    // Initialize Grid with new data
1942
                    Send InitializeData TheData
1943
                    Send MovetoFirstRow
1944
                  End
1945
                End_Procedure
1946
              End_Object
1947
            End_Object
1948
                   
1949
                   
1950
                   
1951
            Procedure DisplayTabDetails
1952
              Send LoadData  Of oParentList
1953
              Send DisplayParentDetails of oParentGroup
1954
              Send LoadData  of oChildList
1955
            End_Procedure
1956
          End_Object
1957
      
1958
          
1959
          Function Tab_Change Integer iToTab Integer ePointerMode Returns Integer
1960
            Handle  hoToTab
1961
            Integer iCurrentTab
1962
            Integer iRetVal
1963
            
1964
            Get Current_Tab To iCurrentTab
1965
            Forward Get Tab_Change iToTab ePointerMode To iRetVal
1966
            If (iCurrentTab<>-1 and iRetval=0) Begin
1967
              Get Tab_Page_Id iToTab To hoToTab
1968
              If (hoToTab=oFieldOptions_TP or hoToTab=oForeignFieldOptions_TP or hoToTab=oData_TP or hoToTab=oTable_TP or hoToTab=oRelationships_TP) Begin
1969
                Send DisplayTabDetails of hoToTab
1970
              End
1971
            End
1972
            Function_Return iRetVal
1973
          End_Function
1974
          
1975
          Procedure UpdateCurrentTab
1976
            Handle  hoTab
1977
            Integer iTab
1978
            
1979
            Get Current_Tab To iTab
1980
            If (iTab<>-1) Begin
1981
              Get Tab_Page_Id iTab To hoTab
1982
              If (hoTab=oFieldOptions_TP or hoTab=oData_TP or hoTab=oTable_TP or hoTab=oRelationships_TP) Begin
1983
                Send DisplayTabDetails of hoTab
1984
              End
1985
            End
1986
          End_Procedure
1987
          
1988
        End_Object
1989
        
1990
        Function EmptyTable Returns tTable
1991
          tTable    Table
1992
          tColumn[] Columns
1993
          
1994
          Move (ResizeArray(Columns,0)) To Columns
1995
          Move 0  To Table.iNr
1996
          Move "" To Table.sName
1997
          Move Columns To Table.Columns
1998
          Function_Return Table
1999
        End_Function
2000
        
2001
        Function EnumerateColumns Handle hoDD String sFile Returns tColumn[]
2002
          Boolean bChanged
2003
          Integer iCount
2004
          Integer iItem
2005
          Integer iField
2006
          Integer iMainIndex
2007
          String  sField
2008
          String  sValue
2009
          String  sRBValue
2010
          tColumn[] Columns
2011
          
2012
          Get PropertyIntegerEval of oProgram "Field_Count" hoDD To iCount
2013
          Move 0 To iItem
2014
          For iField From 0 To iCount
2015
            Get StringEval of oProgram ("Field_Label_Tag("+trim(hoDD)+","+trim(iField)+")") To sValue
2016
            Move sValue To sField
2017
            
2018
            //Get DDFieldOptionsToString hoDD iField To sOptions
2019
            //If (sOptions<>"") Move ("-"+sOptions) To sOptions
2020
            
2021
            Get StringEval of oProgram ("Field_Current_Value("+trim(hoDD)+","+trim(iField)+")") To sValue
2022
            Get StringEval of oProgram ("Field_Changed_State("+trim(hoDD)+","+trim(iField)+")") To bChanged
2023
            Get StringEval of oProgram ("Field_Index("        +trim(hoDD)+","+trim(iField)+")") To iMainIndex
2024
                        
2025
            Get StringEval of oProgram (trim(sFile)+"."+trim(sField)) To sRBValue
2026
            
2027
            Move iField     To Columns[iItem].iNr
2028
            Move sField     To Columns[iItem].sName
2029
            Move sValue     To Columns[iItem].sDDValue
2030
            Move sRBValue   To Columns[iItem].sRBValue
2031
            Move bChanged   To Columns[iItem].bChanged
2032
            Move iMainIndex To Columns[iItem].iMainIndex
2033
            Increment iItem
2034
          Loop
2035
          Function_Return Columns
2036
        End_Function
2037
        
2038
        Function EnumerateParents Handle hoDD Returns tServer[]
2039
          Integer iCount
2040
          Integer iFile
2041
          Integer iItem
2042
          Integer iRuntimeVersion
2043
          Handle  hoDebugger
2044
          Boolean bNullAllowed
2045
          Boolean bNoSwitch
2046
          Handle  hoParent
2047
          String  sValue
2048
          String  sName
2049
          tServer[] Servers
2050
          
2051
          Get PropertyIntegerEval of oProgram "Data_Set_Server_Count" hoDD To iCount
2052
          For iItem From 0 To (iCount-1)
2053
            Get StringEval of oProgram ("Data_Set_Server("+trim(hoDD)+","+trim(iItem)+")") To sValue
2054
            Move sValue To hoParent
2055
            Get ShortName Of oProgram hoParent To sName
2056
            Get PropertyIntegerEval Of oProgram "Main_File" hoParent To iFile
2057
            
2058
            Move False To bNullAllowed
2059
            Move False To bNoSwitch
2060
            Get phoDebugger To hoDebugger
2061
            If (hoDebugger) Begin
2062
              Get piRuntimeVersion of hoDebugger To iRuntimeVersion
2063
              If (iRuntimeVersion>=170) Begin
2064
                // VDF17.0+
2065
                Get StringEval of oProgram ("ParentNullAllowed("+trim(hoDD)+","+trim(iFile)+")") To sValue
2066
                Move sValue To bNullAllowed
2067
                Get StringEval of oProgram ("ParentNoSwitchIfCommitted("+trim(hoDD)+","+trim(iFile)+")") To sValue
2068
                Move sValue To bNoSwitch
2069
              End
2070
            End
2071
            
2072
            Move hoParent     To Servers[iItem].hoDD
2073
            Move sName        To Servers[iItem].sName
2074
            Move iFile        To Servers[iItem].iFile
2075
            Move bNullAllowed To Servers[iItem].bNullAllowed
2076
            Move bNoSwitch    To Servers[iItem].bNoSwitch
2077
          Loop
2078
          Function_Return Servers
2079
        End_Function
2080
        
2081
        Function EnumerateChilds Handle hoDD Returns tClient[]
2082
          Integer iCount
2083
          Integer iFile
2084
          Integer iItem
2085
          Handle  hoChild
2086
          String  sValue
2087
          String  sName
2088
          tClient[] Clients
2089
          
2090
          Get PropertyIntegerEval of oProgram "Data_Set_Client_Count" hoDD To iCount
2091
          For iItem From 0 To (iCount-1)
2092
            Get StringEval of oProgram ("Data_Set_Client("+trim(hoDD)+","+trim(iItem)+")") To sValue
2093
            Move sValue To hoChild
2094
            Get ShortName Of oProgram hoChild To sName
2095
            Get PropertyIntegerEval Of oProgram "Main_File" hoChild To iFile
2096
            
2097
            Move hoChild  To Clients[iItem].hoDD
2098
            Move sName    To Clients[iItem].sName
2099
            Move iFile    To Clients[iItem].iFile
2100
          Loop
2101
          Function_Return Clients
2102
        End_Function
2103
        
2104
        Function ForeignFieldOptions Handle hoDD Returns tForeignFieldOptions
2105
          Boolean bReadOnly
2106
          Boolean bNewSave
2107
          tFieldOptions ddDefault
2108
          tFieldOptions ddIndex
2109
          tFieldOptions ddKey
2110
          tForeignFieldOptions Foreign
2111
          
2112
          Get PropertyBooleanEval of oProgram "pbForeignReadOnly"            hoDD To bReadOnly
2113
          Get PropertyBooleanEval of oProgram "Allow_Foreign_New_Save_State" hoDD To bNewSave
2114
          
2115
          Get DDForeignFieldOptions hoDD DD_Default      To ddDefault
2116
          Get DDForeignFieldOptions hoDD DD_IndexField   To ddIndex
2117
          Get DDForeignFieldOptions hoDD DD_KeyField     To ddKey
2118
          
2119
          Move bReadOnly    To Foreign.bReadOnly
2120
          Move bNewSave     To Foreign.bAllowNewSave
2121
          Move ddDefault    To Foreign.ddDefault
2122
          Move ddIndex      To Foreign.ddIndex
2123
          Move ddKey        To Foreign.ddKey
2124
          Function_Return Foreign
2125
        End_Function
2126
        
2127
        Procedure DisplayDataDictionaryDetails Integer iMainFile
2128
          Handle  hoDD
2129
          Handle  hoParent
2130
          Handle  hoChild
2131
          Boolean bTableChanged
2132
          Boolean bShouldSave
2133
          Boolean bChanged
2134
          Boolean bInUse
2135
          Boolean bAutoFill
2136
          Boolean bFillFromFirst
2137
          Boolean bProtectKey
2138
          Boolean bReadOnly
2139
          Boolean bNoDelete
2140
          Boolean bNoRelate
2141
          Boolean bParentChanged
2142
          Boolean bInheritConstraints
2143
          Boolean bUseDDRelates
2144
          Boolean bNoCascadeDeleteStrict
2145
          Boolean bCascadeDelete
2146
          Integer iItem
2147
          Integer iCount
2148
          Integer iField
2149
          Integer iOrdering
2150
          String  sTableName
2151
          String  sField
2152
          String  sValue
2153
          String  sOptions
2154
          String  sLine
2155
          tColumn[] Columns
2156
          tServer[] Servers
2157
          tClient[] Clients
2158
          tForeignFieldOptions Foreign
2159
          tTable  Table
2160
          
2161
          Get phoTarget    To hoDD
2162
          Set phoCurrentDD To hoDD
2163
          Get Emptytable   To Table
2164
          
2165
          Get TableName hoDD iMainFile To sTableName
2166
          
2167
          Move ("DataDictionary for Table : "+sTableName) To sLine
2168
          Set Label Of oDDGroup To sLine
2169
          
2170
          Get PropertyBooleanEval of oProgram "Should_Save"          hoDD To bShouldSave
2171
          Get PropertyBooleanEval of oProgram "Changed_State"        hoDD To bTableChanged
2172
          Get PropertyBooleanEval of oProgram "In_Use_State"         hoDD To bInUse
2173
          Get PropertyBooleanEval of oProgram "Auto_Fill_State"      hoDD To bAutoFill
2174
          Get PropertyBooleanEval of oProgram "pbAutoFillFromFirst"  hoDD To bFillFromFirst
2175
          Get PropertyIntegerEval of oProgram "Ordering"             hoDD To iOrdering
2176
          Get PropertyBooleanEval of oProgram "Protect_Key_State"    hoDD To bProtectKey
2177
          Get PropertyBooleanEval of oProgram "Read_Only_State"      hoDD To bReadOnly
2178
          Get PropertyBooleanEval of oProgram "No_Delete_State"      hoDD To bNoDelete
2179
          Get PropertyBooleanEval of oProgram "No_Relate_State"      hoDD To bNoRelate
2180
          Get PropertyBooleanEval of oProgram "Parent_Changed_State" hoDD To bParentChanged
2181
          Get PropertyBooleanEval of oProgram "pbInheritConstraints" hoDD To bInheritConstraints
2182
          Get PropertyBooleanEval of oProgram "pbUseDDRelates"       hoDD To bUseDDRelates
2183
          Get PropertyBooleanEval of oProgram "pbNoCascadeDeleteStrict" hoDD To bNoCascadeDeleteStrict
2184
          Get PropertyBooleanEval of oProgram "Cascade_Delete_State" hoDD To bCascadeDelete
2185
          
2186
          Move iMainFile           To Table.iNr
2187
          Move sTableName          To Table.sName
2188
          Move bShouldSave         To Table.bShouldSave
2189
          Move bTableChanged       To Table.bChangedState
2190
          Move bInUse              To Table.bInUse
2191
          Move bAutoFill           To Table.bAutoFill
2192
          Move bFillFromFirst      To Table.bFillFromFirst
2193
          Move bProtectKey         To Table.bProtectKey
2194
          Move bReadOnly           To Table.bReadOnly
2195
          Move bNoDelete           To Table.bNoDelete
2196
          Move bNoRelate           To Table.bNoRelate
2197
          Move bParentChanged      To Table.bParentChanged
2198
          Move bInheritConstraints To Table.bInheritConstraints
2199
          Move bUseDDRelates       To Table.bUseDDRelates
2200
          Move bNoCascadeDeleteStrict To Table.bNoCascadeDeleteStrict
2201
          Move bCascadeDelete      To Table.bCascadeDelete
2202
          Move iOrdering           To Table.iOrdering
2203
          
2204
          Get ForeignFieldOptions hoDD To Foreign
2205
          Get EnumerateColumns    hoDD sTableName To Columns
2206
          Get EnumerateParents    hoDD To Servers
2207
          Get EnumerateChilds     hoDD To Clients
2208
          
2209
          Move Foreign To Table.Foreign
2210
          Move Columns To Table.Columns
2211
          Move Servers To Table.Servers
2212
          Move Clients To Table.Clients
2213
          
2214
          Set pTable To Table
2215
          
2216
          Send UpdateCurrentTab Of oTable_TD
2217
        End_Procedure
2218
     End_Object
2219
     
2220
     Object oObjectDetailsEdit is a Edit
2221
        Set Location To 53 3
2222
        Set Size To 144 263
2223
        Set Read_Only_State to True
2224
        Set peAnchors To anAll
2225

    
2226
        Procedure Add_Line String sText
2227
          String  sValue
2228

    
2229
          Send Append_Text (sText + CS_CRLF)
2230
        End_Procedure // Add_Row
2231
        
2232
        Procedure DisplayDeoDetails Handle hoDD
2233
          Integer iFile
2234
          Integer iField
2235
          Integer iMainFile
2236
          Integer iValue
2237
          Handle  hoTarget
2238
          Handle  hoFileDD
2239
          Handle  hoMainDD
2240
          String  sFile
2241
          String  sField
2242
          String  sValue
2243
          String  sLine
2244
          
2245
          Get phoTarget To hoTarget
2246
          Get PropertyHandleEval of oProgram "Main_DD" hoTarget to hoMainDD
2247
          If (hoMainDD) Begin
2248
 
2249
            Get ShortName Of oProgram hoMainDD To sValue
2250
            Move ("Main DD : "+sValue) To sLine
2251
            Send Add_Line sLine
2252
          End
2253
          
2254
          Get PropertyIntegerEval of oProgram "Main_File" hoDD to iMainFile
2255
          
2256
          Get PropertyStringEval of oProgram "Label" hoTarget to sValue
2257
          If (sValue<>"0") Begin
2258
            Move ("Label : "+trim(sValue)) to sLine
2259
            Send Add_Line sLine
2260
          End
2261
          Get PropertyIntegerEval of oProgram "Label_Col_Offset" hoTarget to iValue
2262
          If (iValue<>0) Begin
2263
            Move ("Label_Col_Offset : "+trim(iValue)) To sLine
2264
            Send Add_Line sLine
2265
          End
2266
          Get PropertyIntegerEval of oProgram "Label_Row_Offset" hoTarget To iValue
2267
          If (iValue<>0) Begin
2268
            Move ("Label_Row_Offset : "+trim(iValue)) To sLine
2269
            Send Add_Line sLine
2270
          End
2271
          Get PropertyIntegerEval of oProgram "Label_Justification_Mode" hoTarget To iValue
2272
          If (iValue<>jmode_left) Begin
2273
            Get JustificationModeToString iValue To sValue
2274
            Move ("Label_Justification_Mode : "+sValue) To sLine
2275
            Send Add_Line sLine
2276
          End
2277
          
2278

    
2279
          Get ShortName Of oProgram hoDD To sValue
2280
          Move ("Server : "+sValue) To sLine
2281
          Send Add_Line sLine
2282
          
2283
          Get PropertyIntegerEval of oProgram "Data_File" hoTarget To iFile
2284
          If (iFile<>0) Begin
2285
            Get PropertyIntegerEval of oProgram "Data_Field" hoTarget to iField
2286
            Move ("File/Field : "+trim(iFile)+","+trim(iField)) To sLine
2287
            Send Add_line sLine
2288
            
2289
            Get TableName hoDD iFile To sFile
2290
            Move ("File : "+sFile) To sLine
2291
            Send Add_line sLine
2292
            
2293
            If (iMainFile<>0 and iMainFile<>iFile) Begin
2294
              Get StringEval of oProgram ("Data_Set("+trim(hoDD)+","+trim(iFile)+")") To hoFileDD
2295
            End
2296
            Else Begin
2297
              Move hoDD To hoFileDD
2298
            End
2299
            Get StringEval of oProgram ("Field_Label_Tag("+trim(hoFileDD)+","+trim(iField)+")") To sValue
2300
            Move sValue To sField
2301
            Move ("Field : "+sValue) To sLine
2302
            Send Add_line sLine
2303
            
2304
            Get StringEval of oProgram ("File_Field_Current_Value("+trim(hoDD)+","+trim(iFile)+","+trim(iField)+")") To sValue
2305
            Move ("DD Value : "+sValue) To sLine
2306
            Send Add_line sLine
2307
            
2308
            Get StringEval of oProgram (trim(sFile)+"."+trim(sField)) To sValue
2309
            Move ("Record Value : "+sValue) To sLine
2310
            Send Add_line sLine
2311
            
2312
            Get StringEval of oProgram ("File_Field_Changed_State("+trim(hoDD)+","+trim(iFile)+","+trim(iField)+")") To sValue
2313
            Get BooleanToString sValue To sValue
2314
            Move ("DD Changed_State : "+sValue) To sLine
2315
            Send Add_line sLine
2316
          End
2317
        End_Procedure
2318
        
2319
        
2320
        Procedure DisplayViewDetails
2321
          Handle  hoDialog
2322
          Boolean bState
2323
          String  sValue
2324
          String  sLine
2325
          Integer eBorderStyle
2326
          Integer ciMaxSize
2327
          Integer ciMinSize
2328
          
2329
          Get phoTarget To hoDialog
2330
          Send Add_Line "dbView Object"
2331
          Get PropertyIntegerEval of oProgram "piMinSize" hoDialog To ciMinSize
2332
          If (ciMinSize<>0) Begin
2333
            Get ComplexToString ciMinSize To sValue
2334
            Move ("piMinSize : "+sValue) To sLine
2335
            Send Add_Line sLine
2336
          End
2337
          Get PropertyIntegerEval of oProgram "piMaxSize" hoDialog To ciMaxSize
2338
          If (ciMaxSize<>0) Begin
2339
            Get ComplexToString ciMaxSize To sValue
2340
            Move ("piMaxSize : "+sValue) To sLine
2341
            Send Add_Line sLine
2342
          End
2343
          Get PropertyIntegerEval of oProgram "Border_Style" hoDialog To eBorderStyle
2344
          If (eBorderStyle<>Border_Dialog) Begin
2345
            Get BorderStyleToString eBorderStyle To sValue
2346
            Move ("Border_Style : "+sValue) To sLine
2347
            Send Add_Line sLine
2348
          End
2349
          Get PropertyBooleanEval of oProgram "Minimize_Icon" hoDialog to bState
2350
          If (bState=false) Begin
2351
            Move ("Minimize_Icon : false") To sLine
2352
            Send Add_Line sLine
2353
          End
2354
          
2355
        End_Procedure
2356
        
2357
        Procedure DisplayNonDeoDetails
2358
          Integer iValue
2359
          Integer iCount
2360
          Integer iItem
2361
          Integer iDisplayed
2362
          Handle  hoTarget
2363
          String  sValue
2364
          String  sLine
2365
          
2366
          Get phoTarget to hoTarget
2367
          
2368
          Get PropertyStringEval of oProgram "Label" hoTarget to sValue
2369
          If (sValue<>"0") Begin
2370
            Move ("Label : "+trim(sValue)) to sLine
2371
            Send Add_Line sLine
2372
          End
2373
          Get PropertyIntegerEval of oProgram "Label_Col_Offset" hoTarget to iValue
2374
          If (iValue<>0) Begin
2375
            Move ("Label_Col_Offset : "+trim(iValue)) to sLine
2376
            Send Add_Line sLine
2377
          End
2378
          Get PropertyIntegerEval of oProgram "Label_Row_Offset" hoTarget to iValue
2379
          If (iValue<>0) Begin
2380
            Move ("Label_Row_Offset : "+trim(iValue)) to sLine
2381
            Send Add_Line sLine
2382
          End
2383
          Get PropertyIntegerEval of oProgram "Label_Justification_Mode" hoTarget to iValue
2384
          If (iValue<>jmode_left) Begin
2385
            Get JustificationModeToString iValue to sValue
2386
            Move ("Label_Justification_Mode : "+sValue) to sLine
2387
            Send Add_Line sLine
2388
          End
2389
          Get PropertyIntegerEval of oProgram "Item_Count" hoTarget to iCount
2390
          If (iCount>0) Begin
2391
            Move ("Item_Count : "+trim(iCount)) to sLine
2392
            Send Add_Line sLine
2393
            Move 0 to iDisplayed
2394
            For iItem from 0 to (iCount-1)
2395
              Get StringEval of oProgram ("Value("+trim(hoTarget)+","+Trim(iItem)+")") to sValue
2396
              If (sValue<>"") Begin
2397
                Move ("item "+Trim(iItem)+" : "+trim(sValue)) to sLine
2398
                Send Add_Line sLine
2399
                Increment iDisplayed
2400
                If (iCount>30 and iDisplayed=30) Begin
2401
                  Send Add_Line "... more" // limit over 30 data points on this to keep things fast
2402
                  Move iCount to iItem
2403
                End
2404
              End
2405
            Loop
2406
          End
2407
        End_Procedure
2408
        
2409
        Procedure DisplayObjectDetails
2410
          Handle  hoTarget
2411
          Handle  hWnd
2412
          Handle  hChildWnd
2413
          Integer ciSize
2414
          Integer ciLocation
2415
          Integer eWindowsClass
2416
          Integer eAnchors
2417
          Boolean bIsCreated
2418
          String  sValue
2419
          String  sLine
2420
          
2421
          Send Delete_Data
2422
          
2423
          Get phoTarget To hoTarget
2424
          
2425
          Get xBitmapIDForObj of oProgram hoTarget To eWindowsClass
2426
          Get PropertyIntegerEval of oProgram "Size" hoTarget To ciSize
2427
          If (ciSize<>0) begin
2428
            Get ComplexToString ciSize To sValue
2429
            Move ("Size : "+sValue) To sLine
2430
            Send Add_Line sLine
2431
          End
2432

    
2433
          Get PropertyIntegerEval of oProgram "Location" hoTarget To ciLocation
2434
          If (ciLocation<>0) Begin
2435
            Get ComplexToString ciLocation To sValue
2436
            Move ("Location : "+sValue) To sLine
2437
            Send Add_Line sLine
2438
          End
2439

    
2440
          Get PropertyIntegerEval of oProgram "peAnchors" hoTarget To eAnchors
2441
          If (eAnchors<>anNone) Begin
2442
            Get AnchorsToString eAnchors To sValue
2443
            Move ("peAnchors : "+sValue) To sLine
2444
            Send Add_Line sLine
2445
          End
2446
          
2447
          Move 0 To hWnd
2448
          Get PropertyIntegerEval of oProgram "Window_Handle" hoTarget To sValue
2449
          If (sValue<>0) Begin
2450
            Move sValue To hWnd
2451
            Move ("Window Handle : "+sValue+" ($"+IntToHex(sValue)+")") To sLine
2452
            Send Add_Line sLine
2453
          End
2454
          
2455
          
2456
          If (eWindowsClass=bmpPDSActiveX) Begin
2457
            Get ProgID of oProgram hoTarget To sValue
2458
            Move ("ProgID : "+sValue) To sLine
2459
            Send Add_Line sLine
2460
            If (sValue<>"") Begin
2461
              Get ActivexName of oProgram hoTarget to sValue
2462
              Move ("Control Name : "+sValue) To sLine
2463
              Send Add_Line sLine
2464
            End
2465
            Get PropertyBooleanEval Of oProgram "IsComObjectCreated" hoTarget To bIsCreated
2466
            Get BooleanToString bIsCreated To sValue
2467
            Move ("IsComObjectCreated : "+sValue) To sLine
2468
            Send Add_Line sLine
2469
            if (bIsCreated) Begin
2470
              // Below doesn't  work, not sure why, get "External function not defined error"
2471
              //Get PropertyVariantEval of oProgram "pvComObject" hoTarget To sValue
2472
              //If (sValue<>0) Begin
2473
              //  Move ("pvComObject : "+sValue+" ($"+IntToHex(sValue)+")") To sLine
2474
              //  Send Add_Line sLine
2475
              //End
2476
    
2477
              If (hWnd<>0) Begin
2478
                Get FindFirstChildWindowHandle hWnd To hChildWnd
2479
                while (hChildWnd<>0)
2480
                  Get WindowsClassnameForWindowsHandle hChildWnd To sValue
2481
                  Move ("ActiveX Control : "+sValue+" ($"+IntToHex(hChildWnd)+")") To sLine
2482
                  Send Add_Line sLine
2483
                  Get FindNextChildWindowHandle hWnd hChildWnd To hChildWnd
2484
                loop
2485
              End
2486
              
2487
              Get PropertyIntegerEval of oProgram "PHDISPATCHDRIVER" hoTarget To sValue
2488
              If (sValue<>0) Begin
2489
                Move ("phDispatchDriver : "+sValue+" ($"+IntToHex(sValue)+")") To sLine
2490
                Send Add_Line sLine
2491
              End
2492
            End
2493
            
2494
          End
2495
          
2496
        End_Procedure
2497
     End_Object
2498
   End_Object // oDetailsGroup
2499

    
2500
End_Object // oObjectInspectorPanel
2501

    
2502

    
2503
Procedure StartObjectInspector
2504
  Boolean bStarted
2505
  Boolean bPaused
2506
  
2507
  Get HasProgramStarted To bStarted
2508
  If (bStarted) Begin
2509
    Get HasProgramPaused To bPaused   // Automatically pause the program if not already
2510
    If (bPaused=false) Begin          // paused as otherwise the object inspector can't show much
2511
      Send doDebugPause               // of anything.
2512
    End
2513
    Send ActivateObjectInspectorPanel To oObjectInspectorPanel
2514
  End
2515
  Else Begin
2516
    Send Info_Box "The object inspector only works when debugging a program.\nIt appears that we are not doing that now."
2517
  End
2518
End_Procedure // StartObjectInspector
2519

    
2520

    
2521

    
2522

    
2523
On_Key Key_Ctrl+Key_L Send StartObjectInspector