Project

General

Profile

Statistics
| Branch: | Revision:

root / src / tkenv / fieldspage.tcl @ 3e29b8a0

History | View | Annotate | Download (21.7 KB)

1
#=================================================================
2
#  FIELDSPAGE.TCL - part of
3
#
4
#                     OMNeT++/OMNEST
5
#            Discrete System Simulation in C++
6
#
7
#=================================================================
8

    
9
#----------------------------------------------------------------#
10
#  Copyright (C) 1992-2008 Andras Varga
11
#
12
#  This file is distributed WITHOUT ANY WARRANTY. See the file
13
#  `license' for details on this and other legal matters.
14
#----------------------------------------------------------------#
15

    
16

    
17
#
18
# Creates a Fields page for a tabbed inspector window.
19
#
20
proc inspector_createfields2page {w} {
21
    global treeroots
22
    global B2 B3
23
    set nb $w.nb
24
    notebook_addpage $nb fields2 {Fields}
25

    
26
    # create treeview with scrollbars
27
    scrollbar $nb.fields2.vsb -command "$nb.fields2.tree yview"
28
    scrollbar $nb.fields2.hsb -command "$nb.fields2.tree xview" -orient horiz
29
    canvas $nb.fields2.tree -bg white -relief sunken -bd 2
30
    $nb.fields2.tree config -yscrollcommand "$nb.fields2.vsb set" -xscrollcommand "$nb.fields2.hsb set"
31

    
32
    grid $nb.fields2.tree $nb.fields2.vsb -sticky news
33
    grid $nb.fields2.hsb  x               -sticky news
34
    grid rowconfig $nb.fields2 0 -weight 1
35
    grid columnconfig $nb.fields2 0 -weight 1
36

    
37
    set tree $nb.fields2.tree
38
    if {![regexp {\.(ptr.*)-([0-9]+)} $w match object type]} {
39
        error "window name $w doesn't look like an inspector window"
40
    }
41
    set treeroots($tree) $object
42

    
43
    Tree:init $tree getFieldNodeInfo
44

    
45
    bind $tree <Double-1> {
46
        focus %W
47
        set key [Tree:nodeat %W %x %y]
48
        getFieldNodeInfo_inspect %W $key
49
    }
50

    
51
    bind $tree <Return> {
52
        set key [Tree:getselection %W]
53
        getFieldNodeInfo_inspect %W $key
54
    }
55

    
56
    bind $tree <Button-$B3> {
57
        focus %W
58
        set key [Tree:nodeat %W %x %y]
59
        if {$key!=""} {
60
            Tree:setselection %W $key
61
            getFieldNodeInfo_popup %W $key %X %Y
62
        }
63
    }
64

    
65
    Tree:open $tree "0-obj-$object"
66
}
67

    
68
proc refresh_fields2page {w} {
69
    set tree $w.nb.fields2.tree
70
    if ![winfo exist $tree] {return}
71

    
72
    Tree:build $tree
73
}
74

    
75
#
76
# Content provider for the inspector treeview.
77
#
78
# Possible keys:
79
#   <depth>-obj-<ptr>
80
#   <depth>-struct-<ptr>-<descptr>
81
#   <depth>-group-<ptr>-<descptr>-<groupid>
82
#   <depth>-field-<ptr>-<descptr>-<fieldid>
83
#   <depth>-findex-<ptr>-<descptr>-<fieldid>-<index>
84
#
85
# groupid is id of a field (ie a fieldid) which has the right group.
86
# We use that because the group name itself may contain space, hyphen
87
# and other unwanted characters.
88
#
89
# depth is the depth in the displayed tree (0 for root, 1 for its children, etc).
90
# It is needed to make multiple appearances of the same object unique. Without it,
91
# if a node appears under itself in the tree, that causes infinite recursion.
92
# (crash scenario without depth: open the object's "owner" field, then the object
93
# itself within its owner --> bang!).
94
#
95
proc getFieldNodeInfo {w op {key ""}} {
96
    global icons treeroots
97

    
98
    set keyargs [split $key "-"]
99
    set depth [lindex $keyargs 0]
100
    set keytype [lindex $keyargs 1]
101
    set obj [lindex $keyargs 2]
102
    set sd [lindex $keyargs 3]
103

    
104
    switch $op {
105

    
106
        text {
107
            if [opp_isnull $obj] {return "<object is NULL>"}
108
            if {$sd!="" && [opp_isnull $sd]} {return "<no descriptor for object>"}
109

    
110
            switch $keytype {
111
                obj {
112
                    set name [opp_getobjectfullname $obj]
113
                    set classname [opp_getobjectshorttypename $obj]
114
                    return "$name ($classname)"
115
                }
116
                struct {
117
                    set name [opp_classdescriptor name $obj $sd]
118
                    return $name
119
                }
120

    
121
                group {
122
                    set groupid [lindex $keyargs 4]
123
                    set groupname [opp_classdescriptor $obj $sd fieldproperty $groupid "group"]
124
                    return "\b$groupname\b"
125
                }
126

    
127
                field -
128
                findex {
129
                    set fieldid [lindex $keyargs 4]
130
                    set index [lindex $keyargs 5]
131
                    return [getFieldNodeInfo_getFieldText $obj $sd $fieldid $index]
132
                }
133

    
134
                default {
135
                    error "bad keytype '$keytype'"
136
                }
137
            }
138
        }
139

    
140
        needcheckbox {
141
            return 0
142
        }
143

    
144
        options {
145
            return ""
146
        }
147

    
148
        icon {
149
            switch $keytype {
150
                obj {
151
                    return [get_icon_for_object $obj]
152
                }
153
                struct -
154
                group {
155
                    return ""
156
                }
157
                field -
158
                findex {
159
                    set fieldptr [getFieldNodeInfo_resolveObject $keyargs]
160
                    if [opp_isnull $fieldptr] {return ""}
161
                    return [get_icon_for_object $fieldptr]
162
                }
163
            }
164
        }
165

    
166
        tooltip {
167
            switch $keytype {
168
                obj -
169
                struct -
170
                group {
171
                    return ""
172
                }
173
                field -
174
                findex {
175
                    ## These tooltips are actually not very useful
176
                    # set fieldid [lindex $keyargs 4]
177
                    # set tooltip [opp_classdescriptor $obj $sd fieldproperty $fieldid "hint"]
178
                    # return $tooltip
179
                    return ""
180
                }
181
            }
182
        }
183

    
184
        haschildren {
185
            switch $keytype {
186
                group -
187
                root {
188
                    return 1  ;# sure has children
189
                }
190
                obj -
191
                struct -
192
                field -
193
                findex {
194
                    # XXX this can be improved performance-wise (this actually collects all children!)
195
                    set children [getFieldNodeInfo $w children $key]
196
                    return [expr [llength $children]!=0]
197
                }
198
            }
199
        }
200

    
201
        children {
202
            incr depth
203
            switch $keytype {
204
                obj -
205
                struct {
206
                    if {$obj==[opp_null]} {return ""}
207
                    if {$keytype=="obj"} {set sd [opp_getclassdescriptorfor $obj]}
208
                    if {$sd==[opp_null]} {return ""}
209

    
210
                    set children1 [getFieldNodeInfo_getFieldsInGroup $depth $obj $sd ""]
211
                    set children2 [getFieldNodeInfo_getGroupKeys $depth $obj $sd]
212
                    return [concat $children1 $children2]
213
                }
214

    
215
                group {
216
                    # return fields in the given group
217
                    set groupname [lindex $keyargs 4]
218
                    return [getFieldNodeInfo_getFieldsInGroup $depth $obj $sd $groupname]
219
                }
220

    
221
                field {
222
                    set fieldid [lindex $keyargs 4]
223
                    set isarray [opp_classdescriptor $obj $sd fieldisarray $fieldid]
224
                    if {$isarray} {
225
                        # expand array: enumerate all indices
226
                        return [getFieldNodeInfo_getElementsInArray $depth $obj $sd $fieldid]
227
                    }
228
                    set iscompound [opp_classdescriptor $obj $sd fieldiscompound $fieldid]
229
                    if {$iscompound} {
230
                        # return children on this class/struct
231
                        set ispoly [opp_classdescriptor $obj $sd fieldiscobject $fieldid]
232
                        set fieldptr [opp_classdescriptor $obj $sd fieldstructpointer $fieldid]
233
                        if [opp_isnull $fieldptr] {return ""}
234
                        if {$ispoly} {
235
                            return [getFieldNodeInfo $w children "$depth-obj-$fieldptr"]
236
                        } else {
237
                            set fielddesc [opp_classdescriptor $obj $sd fieldstructdesc $fieldid]
238
                            if {$fielddesc==""} {return ""}  ;# nothing known about it
239
                            set tmpkey "$depth-struct-$fieldptr-$fielddesc"
240
                            return [getFieldNodeInfo $w children $tmpkey]
241
                        }
242
                    }
243
                    return ""
244
                }
245

    
246
                findex {
247
                    set fieldid [lindex $keyargs 4]
248
                    set index [lindex $keyargs 5]
249
                    set iscompound [opp_classdescriptor $obj $sd fieldiscompound $fieldid]
250
                    if {$iscompound} {
251
                        # return children on this class/struct
252
                        set ispoly [opp_classdescriptor $obj $sd fieldiscobject $fieldid]
253
                        set fieldptr [opp_classdescriptor $obj $sd fieldstructpointer $fieldid $index]
254
                        if [opp_isnull $fieldptr] {return ""}
255
                        if {$ispoly} {
256
                            return [getFieldNodeInfo $w children "$depth-obj-$fieldptr"]
257
                        } else {
258
                            set fielddesc [opp_classdescriptor $obj $sd fieldstructdesc $fieldid]
259
                            if {$fielddesc==""} {return ""}  ;# nothing known about it
260
                            set tmpkey "$depth-struct-$fieldptr-$fielddesc"
261
                            return [getFieldNodeInfo $w children $tmpkey]
262
                        }
263
                    }
264
                    return ""
265
                }
266

    
267
                root {
268
                    return "0-obj-$obj"
269
                }
270

    
271
                default {
272
                    error "bad keytype '$keytype'"
273
                }
274
            }
275
        }
276

    
277
        root {
278
            # add an extra level to make the root object appear in the tree as well
279
            #return "0-obj-$treeroots($w)"
280
            return "0-root-$treeroots($w)"
281
        }
282
    }
283
}
284

    
285
#
286
# Helper proc for getFieldNodeInfo.
287
# Collects field groups, and converts them to keys.
288
#
289
proc getFieldNodeInfo_getGroupKeys {depth obj sd} {
290
    # collect list of groups
291
    set numfields [opp_classdescriptor $obj $sd fieldcount]
292
    for {set i 0} {$i<$numfields} {incr i} {
293
        set fieldgroup [opp_classdescriptor $obj $sd fieldproperty $i "group"]
294
        set groups($fieldgroup) $i
295
    }
296

    
297
    # convert them to keys
298
    set children {}
299
    foreach groupname [lsort [array names groups]] {
300
        if {$groupname!=""} {
301
            lappend children "$depth-group-$obj-$sd-$groups($groupname)"
302
        }
303
    }
304
    return $children
305
}
306

    
307

    
308
#
309
# Helper proc for getFieldNodeInfo.
310
# Return fields in the given group; groupname may be "" (meaning no group).
311
#
312
proc getFieldNodeInfo_getFieldsInGroup {depth obj sd groupid} {
313
    set children {}
314
    if {$groupid!=""} {
315
        set groupname [opp_classdescriptor $obj $sd fieldproperty $groupid "group"]
316
    } else {
317
        set groupname ""
318
    }
319
    set numfields [opp_classdescriptor $obj $sd fieldcount]
320
    for {set i 0} {$i<$numfields} {incr i} {
321
        if {$groupname==[opp_classdescriptor $obj $sd fieldproperty $i "group"]} {
322
            lappend children "$depth-field-$obj-$sd-$i"
323
        }
324
    }
325
    return $children
326
}
327

    
328
#
329
# Helper proc for getFieldNodeInfo.
330
# Expands array by enumerating all indices, and returns the list of corresponding keys.
331
#
332
proc getFieldNodeInfo_getElementsInArray {depth obj sd fieldid} {
333
    set children {}
334
    set n [opp_classdescriptor $obj $sd fieldarraysize $fieldid]
335
    for {set i 0} {$i<$n} {incr i} {
336
        lappend children "$depth-findex-$obj-$sd-$fieldid-$i"
337
    }
338
    return $children
339
}
340

    
341
#
342
# Helper proc for getFieldNodeInfo. Produces text for a field.
343
#
344
proc getFieldNodeInfo_getFieldText {obj sd fieldid index} {
345

    
346
    set typename [opp_classdescriptor $obj $sd fieldtypename $fieldid]
347
    set isarray [opp_classdescriptor $obj $sd fieldisarray $fieldid]
348
    set iscompound [opp_classdescriptor $obj $sd fieldiscompound $fieldid]
349
    set ispoly [opp_classdescriptor $obj $sd fieldiscobject $fieldid]
350
    set isobject [opp_classdescriptor $obj $sd fieldiscownedobject $fieldid]
351
    set iseditable [opp_classdescriptor $obj $sd fieldiseditable $fieldid]
352

    
353
    # field name can be overridden with @label property
354
    set name [opp_classdescriptor $obj $sd fieldproperty $fieldid "label"]
355
    if {$name==""} {set name [opp_classdescriptor $obj $sd fieldname $fieldid]}
356

    
357
    # if it's an unexpanded array, return "name[size]" immediately
358
    if {$isarray && $index==""} {
359
        set size [opp_classdescriptor $obj $sd fieldarraysize $fieldid]
360
        return "$name\[$size\] ($typename)"
361
    }
362

    
363
    # when showing array elements, omit name and just show "[index]" instead
364
    if {$index!=""} {
365
        set name "\[$index\]"
366
    }
367

    
368
    # we'll want to print the field type, except for expanded array elements
369
    # (no need to repeat it, as it's printed in the "name[size]" node already)
370
    if {$index==""} {
371
        set typenametext " ($typename)"
372
    } else {
373
        set typenametext ""
374
    }
375

    
376
    # "editable" flag
377
    if {$iseditable} {
378
        set typenametext " \[...\] $typenametext"
379
    }
380

    
381
    if {$iscompound} {
382
        # if it's an object, try to say something about it...
383
        if {$ispoly} {
384
            set fieldobj [opp_classdescriptor $obj $sd fieldstructpointer $fieldid $index]
385
            if [opp_isnull $fieldobj] {return "$name = \bNULL\b$typenametext"}
386
            if {!$isobject || [opp_getobjectowner $fieldobj]==$obj} {
387
                set fieldobjname [opp_getobjectfullname $fieldobj]
388
            } else {
389
                set fieldobjname [opp_getobjectfullpath $fieldobj]
390
            }
391
            set fieldobjname [opp_getobjectfullname $fieldobj]
392
            set fieldobjclassname [opp_getobjectshorttypename $fieldobj]
393
            set fieldobjinfo [opp_getobjectinfostring $fieldobj]
394
            if {$fieldobjinfo!=""} {
395
                set fieldobjinfotext ": $fieldobjinfo"
396
            } else {
397
                set fieldobjinfotext ""
398
            }
399
            return "$name = \b($fieldobjclassname) $fieldobjname$fieldobjinfotext\b$typenametext"
400
        } else {
401
            # a value can be generated via operator<<
402
            if [catch {set value [opp_classdescriptor $obj $sd fieldvalue $fieldid $index]} err] {set value "<!> Error: $err"}
403
            if {$value==""} {
404
                return "$name$typenametext"
405
            } else {
406
                return "$name = \b$value\b$typenametext"
407
            }
408
        }
409
    } else {
410
        # plain field, return "name = value" text
411
        if [catch {set value [opp_classdescriptor $obj $sd fieldvalue $fieldid $index]} err] {set value "<!> Error: $err"}
412
        set enumname [opp_classdescriptor $obj $sd fieldproperty $fieldid "enum"]
413
        if {$enumname!=""} {
414
            append typename " - enum $enumname"
415
            set symbolicname [opp_getnameforenum $enumname $value]
416
            set value "$symbolicname ($value)"
417
        }
418
        #if {$typename=="string"} {set value "\"$value\""}
419
        if {$typename=="string"} {set value "'$value'"}
420
        if {$value==""} {
421
            return "$name$typenametext"
422
        } else {
423
            return "$name = \b$value\b$typenametext"
424
        }
425
    }
426
}
427

    
428
#
429
# If the given key (in split form) identifies an object (cClassDescriptor
430
# isCObject), returns its pointer. Otherwise returns [opp_null].
431
#
432
#
433
proc getFieldNodeInfo_resolveObject {keyargs} {
434
    set depth [lindex $keyargs 0]
435
    set keytype [lindex $keyargs 1]
436

    
437
    if {$keytype=="field" || $keytype=="findex"} {
438
        set obj [lindex $keyargs 2]
439
        set sd [lindex $keyargs 3]
440
        set fieldid [lindex $keyargs 4]
441
        set index [lindex $keyargs 5]
442
        set isobject [opp_classdescriptor $obj $sd fieldiscownedobject $fieldid]
443
        set isarray [opp_classdescriptor $obj $sd fieldisarray $fieldid]
444

    
445
        if {$isobject && (!$isarray || $index!="")} {
446
            return [opp_classdescriptor $obj $sd fieldstructpointer $fieldid $index]
447
        }
448
    }
449
    return [opp_null]
450
}
451

    
452

    
453
#
454
# Invoked on hitting Enter or double-clicking in the tree, it opens
455
# an inspector for the given object. Or starts editing. Or at least
456
# opens/closes that tree branch.
457
#
458
proc getFieldNodeInfo_inspect {w key} {
459
    set keyargs [split $key "-"]
460
    set ptr [getFieldNodeInfo_resolveObject $keyargs]
461
    if [opp_isnotnull $ptr] {
462
        opp_inspect $ptr "(default)"
463
    } elseif [getFieldNodeInfo_iseditable $w $key] {
464
        getFieldNodeInfo_edit $w $key
465
    } else {
466
        Tree:toggle $w $key
467
    }
468
}
469

    
470
#
471
# Returns true if a tree node is editable (it's a field and its descriptor says editable)
472
#
473
proc getFieldNodeInfo_iseditable {w key} {
474
    set keyargs [split $key "-"]
475
    set keytype [lindex $keyargs 1]
476
    if {$keytype=="field" || $keytype=="findex"} {
477
        set obj [lindex $keyargs 2]
478
        set sd [lindex $keyargs 3]
479
        set fieldid [lindex $keyargs 4]
480
        return [opp_classdescriptor $obj $sd fieldiseditable $fieldid]
481
    }
482
    return 0
483
}
484

    
485
#
486
# Initiates in-place editing of a tree field
487
#
488
proc getFieldNodeInfo_edit {w key} {
489
    set id [lindex [$w find withtag "text-$key"] 1]
490
    if {$id!=""} {
491
        editCanvasLabel $w $id [list getFieldNodeInfo_setvalue $w $key]
492
    }
493
}
494

    
495
#
496
# Sets the value of a tree field after in-place editing
497
#
498
proc getFieldNodeInfo_setvalue {w key value} {
499
    set keyargs [split $key "-"]
500
    set keytype [lindex $keyargs 1]
501
    if {$keytype=="field" || $keytype=="findex"} {
502
        set obj [lindex $keyargs 2]
503
        set sd [lindex $keyargs 3]
504
        set fieldid [lindex $keyargs 4]
505
        set index [lindex $keyargs 5]
506
        #regexp {^"(.*)"$} $value match value  ;# strip quotes
507
        if [catch {opp_classdescriptor $obj $sd fieldsetvalue $fieldid $index $value} e] {
508
            Tree:build $w
509
            tk_messageBox -parent [winfo toplevel $w] -title "Tkenv" -icon warning -type ok -message "Cannot set field value -- syntax error?"
510
            return
511
        }
512
    }
513
    Tree:build $w
514
}
515

    
516
proc getFieldNodeInfo_popup {w key x y} {
517
    catch {destroy .popup}
518
    menu .popup -tearoff 0
519

    
520
    .popup add command -label "Copy" -command [list getFieldNodeInfo_copy $w $key]
521

    
522
    .popup add separator
523

    
524
    set keyargs [split $key "-"]
525
    set ptr [getFieldNodeInfo_resolveObject $keyargs]
526
    if [opp_isnotnull $ptr] {
527
        foreach i [opp_supported_insp_types $ptr] {
528
           .popup add command -label "Inspect $i" -command "opp_inspect $ptr \"$i\""
529
        }
530
    } else {
531
        if [getFieldNodeInfo_iseditable $w $key] {
532
            .popup add command -label "Edit..." -command [list getFieldNodeInfo_edit $w $key]
533
        } else {
534
            .popup add command -label "Edit..." -state disabled
535
        }
536
    }
537

    
538
    tk_popup .popup $x $y
539
}
540

    
541
proc getFieldNodeInfo_copy {w key} {
542
    set txt [getFieldNodeInfo $w text $key]
543
    regsub -all "\b" $txt "" txt
544

    
545
    # note: next two lines are from tk_textCopy Tk proc.
546
    clipboard clear -displayof $w
547
    clipboard append -displayof $w $txt
548
}
549

    
550

    
551
##
552
## This alternative version of the Fields table uses a BLT treeview widget.
553
##
554
#proc inspector_createfields2pageX {w} {
555
#    global treeroots
556
#    set nb $w.nb
557
#    notebook_addpage $nb fields2 {Fields}
558
#
559
#    multicolumnlistbox $nb.fields2.list {
560
#       {value  Value   200}
561
#       {type   Type    80}
562
#       {on     Declared-on}
563
#    } -width 400 -yscrollcommand "$nb.fields2.vsb set" -xscrollcommand "$nb.fields2.hsb set"
564
#    scrollbar $nb.fields2.hsb  -command "$nb.fields2.list xview" -orient horiz
565
#    scrollbar $nb.fields2.vsb  -command "$nb.fields2.list yview"
566
#    grid $nb.fields2.list $nb.fields2.vsb -sticky news
567
#    grid $nb.fields2.hsb  x           -sticky news
568
#    grid rowconfig    $nb.fields2 0 -weight 1 -minsize 0
569
#    grid columnconfig $nb.fields2 0 -weight 1 -minsize 0
570
#
571
#    set tree $nb.fields2.list
572
#
573
#    $tree config -flat no -hideroot yes
574
#    $tree column configure treeView -text "Name" -hide no -width 160 -state disabled
575
#
576
#    #set root [$tree insert end ROOT -data {value 42 type struct}]
577
#    #set one  [$tree insert end {ROOT ONE} -data {value 42 type short}]
578
#    #set two  [$tree insert end {ROOT TWO} -data {value 42 type double}]
579
#
580
#    if {![regexp {\.(ptr.*)-([0-9]+)} $w match object type]} {
581
#        error "window name $w doesn't look like an inspector window"
582
#    }
583
#
584
#    fillTreeview $tree $object   ;# should be called from C++ on updates
585
#}
586
#
587
#proc fillTreeview {tree obj} {
588
#    set desc [opp_getclassdescriptor $obj]
589
#    set key "fld-$obj-$desc---"
590
#
591
#    _doFillTreeview $tree {} $key
592
#}
593
#
594
#proc _doFillTreeview {tree path key} {
595
#    global icons
596
#
597
#    set data [_getFieldDataFor $key]
598
#    set name [lindex $data 1]
599
#    set newpath [concat $path [list $name]]
600
#    #set icon $icons(1pixtransp)
601
#    #set icon $icons(cogwheel_vs)
602
#    set icon $icons(node_xs)
603
#    $tree insert end $newpath -data $data -icons [list $icon $icon] -activeicons [list $icon $icon]
604
#
605
#    foreach child [getFieldNodeInfo $tree children $key] {
606
#        _doFillTreeview $tree $newpath $child
607
#    }
608
#}
609
#
610
#proc _getFieldDataFor {key} {
611
#    # key: objectptr-descriptorptr-fieldid-index
612
#    set obj ""
613
#    set sd ""
614
#    set fieldid ""
615
#    set index ""
616
#    regexp {^fld-(ptr.*)-(ptr.*)-([^-]*)-([^-]*)$} $key dummy obj sd fieldid index
617
#    #puts "DBG --> $obj -- $sd -- field=$fieldid -- index=$index"
618
#
619
#    if {$obj==[opp_null]} {return "<object is NULL>"}
620
#    if {$sd==[opp_null]} {return "<no descriptor for object>"}
621
#
622
#    set declname [opp_classdescriptor $obj $sd name]
623
#
624
#    if {$fieldid==""} {
625
#        return [list treeView $declname value "" type "" on ""]
626
#    }
627
#
628
#    set typename [opp_classdescriptor $obj $sd fieldtypename $fieldid]
629
#    set isarray [opp_classdescriptor $obj $sd fieldisarray $fieldid]
630
#    set name [opp_classdescriptor $obj $sd fieldname $fieldid]
631
#    if {$index!=""} {
632
#        append name "\[$index\]"
633
#    } elseif {$isarray} {
634
#        set size [opp_classdescriptor $obj $sd fieldarraysize $fieldid]
635
#        append name "\[$size\]"
636
#    }
637
#    set value [opp_classdescriptor $obj $sd fieldvalue $fieldid $index]
638
#    regsub -all "\n" $value "; " value
639
#    regsub -all "   +" $value "  " value
640
#    if {$typename=="string"} {set value "\"$value\""}
641
#
642
#    return [list treeView $name value $value type $typename on $declname]
643
#}
644