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