2300
|
1 |
"{ Package: 'stx:libtool2' }"
|
|
2 |
|
|
3 |
FlyByHelp subclass:#FlyByWindowInformation
|
|
4 |
instanceVariableNames:'lastApplication lastView cleanupAction finishSemaphore'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Interface-Help'
|
|
8 |
!
|
|
9 |
|
|
10 |
!FlyByWindowInformation class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
examples
|
|
13 |
"
|
|
14 |
self shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
15 |
"
|
|
16 |
!
|
|
17 |
|
|
18 |
shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
19 |
self start waitUntilFinished
|
|
20 |
|
|
21 |
"
|
|
22 |
self shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
23 |
"
|
|
24 |
! !
|
|
25 |
|
|
26 |
!FlyByWindowInformation methodsFor:'accessing'!
|
|
27 |
|
|
28 |
cleanupAction:something
|
|
29 |
cleanupAction := something.
|
|
30 |
!
|
|
31 |
|
|
32 |
lastApplication
|
|
33 |
^ lastApplication
|
|
34 |
!
|
|
35 |
|
|
36 |
lastView
|
|
37 |
^ lastView
|
|
38 |
! !
|
|
39 |
|
|
40 |
!FlyByWindowInformation methodsFor:'event handling'!
|
|
41 |
|
|
42 |
buttonMotion:state x:x y:y view:aView
|
|
43 |
super buttonMotion:state x:x y:y view:aView.
|
|
44 |
^ true
|
|
45 |
!
|
|
46 |
|
|
47 |
buttonPress:button x:x y:y view:aView
|
|
48 |
self stop.
|
|
49 |
^ true
|
|
50 |
!
|
|
51 |
|
|
52 |
keyPress:key x:x y:y view:aView
|
|
53 |
|obj action|
|
|
54 |
|
|
55 |
key == #Escape ifTrue:[
|
|
56 |
self stop.
|
|
57 |
^ true
|
|
58 |
].
|
|
59 |
|
|
60 |
key asLowercase == $a ifTrue:[
|
|
61 |
obj := lastApplication
|
|
62 |
].
|
2314
|
63 |
key asLowercase == $o ifTrue:[
|
|
64 |
obj := lastView model
|
|
65 |
].
|
2300
|
66 |
key asLowercase == $m ifTrue:[
|
|
67 |
obj := lastApplication masterApplication
|
|
68 |
].
|
|
69 |
key asLowercase == $v ifTrue:[
|
|
70 |
obj := lastView
|
|
71 |
].
|
|
72 |
key asLowercase == $t ifTrue:[
|
|
73 |
obj := lastView topView
|
|
74 |
].
|
|
75 |
obj notNil ifTrue:[
|
|
76 |
key isLowercase ifTrue:[
|
|
77 |
action := [ obj inspect ].
|
|
78 |
] ifFalse:[
|
|
79 |
action := [ obj browse ].
|
|
80 |
].
|
|
81 |
action forkAt:8.
|
|
82 |
].
|
|
83 |
|
|
84 |
^ true
|
|
85 |
! !
|
|
86 |
|
|
87 |
!FlyByWindowInformation methodsFor:'help texts'!
|
|
88 |
|
|
89 |
helpTextFor:aView at:aPointOrNil
|
|
90 |
lastView := aView.
|
|
91 |
lastApplication := aView application.
|
|
92 |
|
|
93 |
^ String streamContents:[:s |
|
2314
|
94 |
|topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect|
|
|
95 |
|
2300
|
96 |
aView topView ~~ aView ifTrue:[
|
2314
|
97 |
topViewToInspect := aView topView.
|
2300
|
98 |
].
|
|
99 |
lastApplication notNil ifTrue:[
|
2314
|
100 |
applicationToInspect := lastApplication.
|
|
101 |
masterApplicationToInspect := lastApplication masterApplication.
|
|
102 |
].
|
|
103 |
aView model notNil ifTrue:[
|
|
104 |
modelToInspect := aView model.
|
|
105 |
((modelToInspect == applicationToInspect)
|
|
106 |
or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
|
|
107 |
modelToInspect := nil.
|
2300
|
108 |
].
|
|
109 |
].
|
2314
|
110 |
|
|
111 |
|
|
112 |
s nextPutLine:('View: ' , aView class name).
|
|
113 |
modelToInspect notNil ifTrue:[
|
|
114 |
s nextPutLine:('Model: ' , modelToInspect class name).
|
|
115 |
].
|
|
116 |
topViewToInspect notNil ifTrue:[
|
|
117 |
s nextPutLine:('Topview: ' , topViewToInspect class name).
|
|
118 |
].
|
|
119 |
applicationToInspect notNil ifTrue:[
|
|
120 |
s nextPutLine:('Application: ' , applicationToInspect class name).
|
|
121 |
].
|
|
122 |
masterApplicationToInspect notNil ifTrue:[
|
|
123 |
s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
|
|
124 |
].
|
|
125 |
|
2300
|
126 |
s cr.
|
|
127 |
s nextPutLine:'Press:'.
|
|
128 |
s nextPutLine:' v to inspect view (V to browse)'.
|
2314
|
129 |
modelToInspect notNil ifTrue:[
|
|
130 |
s nextPutLine:' o to inspect model (O to browse)'.
|
|
131 |
].
|
|
132 |
topViewToInspect notNil ifTrue:[
|
2300
|
133 |
s nextPutLine:' t to inspect topView (T to browse)'.
|
|
134 |
].
|
2314
|
135 |
applicationToInspect notNil ifTrue:[
|
2300
|
136 |
s nextPutLine:' a to inspect application (A to browse)'.
|
2314
|
137 |
masterApplicationToInspect notNil ifTrue:[
|
2300
|
138 |
s nextPutLine:' m to inspect masterApplication (M to browse)'.
|
|
139 |
].
|
|
140 |
].
|
|
141 |
s nextPutAll:' ESC or button to leave'.
|
|
142 |
]
|
|
143 |
|
|
144 |
"
|
|
145 |
self shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
146 |
"
|
|
147 |
! !
|
|
148 |
|
|
149 |
!FlyByWindowInformation methodsFor:'queries'!
|
|
150 |
|
|
151 |
toolTipFollowsMouse
|
|
152 |
^ true
|
|
153 |
! !
|
|
154 |
|
|
155 |
!FlyByWindowInformation methodsFor:'start & stop'!
|
|
156 |
|
|
157 |
start
|
|
158 |
|l|
|
|
159 |
|
|
160 |
l := FlyByHelp currentHelpListener.
|
|
161 |
l notNil ifTrue:[
|
|
162 |
FlyByHelp stop.
|
|
163 |
cleanupAction := [ FlyByHelp start ].
|
|
164 |
].
|
|
165 |
finishSemaphore := Semaphore new.
|
|
166 |
super start.
|
|
167 |
!
|
|
168 |
|
|
169 |
stop
|
|
170 |
super stop.
|
|
171 |
cleanupAction value.
|
|
172 |
finishSemaphore notNil ifTrue:[
|
|
173 |
finishSemaphore signalIf.
|
|
174 |
].
|
|
175 |
!
|
|
176 |
|
|
177 |
waitUntilFinished
|
|
178 |
finishSemaphore wait.
|
|
179 |
! !
|
|
180 |
|
|
181 |
!FlyByWindowInformation class methodsFor:'documentation'!
|
|
182 |
|
|
183 |
version
|
|
184 |
^ '$Header$'
|
|
185 |
! !
|