12 |
12 |
13 |
13 |
14 |
14 |
15 "{ NameSpace: NewInspector }" |
15 "{ NameSpace: NewInspector }" |
16 |
16 |
17 SelectionInListView subclass:#InspectorListView |
17 SelectionInListView subclass:#NewInspectorListView |
18 instanceVariableNames:'actionHolder inspectorList includesSelf' |
18 instanceVariableNames:'actionHolder inspectorList includesSelf' |
19 classVariableNames:'' |
19 classVariableNames:'' |
20 poolDictionaries:'' |
20 poolDictionaries:'' |
21 category:'Interface-Inspector' |
21 category:'Interface-NewInspector' |
22 ! |
22 ! |
23 |
23 |
24 !InspectorListView class methodsFor:'documentation'! |
24 !NewInspectorListView class methodsFor:'documentation'! |
25 |
25 |
26 copyright |
26 copyright |
27 " |
27 " |
28 COPYRIGHT (c) 1997 by eXept Software AG |
28 COPYRIGHT (c) 1997 by eXept Software AG |
29 All Rights Reserved |
29 All Rights Reserved |
74 |
74 |
75 list:aList |
75 list:aList |
76 "set the lists contents from another list |
76 "set the lists contents from another list |
77 " |
77 " |
78 aList notNil ifTrue:[inspectorList := aList list] |
78 aList notNil ifTrue:[inspectorList := aList list] |
79 ifFalse:[inspectorList := InspectorList new]. |
79 ifFalse:[inspectorList := NewInspectorList new]. |
80 |
80 |
81 inspectorList includesSelf:includesSelf. |
81 inspectorList includesSelf:includesSelf. |
82 super list:(inspectorList instanceNames). |
82 super list:(inspectorList instanceNames). |
83 ! |
83 ! |
84 |
84 |
88 inspectorList update. |
88 inspectorList update. |
89 super list:(inspectorList instanceNames). |
89 super list:(inspectorList instanceNames). |
90 |
90 |
91 ! ! |
91 ! ! |
92 |
92 |
93 !InspectorListView methodsFor:'accessing actions'! |
93 !NewInspectorListView methodsFor:'accessing actions'! |
94 |
94 |
95 action:aOneArgAction |
95 action:aOneArgAction |
96 "set the single click action block. If non-nil, that one is evaluated on single |
96 "set the single click action block. If non-nil, that one is evaluated on single |
97 click, passing the selected instance as argument |
97 click, passing the selected instance as argument |
98 " |
98 " |
99 actionHolder := aOneArgAction |
99 actionHolder := aOneArgAction |
100 ! ! |
100 ! ! |
101 |
101 |
102 !InspectorListView methodsFor:'drawing'! |
102 !NewInspectorListView methodsFor:'drawing'! |
103 |
103 |
104 drawVisibleLineSelected:visLineNr with:fg and:bg |
104 drawVisibleLineSelected:visLineNr with:fg and:bg |
105 "redraw a single line as selected. |
105 "redraw a single line as selected. |
106 " |
106 " |
107 |nr| |
107 |nr| |
165 ^ (width - margin - margin) |
165 ^ (width - margin - margin) |
166 |
166 |
167 |
167 |
168 ! ! |
168 ! ! |
169 |
169 |
170 !InspectorListView methodsFor:'event handling'! |
170 !NewInspectorListView methodsFor:'event handling'! |
171 |
171 |
172 sizeChanged:how |
172 sizeChanged:how |
173 "redraw marks |
173 "redraw marks |
174 " |
174 " |
175 super sizeChanged:how. |
175 super sizeChanged:how. |
176 shown ifTrue:[self invalidate] |
176 shown ifTrue:[self invalidate] |
177 |
177 |
178 ! ! |
178 ! ! |
179 |
179 |
180 !InspectorListView methodsFor:'initialization'! |
180 !NewInspectorListView methodsFor:'initialization'! |
181 |
181 |
182 initialize |
182 initialize |
183 "initialization |
183 "initialization |
184 " |
184 " |
185 super initialize. |
185 super initialize. |
186 |
186 |
187 ignoreReselect := false. |
187 ignoreReselect := false. |
188 includesSelf := false. |
188 includesSelf := false. |
189 actionHolder := [:el|]. |
189 actionHolder := [:el|]. |
190 inspectorList := InspectorList new. |
190 inspectorList := NewInspectorList new. |
191 |
191 |
192 actionBlock := [:dummy| |
192 actionBlock := [:dummy| |
193 self setSelection:selection. |
193 self setSelection:selection. |
194 actionHolder value:(self selectedInstanceVar) |
194 actionHolder value:(self selectedInstanceVar) |
195 ]. |
195 ]. |
196 ! ! |
196 ! ! |
197 |
197 |
198 !InspectorListView methodsFor:'private'! |
198 !NewInspectorListView methodsFor:'private'! |
199 |
199 |
200 doesNotUnderstand:aMessage |
200 doesNotUnderstand:aMessage |
201 "forward a message to the inspectorList |
201 "forward a message to the inspectorList |
202 " |
202 " |
203 (inspectorList respondsTo:(aMessage selector)) ifTrue:[ |
203 (inspectorList respondsTo:(aMessage selector)) ifTrue:[ |
243 inspectorList setSelection:aNumberOrNil. |
243 inspectorList setSelection:aNumberOrNil. |
244 oldSize == inspectorList size ifTrue:[super setSelection:(inspectorList selection)] |
244 oldSize == inspectorList size ifTrue:[super setSelection:(inspectorList selection)] |
245 ifFalse:[super list:(inspectorList instanceNames)]. |
245 ifFalse:[super list:(inspectorList instanceNames)]. |
246 ! ! |
246 ! ! |
247 |
247 |
248 !InspectorListView methodsFor:'user interaction'! |
248 !NewInspectorListView methodsFor:'user interaction'! |
249 |
249 |
250 accept:aText notifying:aView |
250 accept:aText notifying:aView |
251 "evaluating aText on the selected instance var; if an error occurs #Error |
251 "evaluating aText on the selected instance var; if an error occurs #Error |
252 is returned otherwise the inspected object instance. On success the list |
252 is returned otherwise the inspected object instance. On success the list |
253 will be updated. |
253 will be updated. |