9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
12 |
12 |
13 SimpleView subclass:#InspectorView |
13 SimpleView subclass:#InspectorView |
14 instanceVariableNames:'listView workspace inspectedObject selectedLine nShown hasMore |
14 instanceVariableNames:'listView labelView workspace inspectedObject selectedLine nShown |
15 monitorProcess' |
15 hasMore monitorProcess hideReceiver' |
16 classVariableNames:'DefaultIcon' |
16 classVariableNames:'DefaultIcon' |
17 poolDictionaries:'' |
17 poolDictionaries:'' |
18 category:'Interface-Inspector' |
18 category:'Interface-Inspector' |
19 ! |
19 ! |
20 |
20 |
21 !InspectorView class methodsFor:'documentation'! |
21 !InspectorView class methodsFor:'documentation'! |
22 |
22 |
23 copyright |
23 copyright |
24 " |
24 " |
25 COPYRIGHT (c) 1989 by Claus Gittinger |
25 COPYRIGHT (c) 1989 by Claus Gittinger |
26 All Rights Reserved |
26 All Rights Reserved |
154 |
154 |
155 "Created: 1.3.1996 / 19:30:50 / cg" |
155 "Created: 1.3.1996 / 19:30:50 / cg" |
156 "Modified: 1.3.1996 / 19:35:19 / cg" |
156 "Modified: 1.3.1996 / 19:35:19 / cg" |
157 ! ! |
157 ! ! |
158 |
158 |
159 !InspectorView class methodsFor:'defaults'! |
159 !InspectorView class methodsFor:'defaults'! |
160 |
160 |
161 defaultIcon |
161 defaultIcon |
162 DefaultIcon isNil ifTrue:[ |
162 DefaultIcon isNil ifTrue:[ |
163 DefaultIcon := Form fromFile:'Inspector.xbm' resolution:100 |
163 DefaultIcon := Form fromFile:'Inspector.xbm' resolution:100 |
164 ]. |
164 ]. |
226 ! ! |
238 ! ! |
227 |
239 |
228 !InspectorView methodsFor:'initialization'! |
240 !InspectorView methodsFor:'initialization'! |
229 |
241 |
230 initialize |
242 initialize |
231 |v panel| |
243 |v panel helpView labelView2| |
232 |
244 |
233 super initialize. |
245 super initialize. |
234 |
246 |
|
247 hideReceiver := false. |
|
248 |
235 panel := VariableHorizontalPanel |
249 panel := VariableHorizontalPanel |
236 origin:(0.0 @ 0.0) |
250 origin:(0.0 @ 0.0) |
237 corner:(1.0 @ 1.0) |
251 corner:(1.0 @ 1.0) |
238 in:self. |
252 in:self. |
|
253 |
|
254 helpView := View origin:(0.0 @ 0.0) corner:(0.3 @ 1.0) in:panel. |
|
255 helpView level:0; borderWidth:0. |
|
256 |
|
257 labelView := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView. |
|
258 labelView label:'instVars'. |
|
259 labelView bottomInset:(labelView preferredExtent y negated). |
239 |
260 |
240 v := HVScrollableView |
261 v := HVScrollableView |
241 for:SelectionInListView |
262 for:SelectionInListView |
242 miniScrollerH:true |
263 miniScrollerH:true |
243 miniScrollerV:false |
264 miniScrollerV:false |
244 in:panel. |
265 in:helpView. |
245 v origin:(0.0 @ 0.0) corner:(0.3 @ 1.0). |
266 v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
267 v topInset:(labelView preferredExtent y). |
246 |
268 |
247 listView := v scrolledView. |
269 listView := v scrolledView. |
248 listView action:[:lineNr | self showSelection:lineNr]. |
270 listView action:[:lineNr | self showSelection:lineNr]. |
249 listView doubleClickAction:[:lineNr | self doInspect]. |
271 listView doubleClickAction:[:lineNr | self doInspect]. |
250 listView ignoreReselect:false. |
272 listView ignoreReselect:false. |
251 listView menuHolder:self; menuPerformer:self; menuMessage:#fieldMenu. |
273 listView menuHolder:self; menuPerformer:self; menuMessage:#fieldMenu. |
252 |
274 |
|
275 helpView := View origin:(0.3 @ 0.0) corner:(1.0 @ 1.0) in:panel. |
|
276 helpView level:0; borderWidth:0. |
|
277 |
|
278 labelView2 := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView. |
|
279 labelView2 label:''. |
|
280 labelView2 bottomInset:(labelView preferredExtent y negated). |
|
281 |
253 v := HVScrollableView |
282 v := HVScrollableView |
254 for:CodeView |
283 for:CodeView |
255 miniScrollerH:true |
284 miniScrollerH:true |
256 miniScrollerV:false |
285 miniScrollerV:false |
257 in:panel. |
286 in:helpView. |
258 v origin:(0.3 @ 0.0) corner:(1.0 @ 1.0). |
287 v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
288 v topInset:(labelView2 preferredExtent y). |
259 workspace := v scrolledView. |
289 workspace := v scrolledView. |
260 |
290 |
261 workspace acceptAction:[:theText | self doAccept:theText asString]. |
291 workspace acceptAction:[:theText | self doAccept:theText asString]. |
262 |
292 |
263 nShown := 100. |
293 nShown := 100. |
264 hasMore := false. |
294 hasMore := false. |
|
295 |
|
296 "Modified: 28.6.1996 / 15:32:32 / cg" |
265 ! |
297 ! |
266 |
298 |
267 realize |
299 realize |
268 "delayed setup of lists till first map-time - |
300 "delayed setup of lists till first map-time - |
269 this makes startup of inspectors a bit faster" |
301 this makes startup of inspectors a bit faster" |
562 Leave hasMore as true, if a '...' entry should be added." |
594 Leave hasMore as true, if a '...' entry should be added." |
563 |
595 |
564 |aList n cls s| |
596 |aList n cls s| |
565 |
597 |
566 aList := OrderedCollection new. |
598 aList := OrderedCollection new. |
567 aList add:'self'. |
599 hideReceiver ifFalse:[aList add:'self']. |
568 cls := inspectedObject class. |
600 cls := inspectedObject class. |
569 cls allInstVarNames do:[:instVarName | |
601 cls allInstVarNames do:[:instVarName | |
570 aList add:instVarName |
602 aList add:instVarName |
571 ]. |
603 ]. |
572 |
604 |
730 |
763 |
731 "Created: 1.3.1996 / 19:31:45 / cg" |
764 "Created: 1.3.1996 / 19:31:45 / cg" |
732 "Modified: 26.5.1996 / 15:03:30 / cg" |
765 "Modified: 26.5.1996 / 15:03:30 / cg" |
733 ! |
766 ! |
734 |
767 |
|
768 showLast |
|
769 "user clicked on an instvar - show value in workspace" |
|
770 |
|
771 self showSelection:(listView list size). |
|
772 listView selection:(listView list size). |
|
773 |
|
774 "Created: 28.6.1996 / 15:06:38 / cg" |
|
775 "Modified: 28.6.1996 / 15:34:08 / cg" |
|
776 ! |
|
777 |
735 showSelection:lineNr |
778 showSelection:lineNr |
736 "user clicked on an instvar - show value in workspace" |
779 "user clicked on an instvar - show value in workspace" |
737 |
780 |
738 |val string| |
781 |val string| |
739 |
782 |
741 "clicked on the '...' entry" |
784 "clicked on the '...' entry" |
742 self showMore. |
785 self showMore. |
743 listView setSelection:lineNr. |
786 listView setSelection:lineNr. |
744 ]. |
787 ]. |
745 |
788 |
746 (self hasSelfEntry and:[lineNr == 1]) ifTrue:[ |
789 hideReceiver ifFalse:[ |
747 "selecting self also does a re-set, this allows updating the list" |
790 (self hasSelfEntry and:[lineNr == 1]) ifTrue:[ |
748 self inspect:inspectedObject. |
791 "selecting self also does a re-set, this allows updating the list" |
|
792 self inspect:inspectedObject. |
|
793 ]. |
749 ]. |
794 ]. |
750 val := self valueAtLine:lineNr. |
795 val := self valueAtLine:lineNr. |
751 self showValue:val. |
796 self showValue:val. |
752 selectedLine := lineNr. |
797 selectedLine := lineNr. |
753 |
798 |
754 "Modified: 25.5.1996 / 12:27:14 / cg" |
799 "Modified: 28.6.1996 / 15:13:29 / cg" |
755 ! |
800 ! |
756 |
801 |
757 showValue:someValue |
802 showValue:someValue |
758 "user clicked on an entry - show value in workspace" |
803 "user clicked on an entry - show value in workspace" |
759 |
804 |
779 valueAtLine:lineNr |
824 valueAtLine:lineNr |
780 "helper - return the value of the selected entry" |
825 "helper - return the value of the selected entry" |
781 |
826 |
782 |index instSize| |
827 |index instSize| |
783 |
828 |
784 (lineNr isNil or:[lineNr == 1]) ifTrue:[ |
829 hideReceiver ifFalse:[ |
785 ^ inspectedObject |
830 (lineNr isNil or:[lineNr == 1]) ifTrue:[ |
786 ]. |
831 ^ inspectedObject |
787 index := lineNr - 1. "/ skip self |
832 ]. |
|
833 index := lineNr - 1. "/ skip self |
|
834 ] ifTrue:[ |
|
835 index := lineNr |
|
836 ]. |
|
837 |
788 instSize := inspectedObject class instSize. |
838 instSize := inspectedObject class instSize. |
789 |
839 |
790 (inspectedObject class isVariable not |
840 (inspectedObject class isVariable not |
791 or:[index <= instSize]) ifTrue:[ |
841 or:[index <= instSize]) ifTrue:[ |
792 ^ inspectedObject instVarAt:index |
842 ^ inspectedObject instVarAt:index |
793 ]. |
843 ]. |
794 index := index - instSize. |
844 index := index - instSize. |
795 ^ inspectedObject basicAt:index |
845 ^ inspectedObject basicAt:index |
796 |
846 |
797 "Modified: 7.6.1996 / 20:05:40 / cg" |
847 "Modified: 28.6.1996 / 15:11:27 / cg" |
798 ! ! |
848 ! ! |
799 |
849 |
800 !InspectorView class methodsFor:'documentation'! |
850 !InspectorView class methodsFor:'documentation'! |
801 |
851 |
802 version |
852 version |
803 ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.52 1996-06-13 15:26:28 cg Exp $' |
853 ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.53 1996-06-28 13:51:15 cg Exp $' |
804 ! ! |
854 ! ! |