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
|
|
15 |
instanceVariableNames:'lastApplication lastView cleanupAction finishSemaphore'
|
|
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 |
|
|
53 |
cleanupAction:something
|
|
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
|
|
74 |
super buttonMotion:buttonAndModifierState x:x y:y view:aView.
|
2300
|
75 |
^ true
|
|
76 |
!
|
|
77 |
|
|
78 |
buttonPress:button x:x y:y view:aView
|
|
79 |
self stop.
|
|
80 |
^ true
|
|
81 |
!
|
|
82 |
|
|
83 |
keyPress:key x:x y:y view:aView
|
2435
|
84 |
|obj action lcKey|
|
2300
|
85 |
|
|
86 |
key == #Escape ifTrue:[
|
|
87 |
self stop.
|
|
88 |
^ true
|
|
89 |
].
|
|
90 |
|
2435
|
91 |
key == $? ifTrue:[
|
|
92 |
[
|
|
93 |
WindowTreeView openOn:(lastView topView) initialSelection:lastView.
|
|
94 |
] fork.
|
|
95 |
self stop.
|
|
96 |
^ true.
|
2300
|
97 |
].
|
2435
|
98 |
|
|
99 |
key isCharacter ifTrue:[
|
|
100 |
lcKey := key asLowercase.
|
|
101 |
|
|
102 |
lcKey == $a ifTrue:[
|
|
103 |
obj := lastApplication
|
|
104 |
].
|
|
105 |
lcKey == $o ifTrue:[
|
|
106 |
obj := lastView model
|
|
107 |
].
|
|
108 |
lcKey == $m ifTrue:[
|
|
109 |
obj := lastApplication masterApplication
|
2300
|
110 |
].
|
2435
|
111 |
lcKey == $v ifTrue:[
|
|
112 |
obj := lastView
|
|
113 |
].
|
|
114 |
lcKey == $t ifTrue:[
|
|
115 |
obj := lastView topView
|
|
116 |
].
|
|
117 |
obj notNil ifTrue:[
|
|
118 |
key isLowercase ifTrue:[
|
|
119 |
action := [ obj inspect ].
|
|
120 |
] ifFalse:[
|
|
121 |
action := [ obj browse ].
|
|
122 |
].
|
|
123 |
action forkAt:8.
|
|
124 |
].
|
2300
|
125 |
].
|
|
126 |
|
|
127 |
^ true
|
|
128 |
! !
|
|
129 |
|
|
130 |
!FlyByWindowInformation methodsFor:'help texts'!
|
|
131 |
|
|
132 |
helpTextFor:aView at:aPointOrNil
|
|
133 |
lastView := aView.
|
|
134 |
lastApplication := aView application.
|
|
135 |
|
|
136 |
^ String streamContents:[:s |
|
2314
|
137 |
|topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect|
|
|
138 |
|
2300
|
139 |
aView topView ~~ aView ifTrue:[
|
2314
|
140 |
topViewToInspect := aView topView.
|
2300
|
141 |
].
|
|
142 |
lastApplication notNil ifTrue:[
|
2314
|
143 |
applicationToInspect := lastApplication.
|
|
144 |
masterApplicationToInspect := lastApplication masterApplication.
|
|
145 |
].
|
|
146 |
aView model notNil ifTrue:[
|
|
147 |
modelToInspect := aView model.
|
|
148 |
((modelToInspect == applicationToInspect)
|
|
149 |
or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
|
|
150 |
modelToInspect := nil.
|
2300
|
151 |
].
|
|
152 |
].
|
2314
|
153 |
|
2352
|
154 |
s nextPutLine:('View: ' , aView class name, ' "',aView name printString,'"').
|
2314
|
155 |
modelToInspect notNil ifTrue:[
|
|
156 |
s nextPutLine:('Model: ' , modelToInspect class name).
|
|
157 |
].
|
|
158 |
topViewToInspect notNil ifTrue:[
|
|
159 |
s nextPutLine:('Topview: ' , topViewToInspect class name).
|
|
160 |
].
|
|
161 |
applicationToInspect notNil ifTrue:[
|
|
162 |
s nextPutLine:('Application: ' , applicationToInspect class name).
|
|
163 |
].
|
|
164 |
masterApplicationToInspect notNil ifTrue:[
|
|
165 |
s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
|
|
166 |
].
|
|
167 |
|
2300
|
168 |
s cr.
|
|
169 |
s nextPutLine:'Press:'.
|
2435
|
170 |
s nextPutLine:' ? to show the viewtree'.
|
2300
|
171 |
s nextPutLine:' v to inspect view (V to browse)'.
|
2314
|
172 |
modelToInspect notNil ifTrue:[
|
|
173 |
s nextPutLine:' o to inspect model (O to browse)'.
|
|
174 |
].
|
|
175 |
topViewToInspect notNil ifTrue:[
|
2300
|
176 |
s nextPutLine:' t to inspect topView (T to browse)'.
|
|
177 |
].
|
2314
|
178 |
applicationToInspect notNil ifTrue:[
|
2300
|
179 |
s nextPutLine:' a to inspect application (A to browse)'.
|
2314
|
180 |
masterApplicationToInspect notNil ifTrue:[
|
2300
|
181 |
s nextPutLine:' m to inspect masterApplication (M to browse)'.
|
|
182 |
].
|
|
183 |
].
|
2493
|
184 |
s nextPutAll:'ESC or button to leave flyBy-info mode.'.
|
2300
|
185 |
]
|
|
186 |
|
|
187 |
"
|
|
188 |
self shownInformationOfViewUnderMouseUntilButtonIsPressed
|
|
189 |
"
|
|
190 |
! !
|
|
191 |
|
|
192 |
!FlyByWindowInformation methodsFor:'queries'!
|
|
193 |
|
|
194 |
toolTipFollowsMouse
|
|
195 |
^ true
|
|
196 |
! !
|
|
197 |
|
|
198 |
!FlyByWindowInformation methodsFor:'start & stop'!
|
|
199 |
|
|
200 |
start
|
|
201 |
|l|
|
|
202 |
|
|
203 |
l := FlyByHelp currentHelpListener.
|
|
204 |
l notNil ifTrue:[
|
|
205 |
FlyByHelp stop.
|
|
206 |
cleanupAction := [ FlyByHelp start ].
|
|
207 |
].
|
|
208 |
finishSemaphore := Semaphore new.
|
|
209 |
super start.
|
|
210 |
!
|
|
211 |
|
|
212 |
stop
|
|
213 |
super stop.
|
|
214 |
cleanupAction value.
|
|
215 |
finishSemaphore notNil ifTrue:[
|
|
216 |
finishSemaphore signalIf.
|
|
217 |
].
|
|
218 |
!
|
|
219 |
|
|
220 |
waitUntilFinished
|
|
221 |
finishSemaphore wait.
|
|
222 |
! !
|
|
223 |
|
|
224 |
!FlyByWindowInformation class methodsFor:'documentation'!
|
|
225 |
|
|
226 |
version
|
|
227 |
^ '$Header$'
|
2587
|
228 |
!
|
|
229 |
|
|
230 |
version_CVS
|
|
231 |
^ '$Header$'
|
2300
|
232 |
! !
|