author | tm |
Thu, 18 Mar 1999 15:47:39 +0100 | |
changeset 1058 | 243d945b1daf |
parent 811 | 911e51013604 |
child 1213 | 6cf7a4c2dfce |
permissions | -rw-r--r-- |
809
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
1 |
" |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
3 |
All Rights Reserved |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
4 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
5 |
This software is furnished under a license and may be used |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
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:
88
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
10 |
hereby transferred. |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
11 |
" |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
12 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
13 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
14 |
|
32 | 15 |
"{ NameSpace: NewInspector }" |
16 |
||
17 |
VariableVerticalPanel subclass:#InspectorView |
|
18 |
instanceVariableNames:'inspectorView userSpace workSpace inspectedObject' |
|
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
810 | 21 |
category:'Interface-Inspector' |
32 | 22 |
! |
23 |
||
24 |
!InspectorView class methodsFor:'documentation'! |
|
25 |
||
809
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
26 |
copyright |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
27 |
" |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
28 |
COPYRIGHT (c) 1997 by eXept Software AG |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
29 |
All Rights Reserved |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
30 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
31 |
This software is furnished under a license and may be used |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
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:
88
diff
changeset
|
33 |
inclusion of the above copyright notice. This software may not |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
34 |
be provided or otherwise made available to, or used by, any |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
35 |
other person. No title to or ownership of the software is |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
36 |
hereby transferred. |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
37 |
" |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
38 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
39 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
40 |
! |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
41 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
42 |
documentation |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
43 |
" |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
44 |
a new (multipane) inspector; |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
45 |
open with: |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
46 |
NewInspector::InspectorView inspect:someObject |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
47 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
48 |
install as standard inspector: |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
49 |
Smalltalk at:#Inspector put:(NewInspector::InspectorView) |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
50 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
51 |
[open with:] |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
52 |
NewInspector::InspectorView |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
53 |
inspect:(Array with:#hello with:'hello' with:#(1 2 3) asSortedCollection with:Display) |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
54 |
|
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
55 |
[author:] |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
56 |
Claus Atzkern |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
57 |
" |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
58 |
! |
6f127dd5e578
added copyright & documentation
Claus Gittinger <cg@exept.de>
parents:
88
diff
changeset
|
59 |
|
32 | 60 |
examples |
61 |
||
62 |
" |
|
39 | 63 |
open an inspector on an array |
64 |
[exBegin] |
|
65 |
|array| |
|
66 |
||
67 |
array := Array new:5. |
|
68 |
array at:1 put:(Array new:400). |
|
69 |
NewInspector::InspectorView inspect:array |
|
70 |
[exEnd] |
|
32 | 71 |
" |
72 |
! ! |
|
73 |
||
74 |
!InspectorView class methodsFor:'instance creation'! |
|
75 |
||
811
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
76 |
inspect:anObject |
32 | 77 |
"start inspector on an instance |
78 |
" |
|
811
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
79 |
^ self openOn:anObject |
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
80 |
! |
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
81 |
|
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
82 |
openOn:anObject |
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
83 |
"start an inspector on some object |
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
84 |
" |
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
85 |
|
32 | 86 |
|top isp| |
87 |
||
88 |
top := StandardSystemView new extent:600@400. |
|
89 |
isp := InspectorView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
811
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
90 |
isp inspect:anObject. |
32 | 91 |
top open. |
92 |
||
811
911e51013604
added #openOn: for oldInspector compatibility.
Claus Gittinger <cg@exept.de>
parents:
810
diff
changeset
|
93 |
^ isp. |
32 | 94 |
! ! |
95 |
||
96 |
!InspectorView methodsFor:'accessing'! |
|
97 |
||
98 |
inspect:anInstance |
|
99 |
||
100 |
inspectedObject := anInstance. |
|
101 |
self topView label:(inspectedObject class name asString). |
|
102 |
inspectorView inspect:anInstance. |
|
103 |
self updateWorkSpace. |
|
104 |
||
105 |
! ! |
|
106 |
||
107 |
!InspectorView methodsFor:'initialization'! |
|
108 |
||
109 |
initialize |
|
88
d6dccf1ad344
correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents:
39
diff
changeset
|
110 |
|view wsHeight| |
32 | 111 |
|
112 |
super initialize. |
|
113 |
||
114 |
view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self. |
|
115 |
||
116 |
inspectorView := InspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view. |
|
117 |
workSpace := Workspace origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view. |
|
118 |
userSpace := Workspace origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self. |
|
119 |
||
88
d6dccf1ad344
correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents:
39
diff
changeset
|
120 |
wsHeight := (workSpace preferredExtentForLines:1 cols:10) y. |
d6dccf1ad344
correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents:
39
diff
changeset
|
121 |
workSpace topInset:wsHeight negated. |
d6dccf1ad344
correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents:
39
diff
changeset
|
122 |
inspectorView bottomInset:wsHeight. |
32 | 123 |
|
124 |
userSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace]. |
|
125 |
workSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace]. |
|
126 |
||
127 |
userSpace doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace]. |
|
128 |
workSpace doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace]. |
|
129 |
||
130 |
inspectorView action:[:el|self updateWorkSpace]. |
|
131 |
||
132 |
inspectorView valueChangedAction:[:el||lbl| |
|
133 |
workSpace list:(Array with:(el displayString)). |
|
134 |
]. |
|
88
d6dccf1ad344
correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents:
39
diff
changeset
|
135 |
|
d6dccf1ad344
correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents:
39
diff
changeset
|
136 |
"Modified: 18.3.1997 / 10:57:34 / cg" |
32 | 137 |
! ! |
138 |
||
139 |
!InspectorView methodsFor:'update'! |
|
140 |
||
141 |
updateWorkSpace |
|
142 |
"update the workSpace |
|
143 |
" |
|
144 |
workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)). |
|
145 |
! ! |
|
146 |
||
147 |
!InspectorView class methodsFor:'documentation'! |
|
148 |
||
149 |
version |
|
150 |
^ '$Header$' |
|
151 |
! ! |