--- a/InspectorView.st Mon Oct 10 04:15:21 1994 +0100
+++ b/InspectorView.st Mon Oct 10 04:16:24 1994 +0100
@@ -2,7 +2,7 @@
"
COPYRIGHT (c) 1989 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -14,8 +14,8 @@
View subclass:#InspectorView
instanceVariableNames:'listView workspace
- inspectedObject selectedLine
- inspectedValues nShown menu1 menu2'
+ inspectedObject selectedLine
+ inspectedValues nShown menu1 menu2'
classVariableNames:''
poolDictionaries:''
category:'Interface-Inspector'
@@ -23,9 +23,9 @@
InspectorView comment:'
COPYRIGHT (c) 1989 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
-$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.9 1994-08-22 18:07:19 claus Exp $
+$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.10 1994-10-10 03:15:47 claus Exp $
'!
!InspectorView class methodsFor:'documentation'!
@@ -33,7 +33,7 @@
copyright
"
COPYRIGHT (c) 1989 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -46,7 +46,7 @@
version
"
-$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.9 1994-08-22 18:07:19 claus Exp $
+$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.10 1994-10-10 03:15:47 claus Exp $
"
!
@@ -71,13 +71,13 @@
(see OrderedCollectionInspectorView, ImageInspectorView etc. as examples).
examples:
- #(1 2 3 4) asOrderedCollection inspect
- #(1 2 3 4) asOrderedCollection basicInspect
- (Array new:10000) inspect
- (Image fromFile:'bitmaps/claus.gif') inspect
- (Image fromFile:'bitmaps/claus.gif') basicInspect
- (Image fromFile:'bitmaps/SBrowser.xbm') inspect
- (Image fromFile:'bitmaps/SBrowser.xbm') basicInspect
+ #(1 2 3 4) asOrderedCollection inspect
+ #(1 2 3 4) asOrderedCollection basicInspect
+ (Array new:10000) inspect
+ (Image fromFile:'bitmaps/claus.gif') inspect
+ (Image fromFile:'bitmaps/claus.gif') basicInspect
+ (Image fromFile:'bitmaps/SBrowser.xbm') inspect
+ (Image fromFile:'bitmaps/SBrowser.xbm') basicInspect
"
! !
@@ -103,21 +103,21 @@
|topView inspectorView nm|
anObject isClass ifTrue:[
- nm := anObject displayString
+ nm := anObject displayString
] ifFalse:[
- nm := anObject classNameWithArticle
+ nm := anObject classNameWithArticle
].
topView := StandardSystemView
- label:('Inspector on: ' , nm)
- icon:(Form fromFile:'Inspector.xbm' resolution:100)
- minExtent:(100 @ 100).
+ label:('Inspector on: ' , nm)
+ icon:(Form fromFile:'Inspector.xbm' resolution:100)
+ minExtent:(100 @ 100).
topView extent:(Display width // 3) @ (Display height // 3).
inspectorView := self origin:(0.0 @ 0.0)
- corner:(1.0 @ 1.0)
- in:topView.
+ corner:(1.0 @ 1.0)
+ in:topView.
"kludge: must realize first, to be able to set menu again"
topView open.
@@ -138,13 +138,13 @@
super initialize.
panel := VariableHorizontalPanel origin:(0.0 @ 0.0)
- corner:(1.0 @ 1.0)
- in:self.
+ corner:(1.0 @ 1.0)
+ in:self.
v := HVScrollableView for:SelectionInListView
- miniScrollerH:true
- miniScrollerV:false
- in:panel.
+ miniScrollerH:true
+ miniScrollerV:false
+ in:panel.
v origin:(0.0 @ 0.0) corner:(0.3 @ 1.0).
listView := v scrolledView.
listView action:[:lineNr | self showSelection:lineNr].
@@ -152,9 +152,9 @@
listView ignoreReselect:false.
v := HVScrollableView for:CodeView
- miniScrollerH:true
- miniScrollerV:false
- in:panel.
+ miniScrollerH:true
+ miniScrollerV:false
+ in:panel.
v origin:(0.3 @ 0.0) corner:(1.0 @ 1.0).
workspace := v scrolledView.
nShown := 100.
@@ -163,20 +163,19 @@
initializeListViewMiddleButtonMenus
menu1 := PopUpMenu
- labels:(resources array:#('inspect'))
- selectors:#doInspect
- receiver:self
- for:listView.
+ labels:(resources array:#('inspect'))
+ selectors:#doInspect
+ receiver:self
+ for:listView.
menu2 := PopUpMenu
- labels:(resources array:#(
- 'inspect'
- '-'
- 'show more'
- ))
- selectors:#(doInspect nil showMore)
- receiver:self
- for:listView.
- listView setMiddleButtonMenu:menu1.
+ labels:(resources array:#(
+ 'inspect'
+ '-'
+ 'show more'
+ ))
+ selectors:#(doInspect nil showMore)
+ receiver:self
+ for:listView.
workspace acceptAction:[:theText | self doAccept:theText asString]
!
@@ -203,7 +202,7 @@
"
inspectedObject notNil ifTrue:[
- inspectedObject removeDependent:self
+ inspectedObject removeDependent:self
].
"
inspectedObject := nil.
@@ -221,30 +220,30 @@
aList add:'self'.
cls := inspectedObject class.
cls isClass ifTrue:[
- cls allInstVarNames do:[:instVarName |
- aList add:instVarName
- ]
+ cls allInstVarNames do:[:instVarName |
+ aList add:instVarName
+ ]
] ifFalse:[
- 1 to:cls instSize do:[:index |
- aList add:('instvar' , index printString)
- ]
+ 1 to:cls instSize do:[:index |
+ aList add:('instvar' , index printString)
+ ]
].
cls isVariable ifTrue:[
- n := inspectedObject basicSize.
- (n > nShown) ifTrue:[
- n := nShown.
- cut := true.
- listView setMiddleButtonMenu:menu2.
- ] ifFalse:[
- cut := false.
- listView setMiddleButtonMenu:menu1.
- ].
- 1 to:n do:[:index |
- aList add:(index printString)
- ].
- cut ifTrue:[
- aList add:' ... '
- ]
+ n := inspectedObject basicSize.
+ (n > nShown) ifTrue:[
+ n := nShown.
+ cut := true.
+ listView setMiddleButtonMenu:menu2.
+ ] ifFalse:[
+ cut := false.
+ listView setMiddleButtonMenu:menu1.
+ ].
+ 1 to:n do:[:index |
+ aList add:(index printString)
+ ].
+ cut ifTrue:[
+ aList add:' ... '
+ ]
].
^ aList
!
@@ -262,37 +261,39 @@
sameObject := anObject == inspectedObject.
"
sameObject ifFalse:[
- inspectedObject notNil ifTrue:[
- inspectedObject removeDependent:self
- ]
+ inspectedObject notNil ifTrue:[
+ inspectedObject removeDependent:self
+ ]
].
"
inspectedObject := anObject.
+ self initializeListViewMiddleButtonMenus.
+ listView setMiddleButtonMenu:menu1.
realized ifFalse:[^ self].
aList := self listOfNames.
sameObject ifTrue:[
- listView setContents:aList
+ listView setContents:aList
] ifFalse:[
- listView contents:aList
+ listView contents:aList
].
workspace contents:nil.
workspace doItAction:[:theCode |
- inspectedObject class compiler
- evaluate:theCode
- in:nil
- receiver:inspectedObject
- notifying:workspace
- logged:true
- ifFail:nil
+ inspectedObject class compiler
+ evaluate:theCode
+ in:nil
+ receiver:inspectedObject
+ notifying:workspace
+ logged:true
+ ifFail:nil
].
"
sameObject ifFalse:[
- inspectedObject notNil ifTrue:[
- inspectedObject addDependent:self
- ]
+ inspectedObject notNil ifTrue:[
+ inspectedObject addDependent:self
+ ]
].
"
inspectedValues := nil.
@@ -304,13 +305,13 @@
workspace contents:nil.
"
inspectedObject notNil ifTrue:[
- inspectedObject removeDependent:self
+ inspectedObject removeDependent:self
].
"
inspectedObject := anObject.
"
inspectedObject notNil ifTrue:[
- inspectedObject addDependent:self
+ inspectedObject addDependent:self
].
"
inspectedValues := valueArray.
@@ -322,7 +323,7 @@
workspace contents:nil.
"
inspectedObject notNil ifTrue:[
- inspectedObject removeDependent:self
+ inspectedObject removeDependent:self
].
"
inspectedObject := nil.
@@ -338,32 +339,32 @@
workspace keyPress:aKey x:0 y:0
!
-update:something
+update:something with:someArgument from:changedObject
"handle updates from other inspectors"
|oldSelection|
- something == inspectedObject ifTrue:[
- oldSelection := listView selection.
- self inspect:inspectedObject.
- oldSelection notNil ifTrue:[
- self showSelection:oldSelection
- ]
+ changedObject == inspectedObject ifTrue:[
+ oldSelection := listView selection.
+ self inspect:inspectedObject.
+ oldSelection notNil ifTrue:[
+ self showSelection:oldSelection
+ ]
]
!
destroy
inspectedObject notNil ifTrue:[
"
- inspectedObject removeDependent:self.
+ inspectedObject removeDependent:self.
"
- inspectedObject := nil
+ inspectedObject := nil
].
menu1 notNil ifTrue:[
- menu1 destroy. menu1 := nil.
+ menu1 destroy. menu1 := nil.
].
menu2 notNil ifTrue:[
- menu2 destroy. menu2 := nil.
+ menu2 destroy. menu2 := nil.
].
inspectedValues := nil.
super destroy
@@ -378,25 +379,25 @@
workspace contents:nil.
"
inspectedValues isNil ifTrue:[
- lineNr == 1 ifTrue:[
- "selecting self also does a re-set, this allows updating the list"
- self inspect:inspectedObject.
- val := inspectedObject
- ] ifFalse:[
- index := lineNr - 1.
- (inspectedObject class isVariable) ifFalse:[
- val := inspectedObject instVarAt:index
- ] ifTrue:[
- index <= (inspectedObject class instSize) ifTrue:[
- val := inspectedObject instVarAt:index
- ] ifFalse:[
- index := index - inspectedObject class instSize.
- val := inspectedObject basicAt:index
- ]
- ]
- ]
+ lineNr == 1 ifTrue:[
+ "selecting self also does a re-set, this allows updating the list"
+ self inspect:inspectedObject.
+ val := inspectedObject
+ ] ifFalse:[
+ index := lineNr - 1.
+ (inspectedObject class isVariable) ifFalse:[
+ val := inspectedObject instVarAt:index
+ ] ifTrue:[
+ index <= (inspectedObject class instSize) ifTrue:[
+ val := inspectedObject instVarAt:index
+ ] ifFalse:[
+ index := index - inspectedObject class instSize.
+ val := inspectedObject basicAt:index
+ ]
+ ]
+ ]
] ifFalse:[
- val := inspectedValues at:lineNr
+ val := inspectedValues at:lineNr
].
string := val displayString.
"
@@ -411,29 +412,29 @@
|value index|
value := inspectedObject class compiler
- evaluate:theText
- receiver:inspectedObject
- notifying:workspace.
+ evaluate:theText
+ receiver:inspectedObject
+ notifying:workspace.
inspectedValues isNil ifTrue:[
- selectedLine notNil ifTrue:[
- selectedLine == 1 ifFalse:[
- index := selectedLine - 1.
- (inspectedObject class isVariable) ifFalse:[
- inspectedObject instVarAt:index put:value
- ] ifTrue:[
- index <= (inspectedObject class instSize) ifTrue:[
- inspectedObject instVarAt:index put:value
- ] ifFalse:[
- index := index - inspectedObject class instSize.
- inspectedObject basicAt:index put:value
- ]
- ]
- ]
- ]
+ selectedLine notNil ifTrue:[
+ selectedLine == 1 ifFalse:[
+ index := selectedLine - 1.
+ (inspectedObject class isVariable) ifFalse:[
+ inspectedObject instVarAt:index put:value
+ ] ifTrue:[
+ index <= (inspectedObject class instSize) ifTrue:[
+ inspectedObject instVarAt:index put:value
+ ] ifFalse:[
+ index := index - inspectedObject class instSize.
+ inspectedObject basicAt:index put:value
+ ]
+ ]
+ ]
+ ]
] ifFalse:[
- selectedLine notNil ifTrue:[
- inspectedValues at:selectedLine put:value
- ]
+ selectedLine notNil ifTrue:[
+ inspectedValues at:selectedLine put:value
+ ]
].
inspectedObject changed
!
@@ -443,25 +444,25 @@
|index objectToInspect|
selectedLine notNil ifTrue:[
- inspectedValues isNil ifTrue:[
- (selectedLine == 1) ifTrue:[
- objectToInspect := inspectedObject
- ] ifFalse:[
- index := selectedLine - 1.
- (inspectedObject class isVariable) ifFalse:[
- objectToInspect := inspectedObject instVarAt:index
- ] ifTrue:[
- index <= (inspectedObject class instSize) ifTrue:[
- objectToInspect := inspectedObject instVarAt:index
- ] ifFalse:[
- index := index - inspectedObject class instSize.
- objectToInspect := inspectedObject basicAt:index
- ]
- ]
- ]
- ] ifFalse:[
- objectToInspect := inspectedValues at:selectedLine ifAbsent:[^ self]
- ].
- objectToInspect inspect
+ inspectedValues isNil ifTrue:[
+ (selectedLine == 1) ifTrue:[
+ objectToInspect := inspectedObject
+ ] ifFalse:[
+ index := selectedLine - 1.
+ (inspectedObject class isVariable) ifFalse:[
+ objectToInspect := inspectedObject instVarAt:index
+ ] ifTrue:[
+ index <= (inspectedObject class instSize) ifTrue:[
+ objectToInspect := inspectedObject instVarAt:index
+ ] ifFalse:[
+ index := index - inspectedObject class instSize.
+ objectToInspect := inspectedObject basicAt:index
+ ]
+ ]
+ ]
+ ] ifFalse:[
+ objectToInspect := inspectedValues at:selectedLine ifAbsent:[^ self]
+ ].
+ objectToInspect inspect
]
! !