NewInspectorPanelView.st
author ca
Fri, 12 Jul 2002 09:09:43 +0200
changeset 1573 bf9c5ca8e48a
parent 1213 6cf7a4c2dfce
child 2171 9ad4c3d354bb
permissions -rw-r--r--
reuse functionality of changed ViewScroller
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
809
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     1
"
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     2
 COPYRIGHT (c) 1997 by eXept Software AG
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     3
              All Rights Reserved
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     4
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     5
 This software is furnished under a license and may be used
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     6
 only in accordance with the terms of that license and with the
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     8
 be provided or otherwise made available to, or used by, any
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
     9
 other person.  No title to or ownership of the software is
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    10
 hereby transferred.
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    11
"
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    12
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    13
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    14
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    15
"{ NameSpace: NewInspector }"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    16
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
    17
SimpleView subclass:#NewInspectorPanelView
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    18
	instanceVariableNames:'frames labelViews listViews scrollBar maxDepth leftHistory
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    19
		rightHistory hzpView actionBlock valueChangedAction'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    20
	classVariableNames:''
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    21
	poolDictionaries:''
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
    22
	category:'Interface-NewInspector'
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    23
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    24
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
    25
!NewInspectorPanelView class methodsFor:'documentation'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    26
809
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    27
copyright
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    28
"
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    29
 COPYRIGHT (c) 1997 by eXept Software AG
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    30
              All Rights Reserved
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    31
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    32
 This software is furnished under a license and may be used
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    33
 only in accordance with the terms of that license and with the
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    35
 be provided or otherwise made available to, or used by, any
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    36
 other person.  No title to or ownership of the software is
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    37
 hereby transferred.
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    38
"
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    39
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    40
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    41
!
6f127dd5e578 added copyright & documentation
Claus Gittinger <cg@exept.de>
parents: 327
diff changeset
    42
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    43
examples
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    44
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    45
    example 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    46
    =========
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    47
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    48
                                                                        [exBegin]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    49
    |top slv|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    50
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    51
    top := StandardSystemView new extent:600@400.
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
    52
    slv := NewInspector::NewInspectorPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    53
    slv inspect:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    54
    slv action:[:el|Transcript showCR:el].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    55
    top open.
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    56
                                                                        [exEnd]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    57
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    58
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    59
    example 2
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    60
    =========
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    61
                                                                        [exBegin]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    62
    |top slv edt a vvp|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    63
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    64
    a := Array new:5.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    65
    a at:4 put:(Array new:6).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    66
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    67
    top := StandardSystemView new extent:600@400.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    68
    vvp := VariableVerticalPanel origin:0.0@0.0  corner:1.0@1.0 in:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    69
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
    70
    slv := NewInspector::NewInspectorPanelView origin:0.0@0.0 corner:1.0@0.5 in:vvp.
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    71
    edt := Workspace origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:vvp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    72
    edt acceptAction:[:theText|slv accept:theText notifying:edt].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    73
    edt   doItAction:[:theCode|slv doIt:theCode   notifying:edt].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    74
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    75
    slv action:[:el| Transcript showCR:(el printString)].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    76
    slv inspect:a.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    77
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    78
    top open.
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    79
                                                                        [exEnd]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    80
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    81
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    82
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
    83
!NewInspectorPanelView class methodsFor:'constants'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    84
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    85
minDepth
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    86
    "returns the minimum of views assigned to a panel
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    87
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    88
    ^ 4
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    89
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    90
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
    91
