2587
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
2300
|
12 |
"{ Package: 'stx:libtool2' }"
|
|
13 |
|
|
14 |
FlyByHelp subclass:#FlyByWindowInformation
|
2699
|
15 |
instanceVariableNames:'lastApplication lastView cleanupAction finishSemaphore finished'
|
2300
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'Interface-Help'
|
|
19 |
!
|
|
20 |
|
|
21 |
!FlyByWindowInformation class methodsFor:'documentation'!
|
|
22 |
|
2587
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 2008 by eXept Software AG
|
|
26 |
All Rights Reserved
|
|
27 |
|
|
28 |
This software is furnished under a license and may be used
|
|
29 |
only in accordance with the terms of that license and with the
|
|
30 |
inclusion of the above copyright notice. This software may not
|
|
31 |
be provided or otherwise made available to, or used by, any
|
|
32 |
other person. No title to or ownership of the software is
|
|
33 |
hereby transferred.
|
|
34 |
"
|
|
35 |
!
|
|
36 |
|
2300
|
37 |
examples
|
|
38 |
"
|
|
39 |
self shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
40 |
"
|
|
41 |
!
|
|
42 |
|
|
43 |
shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
44 |
self start waitUntilFinished
|
|
45 |
|
|
46 |
"
|
|
47 |
self shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
48 |
"
|
|
49 |
! !
|
|
50 |
|
|
51 |
!FlyByWindowInformation methodsFor:'accessing'!
|
|
52 |
|
2699
|
53 |
cleanupAction:something
|
2300
|
54 |
cleanupAction := something.
|
|
55 |
!
|
|
56 |
|
|
57 |
lastApplication
|
|
58 |
^ lastApplication
|
|
59 |
!
|
|
60 |
|
|
61 |
lastView
|
|
62 |
^ lastView
|
|
63 |
! !
|
|
64 |
|
2543
|
65 |
!FlyByWindowInformation methodsFor:'defaults'!
|
|
66 |
|
|
67 |
flyByHelpTimeoutMillis
|
|
68 |
^ 1000
|
|
69 |
! !
|
|
70 |
|
2300
|
71 |
!FlyByWindowInformation methodsFor:'event handling'!
|
|
72 |
|
2340
|
73 |
buttonMotion:buttonAndModifierState x:x y:y view:aView
|
2699
|
74 |
finished == true ifTrue:[self halt].
|
2340
|
75 |
super buttonMotion:buttonAndModifierState x:x y:y view:aView.
|
2300
|
76 |
^ true
|
|
77 |
!
|
|
78 |
|
|
79 |
buttonPress:button x:x y:y view:aView
|
|
80 |
self stop.
|
|
81 |
^ true
|
|
82 |
!
|
|
83 |
|
2699
|
84 |
handleMouseIn:aView x:x y:y
|
|
85 |
|
|
86 |
finished == true ifTrue:[self halt].
|
|
87 |
super handleMouseIn:aView x:x y:y
|
|
88 |
!
|
|
89 |
|
2300
|
90 |
keyPress:key x:x y:y view:aView
|
2435
|
91 |
|obj action lcKey|
|
2300
|
92 |
|
|
93 |
key == #Escape ifTrue:[
|
|
94 |
self stop.
|
|
95 |
^ true
|
|
96 |
].
|
|
97 |
|
2435
|
98 |
key == $? ifTrue:[
|
|
99 |
[
|
|
100 |
WindowTreeView openOn:(lastView topView) initialSelection:lastView.
|
|
101 |
] fork.
|
|
102 |
self stop.
|
|
103 |
^ true.
|
2300
|
104 |
].
|
2435
|
105 |
|
|
106 |
key isCharacter ifTrue:[
|
|
107 |
lcKey := key asLowercase.
|
|
108 |
|
|
109 |
lcKey == $a ifTrue:[
|
|
110 |
obj := lastApplication
|
|
111 |
].
|
|
112 |
lcKey == $o ifTrue:[
|
|
113 |
obj := lastView model
|
|
114 |
].
|
|
115 |
lcKey == $m ifTrue:[
|
|
116 |
obj := lastApplication masterApplication
|
2300
|
117 |
].
|
2435
|
118 |
lcKey == $v ifTrue:[
|
|
119 |
obj := lastView
|
|
120 |
].
|
|
121 |
lcKey == $t ifTrue:[
|
|
122 |
obj := lastView topView
|
|
123 |
].
|
|
124 |
obj notNil ifTrue:[
|
|
125 |
key isLowercase ifTrue:[
|
|
126 |
action := [ obj inspect ].
|
|
127 |
] ifFalse:[
|
|
128 |
action := [ obj browse ].
|
|
129 |
].
|
|
130 |
action forkAt:8.
|
|
131 |
].
|
2300
|
132 |
].
|
|
133 |
|
|
134 |
^ true
|
|
135 |
! !
|
|
136 |
|
|
137 |
!FlyByWindowInformation methodsFor:'help texts'!
|
|
138 |
|
|
139 |
helpTextFor:aView at:aPointOrNil
|
2699
|
140 |
"generate the text to be shown as popup-flyby info"
|
|
141 |
|
2300
|
142 |
lastView := aView.
|
|
143 |
lastApplication := aView application.
|
|
144 |
|
|
145 |
^ String streamContents:[:s |
|
2314
|
146 |
|topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect|
|
|
147 |
|
2300
|
148 |
aView topView ~~ aView ifTrue:[
|
2314
|
149 |
topViewToInspect := aView topView.
|
2300
|
150 |
].
|
|
151 |
lastApplication notNil ifTrue:[
|
2314
|
152 |
applicationToInspect := lastApplication.
|
|
153 |
masterApplicationToInspect := lastApplication masterApplication.
|
|
154 |
].
|
|
155 |
aView model notNil ifTrue:[
|
|
156 |
modelToInspect := aView model.
|
|
157 |
((modelToInspect == applicationToInspect)
|
|
158 |
or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
|
|
159 |
modelToInspect := nil.
|
2300
|
160 |
].
|
|
161 |
].
|
2314
|
162 |
|
2352
|
163 |
s nextPutLine:('View: ' , aView class name, ' "',aView name printString,'"').
|
2314
|
164 |
modelToInspect notNil ifTrue:[
|
|
165 |
s nextPutLine:('Model: ' , modelToInspect class name).
|
|
166 |
].
|
|
167 |
topViewToInspect notNil ifTrue:[
|
|
168 |
s nextPutLine:('Topview: ' , topViewToInspect class name).
|
|
169 |
].
|
|
170 |
applicationToInspect notNil ifTrue:[
|
|
171 |
s nextPutLine:('Application: ' , applicationToInspect class name).
|
|
172 |
].
|
|
173 |
masterApplicationToInspect notNil ifTrue:[
|
|
174 |
s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
|
|
175 |
].
|
|
176 |
|
2699
|
177 |
"/ identity it as component
|
|
178 |
masterApplicationToInspect "applicationToInspect" notNil ifTrue:[
|
|
179 |
masterApplicationToInspect "applicationToInspect" builder notNil ifTrue:[
|
|
180 |
|components v|
|
|
181 |
|
|
182 |
components := masterApplicationToInspect "applicationToInspect" builder namedComponents.
|
|
183 |
|
|
184 |
v := aView.
|
|
185 |
[ (components includes:v) not
|
|
186 |
and:[v container notNil]
|
|
187 |
] whileTrue:[
|
|
188 |
v := v container.
|
|
189 |
].
|
|
190 |
(components includes:v) ifTrue:[
|
|
191 |
|k|
|
|
192 |
|
|
193 |
k := components keyAtValue:v.
|
|
194 |
v == aView ifTrue:[
|
|
195 |
s nextPutLine:('Component: ' , k).
|
|
196 |
] ifFalse:[
|
|
197 |
s nextPutLine:('Subview of Component: ' , k).
|
|
198 |
].
|
|
199 |
].
|
|
200 |
]
|
|
201 |
].
|
|
202 |
|
2300
|
203 |
s cr.
|
|
204 |
s nextPutLine:'Press:'.
|
2435
|
205 |
s nextPutLine:' ? to show the viewtree'.
|
2300
|
206 |
s nextPutLine:' v to inspect view (V to browse)'.
|
2314
|
207 |
modelToInspect notNil ifTrue:[
|
|
208 |
s nextPutLine:' o to inspect model (O to browse)'.
|
|
209 |
].
|
|
210 |
topViewToInspect notNil ifTrue:[
|
2300
|
211 |
s nextPutLine:' t to inspect topView (T to browse)'.
|
|
212 |
].
|
2314
|
213 |
applicationToInspect notNil ifTrue:[
|
2300
|
214 |
s nextPutLine:' a to inspect application (A to browse)'.
|
2314
|
215 |
masterApplicationToInspect notNil ifTrue:[
|
2300
|
216 |
s nextPutLine:' m to inspect masterApplication (M to browse)'.
|
|
217 |
].
|
|
218 |
].
|
2493
|
219 |
s nextPutAll:'ESC or button to leave flyBy-info mode.'.
|
2300
|
220 |
]
|
|
221 |
|
|
222 |
"
|
|
223 |
self shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
224 |
"
|
|
225 |
! !
|
|
226 |
|
|
227 |
!FlyByWindowInformation methodsFor:'queries'!
|
|
228 |
|
|
229 |
toolTipFollowsMouse
|
|
230 |
^ true
|
|
231 |
! !
|
|
232 |
|
|
233 |
!FlyByWindowInformation methodsFor:'start & stop'!
|
|
234 |
|
2699
|
235 |
initiateHelpFor:aView at:aPointOrNil
|
|
236 |
finished == true ifTrue:[self halt].
|
|
237 |
self initiateHelpFor:aView at:aPointOrNil now:true
|
|
238 |
!
|
|
239 |
|
|
240 |
initiateHelpFor:aView at:aPointOrNil now:showItNow
|
|
241 |
finished == true ifTrue:[self halt].
|
|
242 |
super initiateHelpFor:aView at:aPointOrNil now:showItNow
|
|
243 |
!
|
|
244 |
|
2300
|
245 |
start
|
|
246 |
|l|
|
|
247 |
|
2699
|
248 |
finished == true ifTrue:[self halt].
|
2300
|
249 |
l := FlyByHelp currentHelpListener.
|
|
250 |
l notNil ifTrue:[
|
|
251 |
FlyByHelp stop.
|
|
252 |
cleanupAction := [ FlyByHelp start ].
|
|
253 |
].
|
|
254 |
finishSemaphore := Semaphore new.
|
2699
|
255 |
finished := false.
|
2300
|
256 |
super start.
|
|
257 |
!
|
|
258 |
|
|
259 |
stop
|
2699
|
260 |
finished := true.
|
2300
|
261 |
super stop.
|
|
262 |
cleanupAction value.
|
|
263 |
finishSemaphore notNil ifTrue:[
|
|
264 |
finishSemaphore signalIf.
|
|
265 |
].
|
|
266 |
!
|
|
267 |
|
|
268 |
waitUntilFinished
|
|
269 |
finishSemaphore wait.
|
|
270 |
! !
|
|
271 |
|
|
272 |
!FlyByWindowInformation class methodsFor:'documentation'!
|
|
273 |
|
|
274 |
version
|
|
275 |
^ '$Header$'
|
2587
|
276 |
!
|
|
277 |
|
|
278 |
version_CVS
|
|
279 |
^ '$Header$'
|
2300
|
280 |
! !
|