!NewInspectorPanelView methodsFor:'accessing'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    92
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    93
depth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    94
    "returns number of listViews
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    95
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    96
  ^ listViews size
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    97
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    98
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    99
depth:aDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   100
    "change the number of existing listViews
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   101
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   102
    |sz min|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   103
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   104
    min := self class minDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   105
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   106
    aDepth > min ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   107
        sz := aDepth min:maxDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   108
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   109
        sz < listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   110
            sz := listViews size
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   111
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   112
    ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   113
        sz := min
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   114
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   115
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   116
    listViews size == sz ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   117
        sz == aDepth ifFalse:[self moveContentsLeft:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   118
    ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   119
        [self createViewWithoutRedraw. listViews size ~~ sz] whileTrue.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   120
        self computeExtentOfFrames.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   121
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   122
        (self topView shown) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   123
            hzpView sizeChanged:nil.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   124
            hzpView realizeAllSubViews.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   125
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   126
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   127
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   128
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   129
maxDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   130
    ^ maxDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   131
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   132
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   133
maxDepth:aNumber
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   134
    "change max depth for instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   135
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   136
    aNumber > listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   137
        aNumber >= (self class minDepth) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   138
            maxDepth := aNumber.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   139
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   140
            maxDepth < listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   141
                self depth:maxDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   142
            ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   143
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   144
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   145
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   146
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   147
!NewInspectorPanelView methodsFor:'accessing actions'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   148
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   149
action:aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   150
    "set the single click action block.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   151
     If non-nil, that one is evaluated on single click, passing the
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   152
     selected instance as argument
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   153
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   154
    actionBlock := aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   155
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   156
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   157
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   158
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   159
valueChangedAction:aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   160
    "evaluated if an instnace changed its value; passing
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   161
     the instance as argument
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   162
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   163
    valueChangedAction := aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   164
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   165
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   166
!NewInspectorPanelView methodsFor:'accessing selections'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   167
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   168
inspectedObject
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   169
    "returns the current inspected object
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   170
    "
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   171
    ^ self findLastValidListWithSelection inspectedObject
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   172
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   173
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   174
selectedInstanceVar
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   175
    "returns the current selected instance var
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   176
    "
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   177
    ^ self findLastValidListWithSelection selectedInstanceVar
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   178
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   179
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   180
!NewInspectorPanelView methodsFor:'actions'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   181
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   182
accept:aText notifying:aView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   183
    "evaluating aText on the last selected instance var. on success the views
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   184
     are updated.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   185
    "
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   186
    self doItOrAccept:[:aList|aList accept:aText notifying:aView]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   187
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   188
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   189
doIt:aCode notifying:aView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   190
    "evaluating aCode on the selected instance var; on success the views
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   191
     are updated.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   192
    "
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   193
    ^ self doItOrAccept:[:aList|aList doIt:aCode notifying:aView]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   194
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   195
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   196
inspect:anObject
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   197
    "change the inspected object and all views
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   198
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   199
    |view|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   200
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   201
    view := listViews first.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   202
    leftHistory  removeAll.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   203
    rightHistory removeAll.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   204
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   205
    view inspect:anObject.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   206
    listViews from:2 do:[:v|v inspect:nil].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   207
    self update.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   208
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   209
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   210
!NewInspectorPanelView methodsFor:'event handling'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   211
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   212
handlesKeyPress:key inView:someView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   213
    "all keys are handled by this instance itself
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   214
    "
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   215
    ^ true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   216
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   217
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   218
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   219
keyPress:key x:x y:y view:someView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   220
    "handle some special keys
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   221
    "
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   222
    key == #CursorLeft  ifTrue:[^ self moveContentsRight:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   223
    key == #CursorRight ifTrue:[^ self moveContentsLeft:1 ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   224
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   225
    someView keyPress:key x:x y:y.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   226
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   227
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   228
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   229
singleClickAt:anIndex
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   230
    "the view at an index changed its selection caused by a single click
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   231
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   232
    |view start sivar|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   233
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   234
    rightHistory removeAll.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   235
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   236
    view  := listViews at:anIndex.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   237
    start := anIndex + 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   238
    sivar := view selectedInstanceVar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   239
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   240
    start > listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   241
        start >= maxDepth ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   242
            self moveContentsLeft:1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   243
          ^ actionBlock value:sivar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   244
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   245
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   246
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   247
    (view selectedInstanceType) == #directory ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   248
        (listViews at:start) setSelection:nil.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   249
        (listViews at:start) inspect:sivar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   250
        
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   251
        start := start + 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   252
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   253
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   254
    listViews from:start do:[:v|v inspect:nil].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   255
    self update.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   256
    actionBlock value:sivar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   257
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   258
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   259
!NewInspectorPanelView methodsFor:'initializing'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   260
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   261
initialize
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   262
    "initialize instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   263
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   264
    super initialize.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   265
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   266
    frames       := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   267
    listViews    := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   268
    labelViews   := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   269
    leftHistory  := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   270
    rightHistory := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   271
    maxDepth     := self class minDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   272
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   273
    actionBlock := [:el| ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   274
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   275
    hzpView    := VariableHorizontalPanel origin:0.0@0.0 corner:1.0@1.0 in:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   276
    scrollBar  := HorizontalScrollBar origin:0.0@1.0 corner:1.0@1.0 in:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   277
    scrollBar asynchronousOperation.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   278
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   279
    hzpView bottomInset:(scrollBar preferredExtent y).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   280
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   281
    scrollBar topInset:(scrollBar preferredExtent y) negated.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   282
    scrollBar thumbHeight:100.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   283
    scrollBar scrollAction:[:percent | self scrollTo:percent].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   284
    scrollBar scrollRightAction:[self moveContentsLeft:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   285
    scrollBar scrollLeftAction:[self moveContentsRight:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   286
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   287
    self depth:maxDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   288
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   289
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   290
!NewInspectorPanelView methodsFor:'menu - labels & actions'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   291
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   292
browse:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   293
    self classAtLabel:anIndex do:[:cls| cls browserClass openInClass:cls selector:nil ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   294
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   295
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   296
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   297
browseClassHierarchy:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   298
    self classAtLabel:anIndex do:[:cls| cls browserClass browseClassHierarchy:cls ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   299
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   300
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   301
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   302
browseFullClassProtocol:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   303
    self classAtLabel:anIndex do:[:cls| cls browserClass browseFullClassProtocol:cls ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   304
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   305
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   306
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   307
classAtLabel:anIndex do:anAction
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   308
    "evaluate action on class assigned to label
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   309
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   310
    |cls|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   311
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   312
    anIndex <= labelViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   313
        (cls := Smalltalk classNamed:((labelViews at:anIndex) label)) notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   314
            anAction value:cls
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   315
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   316
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   317
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   318
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   319
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   320
labelMenu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   321
    "popup menu required by any label. Delegate the request to the corresponding label
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   322
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   323
    |sqNr view|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   324
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   325
    view := (WindowGroup lastEventQuerySignal raise) view.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   326
    sqNr := labelViews findFirst:[:v| v == view].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   327
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   328
    sqNr ~~ 0 ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   329
        view := labelViews at:sqNr.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   330
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   331
        view label notEmpty ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   332
            ^ self labelMenu:sqNr
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   333
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   334
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   335
    ^ nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   336
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   337
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   338
labelMenu:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   339
    "popup menu required for a label identified by its sequence number
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   340
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   341
    |menu|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   342
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   343
    menu := PopUpMenu labels:#(
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   344
                              'browse'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   345
                              'browse class hierarchy'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   346
                              'browse full class protocol'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   347
                              )
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   348
                   selectors:#( 
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   349
                              browse:
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   350
                              browseClassHierarchy:
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   351
                              browseFullClassProtocol:
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   352
                              )
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   353
                    receiver:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   354
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   355
   menu args:(Array new:(menu labels size) withAll:anIndex).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   356
 ^ menu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   357
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   358
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   359
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   360
!NewInspectorPanelView methodsFor:'menu - views & actions'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   361
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   362
doTrace:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   363
    "place a trace on messages sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   364
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   365
    |selectors|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   366
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   367
    selectors := self messageMenu:anInstance.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   368
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   369
    selectors notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   370
        self topView withWaitCursorDo:[MessageTracer trace:anInstance selectors:selectors]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   371
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   372
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   373
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   374
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   375
doTraceAll:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   376
    "place a trace on all messages sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   377
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   378
    self topView withWaitCursorDo:[MessageTracer traceAll:anInstance]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   379
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   380
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   381
doTrap:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   382
    "place a trap on a message sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   383
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   384
    |selectors|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   385
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   386
    selectors := self messageMenu:anInstance.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   387
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   388
    selectors notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   389
        self topView withWaitCursorDo:[MessageTracer trap:anInstance selectors:selectors]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   390
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   391
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   392
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   393
doTrapAll:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   394
    "place a trap on all messages sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   395
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   396
    self topView withWaitCursorDo:[MessageTracer trapAll:anInstance]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   397
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   398
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   399
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   400
doUntrace:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   401
    "remove all traps and traces to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   402
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   403
    self topView withWaitCursorDo:[MessageTracer untrace:anInstance].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   404
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   405
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   406
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   407
messageMenu:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   408
    "open menu to select messages; on accepted a list of messages is returned
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   409
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   410
    |sll acl lst inset top hzp slv acv dblClcAct btp b1 b2 accepted viewSpacing|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   411
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   412
    top := StandardSystemView new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   413
    top extent:500 @ 400.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   414
    top label:(anInstance printString).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   415
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   416
    (Label origin:(0.0 @  0.0) corner:(0.5 @ 20) in:top) label:'messages'.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   417
    (Label origin:(0.5 @  0.0) corner:(1.0 @ 20) in:top) label:'selected'.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   418
    hzp := VariableHorizontalPanel origin:(0.0 @ 20) corner:(1.0 @ 1.0) in:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   419
    btp := HorizontalPanelView origin:(0.0 @1.0) corner:(1.0 @ 1.0) in:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   420
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   421
    b1 := Button abortButtonIn:btp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   422
    b2 := Button okButtonIn:btp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   423
    accepted := false.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   424
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   425
    b1 action:[accepted := false. top destroy].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   426
    b2 action:[accepted := true.  top destroy].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   427
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   428
    btp horizontalLayout:#fitSpace.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   429
    viewSpacing := top class viewSpacing.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   430
    inset       := (b2 preferredExtent y) + viewSpacing.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   431
    viewSpacing := viewSpacing // 2.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   432
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   433
    hzp bottomInset:inset.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   434
    btp topInset:((inset - viewSpacing) negated).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   435
    btp bottomInset:viewSpacing.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   436
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   437
    slv := ScrollableView for:SelectionInListView
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   438
                miniScrollerV:true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   439
                       origin:(0.0 @ 0.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   440
                       corner:(0.5 @ 1.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   441
                           in:hzp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   442
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   443
    acv := ScrollableView for:SelectionInListView
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   444
                miniScrollerV:true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   445
                       origin:(0.5 @ 0.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   446
                       corner:(1.0 @ 1.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   447
                           in:hzp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   448
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   449
    slv := slv scrolledView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   450
    acv := acv scrolledView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   451
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   452
    sll := (MessageTracer realClassOf:anInstance) selectors.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   453
    acl := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   454
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   455
    (MessageTracer wrappedSelectorsOf:anInstance) do:[:el|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   456
        el notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   457
            acl add:el.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   458
            sll remove:el ifAbsent:nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   459
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   460
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   461
        
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   462
    slv list:(sll copy).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   463
    acv list:(acl copy).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   464
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   465
    dblClcAct := [:from :to|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   466
        to add:(from selectionValue).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   467
        from removeIndex:(from selection).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   468
        from redraw.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   469
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   470
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   471
    slv doubleClickAction:[:index| dblClcAct value:slv value:acv].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   472
    acv doubleClickAction:[:index| dblClcAct value:acv value:slv].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   473
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   474
    top openModal.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   475
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   476
    accepted ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   477
        ^ nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   478
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   479
    lst := acv list.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   480
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   481
"undo existing traps            HACK: removes traps and traces"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   482
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   483
    acl notEmpty ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   484
        MessageTracer untrace:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   485
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   486
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   487
    lst notEmpty ifTrue:[^ lst]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   488
                ifFalse:[^ nil]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   489
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   490
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   491
viewMenu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   492
    "popup menu required by any view. Delegate the request to the corresponding view
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   493
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   494
    |sqNr view|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   495
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   496
    view := (WindowGroup lastEventQuerySignal raise) view.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   497
    sqNr := listViews findFirst:[:v| v == view].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   498
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   499
    sqNr notNil ifTrue:[^ self viewMenu:sqNr]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   500
               ifFalse:[^ nil]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   501
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   502
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   503
viewMenu:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   504
    "popup menu required for a view identified by its sequence number
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   505
    "
327
0040d47658c6 check - warnings eliminated. Fix in InspectorList.st
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
   506
    |view menu inst args lbls|
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   507
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   508
    view := listViews at:anIndex.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   509
    view hasSelection ifFalse:[^ nil].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   510
    inst := view selectedInstanceVar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   511
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   512
    menu := PopUpMenu labels:#( 'update' )
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   513
                   selectors:#( #update  )
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   514
                    receiver:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   515
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   516
    menu actionAt:#update put:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   517
        view update.
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   518
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   519
        listViews from:(anIndex + 1) do:[:v|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   520
            (view selectedInstanceType) ~~ #directory ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   521
                v inspect:nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   522
            ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   523
                v inspect:(view selectedInstanceVar).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   524
                view := v.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   525
            ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   526
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   527
        self update
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   528
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   529
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   530
    (NewInspectorList isTraceable:inst) ifFalse:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   531
        ^ menu
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   532
    ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   533
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   534
    menu  addLabels:#(
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   535
                      '-'
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   536
                      'trace'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   537
                      'trap'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   538
                      'untrace / untrap'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   539
                     )
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   540
          selectors:#(
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   541
                      nil
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   542
                      trace
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   543
                      trap
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   544
                      untrace
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   545
                     ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   546
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   547
    menu actionAt:#untrace put:[self doUntrace:inst].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   548
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   549
    args := Array new:2 withAll:inst.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   550
    lbls := Array with:'message'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   551
                  with:((Text string:' all ' emphasis:#underline), ' messages').
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   552
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   553
    menu subMenuAt:#trace put:(
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   554
        PopUpMenu labels:lbls selectors:#(doTrace: doTraceAll:) args:args
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   555
    ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   556
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   557
    menu subMenuAt:#trap put:(
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   558
        PopUpMenu labels:lbls selectors:#(doTrap: doTrapAll:) args:args
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   559
    ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   560
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   561
  ^ menu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   562
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   563
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   564
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   565
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   566
!NewInspectorPanelView methodsFor:'private'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   567
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   568
doItOrAccept:aBlock
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   569
    "handle a doIt or accept action; on success all the folloed views are
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   570
     updated
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   571
    "
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   572
    |index list result instVar|
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   573
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   574
    list    := self findLastValidListWithSelection.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   575
    result  := aBlock value:list.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   576
    instVar := list selectedInstanceVar.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   577
    index   := listViews findLast:[:v|v == list].
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   578
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   579
    (index ~~ 0 and:[index ~~ listViews size]) ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   580
        index := index + 1.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   581
        (list selectedInstanceType) == #directory ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   582
            (listViews at:index) inspect:instVar
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   583
        ] ifFalse:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   584
            (listViews at:index) inspect:nil
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   585
        ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   586
        self update
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   587
    ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   588
    valueChangedAction notNil ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   589
        valueChangedAction value:instVar
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   590
    ].
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   591
    ^ result
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   592
!
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   593
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   594
findLastValidListWithSelection
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   595
    "returns last valid list with a selection; if no selection exists in any
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   596
     view, the list assigned to the inspected object is returned
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   597
    "
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   598
    |index|
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   599
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   600
    rightHistory notEmpty ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   601
        ^ rightHistory first
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   602
    ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   603
    index := listViews findLast:[:v| v hasSelection ].
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   604
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   605
    index ~~ 0 ifTrue:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   606
        ^ listViews at:index
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   607
    ].
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   608
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   609
    leftHistory notEmpty ifTrue:[^ leftHistory last]
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   610
                        ifFalse:[^ listViews at:1]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   611
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   612
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   613
update
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   614
    "update labels and scrollbar
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   615
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   616
    |pview cview stop index ispObj label|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   617
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   618
"UPDATE LABELS
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   619
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   620
    index := 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   621
    stop  := listViews size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   622
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   623
    [   cview  := listViews at:index.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   624
        ispObj := cview inspectedObject.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   625
        label  := labelViews at:index.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   626
        index  := index + 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   627
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   628
        ispObj notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   629
            label label:(ispObj class name asString).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   630
            pview := cview.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   631
        ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   632
            [index <= stop] whileTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   633
                (labelViews at:index) label:''.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   634
                index := index + 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   635
            ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   636
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   637
            (pview isNil or:[pview selectedInstanceType == #normal]) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   638
                pview notNil ifTrue:[ispObj := pview selectedInstanceVar].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   639
                label label:ispObj class name asString
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   640
            ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   641
                label label:''
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   642
            ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   643
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   644
        index > stop
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   645
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   646
    ] whileFalse.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   647
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   648
"UPDATE SCROLLBARS
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   649
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   650
    index := listViews size + leftHistory size + rightHistory size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   651
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   652
    (listViews last) selectedInstanceType notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   653
        index := index + 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   654
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   655
    scrollBar thumbHeight:(stop / index) * 100.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   656
    scrollBar thumbOrigin:(100  / index * leftHistory size).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   657
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   658
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   659
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   660
!NewInspectorPanelView methodsFor:'private frames'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   661
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   662
computeExtentOfFrames
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   663
    "compute the extent of all frames (origin/corner)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   664
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   665
    |orig corn offset newX|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   666
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   667
    orig := ( 0.0 @ 0.0 ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   668
    corn := ( 0.0 @ 1.0 ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   669
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   670
    offset := 1.0 / (frames size).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   671
    newX   := 0.0.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   672
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   673
    frames do:[:frame|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   674
        (newX := newX + offset) > 1.0 ifTrue:[ newX := 1.0 ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   675
        corn  := newX @ corn y.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   676
        frame origin:orig corner:corn.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   677
        orig  := newX @ orig y.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   678
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   679
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   680
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   681
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   682
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   683
createViewWithoutRedraw
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   684
    "add a new view at end of the panel
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   685
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   686
    |view frame label index|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   687
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   688
    frame := SimpleView in:hzpView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   689
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   690
    label := Label origin:0.0@0.0 corner:1.0@20 in:frame.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   691
    label  leftInset:15.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   692
    label rightInset:2.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   693
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   694
    view  := ScrollableView for:NewInspectorListView miniScroller:true origin:0.0@20 
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   695
                         corner:1.0@1.0 in:frame.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   696
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   697
    view := view scrolledView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   698
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   699
    frames add:frame.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   700
    labelViews add:label.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   701
    listViews  add:view.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   702
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   703
    index := listViews size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   704
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   705
    index == 1 ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   706
        view includesSelf:true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   707
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   708
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   709
    label adjust:#left.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   710
    label label:''.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   711
    label level:1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   712
    label menuHolder:self; menuMessage:#labelMenu; menuPerformer:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   713
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   714
    view action:[:el|self singleClickAt:index].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   715
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   716
    view delegate:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   717
    view menuHolder:self; menuMessage:#viewMenu; menuPerformer:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   718
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   719
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   720
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   721
!NewInspectorPanelView methodsFor:'scrolling-basic'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   722
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   723
moveContentsLeft:nTimes
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   724
    "move the contents of all views one position left
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   725
    "
327
0040d47658c6 check - warnings eliminated. Fix in InspectorList.st
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
   726
    |fView stop pView index|
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   727
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   728
    (nTimes < 1 or:[listViews last isEmpty]) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   729
        ^ self
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   730
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   731
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   732
    index := nTimes.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   733
    stop  := (listViews size) - 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   734
    fView := listViews first.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   735
    pView := listViews at:stop.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   736
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   737
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   738
    [   leftHistory add:(fView list).
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   739
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   740
        1 to:stop do:[:i|
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   741
            (listViews at:i) list:(listViews at:(i+1))
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   742
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   743
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   744
        rightHistory notEmpty ifTrue:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   745
            (listViews last) list:(rightHistory removeLast)
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   746
        ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   747
            (listViews last) inspect:(pView selectedInstanceVar)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   748
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   749
        ((index := index - 1) == 0 or:[listViews last isEmpty])
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   750
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   751
    ] whileFalse.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   752
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   753
    self update.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   754
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   755
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   756
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   757
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   758
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   759
moveContentsRight:nTimes
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   760
    "move the contents of all views one position right
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   761
    "
327
0040d47658c6 check - warnings eliminated. Fix in InspectorList.st
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
   762
    |size index lView fView|
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   763
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   764
    size := leftHistory size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   765
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   766
    (nTimes > 0 and:[size ~~ 0]) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   767
        nTimes > size ifFalse:[index := nTimes]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   768
                       ifTrue:[index := size].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   769
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   770
        size  := listViews size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   771
        lView := listViews last.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   772
        fView := listViews first.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   773
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   774
        1 to:index do:[:i|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   775
            lView hasSelection ifTrue:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   776
                rightHistory add:(lView list)
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   777
            ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   778
            size to:2 by:-1 do:[:i|
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   779
                (listViews at:i) list:(listViews at:(i-1))
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   780
            ].
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   781
            fView list:(leftHistory removeLast)
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   782
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   783
        self update
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   784
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   785
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   786
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   787
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   788
scrollTo:nPercent
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   789
    "set views and contents dependant on scroll bar
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   790
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   791
    |dY no noScr pR|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   792
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   793
    noScr := listViews size + leftHistory size + rightHistory size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   794
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   795
    (listViews last) selectedInstanceType notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   796
        noScr := noScr + 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   797
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   798
    dY := 100 / noScr.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   799
    pR := nPercent roundTo:dY.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   800
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   801
    no := ((dY * leftHistory size) - pR) / dY.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   802
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   803
    no == 0 ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   804
        (nPercent - pR) > 0 ifTrue:[no := -1]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   805
                           ifFalse:[no :=  1]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   806
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   807
    no < 0 ifTrue:[self moveContentsLeft:(no negated)]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   808
          ifFalse:[self moveContentsRight:no]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   809
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   810
1213
6cf7a4c2dfce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 810
diff changeset
   811
!NewInspectorPanelView class methodsFor:'documentation'!
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   812
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   813
version
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   814
    ^ '$Header$'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   815
! !