141 |
141 |
142 "Created: / 19-07-2019 / 15:03:17 / Claus Gittinger" |
142 "Created: / 19-07-2019 / 15:03:17 / Claus Gittinger" |
143 "Modified: / 19-07-2019 / 16:13:33 / Claus Gittinger" |
143 "Modified: / 19-07-2019 / 16:13:33 / Claus Gittinger" |
144 ! |
144 ! |
145 |
145 |
|
146 raise:what |
|
147 <action> |
|
148 |
|
149 verifying ifTrue:[^ self]. |
|
150 |
|
151 what == #application ifTrue:[ |
|
152 application topView raise. |
|
153 ^ self |
|
154 ]. |
|
155 what == #masterApplication ifTrue:[ |
|
156 application windowGroup isModal ifTrue:[ |
|
157 application windowGroup mainGroup topViews first raise |
|
158 ] ifFalse:[ |
|
159 (application masterApplication ? application) topViews first raise. |
|
160 ]. |
|
161 ^ self |
|
162 ]. |
|
163 self halt. |
|
164 ! |
|
165 |
146 show:message |
166 show:message |
147 "showing (and speak) some message." |
167 "showing (and speak) some message." |
148 |
168 |
149 <action> |
169 <action> |
150 |
170 |
151 self showing:message do:nil |
171 self showing:message saying:nil do:nil |
152 |
172 |
153 "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger" |
173 "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger" |
154 "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger" |
174 "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger" |
155 ! |
175 ! |
156 |
176 |
163 self wait:seconds. |
183 self wait:seconds. |
164 |
184 |
165 "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger" |
185 "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger" |
166 ! |
186 ! |
167 |
187 |
|
188 show:message saying:sentenceOrNil |
|
189 "showing (and speak) some message." |
|
190 |
|
191 <action> |
|
192 |
|
193 self showing:message saying:sentenceOrNil do:nil |
|
194 |
|
195 "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger" |
|
196 "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger" |
|
197 ! |
|
198 |
|
199 show:message saying:sentenceOrNil for:seconds |
|
200 "showing (and speak) some message and wait for some time." |
|
201 |
|
202 <action> |
|
203 |
|
204 self show:message saying:sentenceOrNil. |
|
205 self wait:seconds. |
|
206 |
|
207 "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger" |
|
208 ! |
|
209 |
168 showing:message do:operationsOrNothing |
210 showing:message do:operationsOrNothing |
|
211 "execute operationsOrNothing while showing (and speaking) some message." |
|
212 |
|
213 <action> |
|
214 |
|
215 self showing:message saying:nil do:operationsOrNothing |
|
216 ! |
|
217 |
|
218 showing:message saying:sentenceOrNil do:operationsOrNothing |
169 "execute operationsOrNothing while showing (and speaking) some message." |
219 "execute operationsOrNothing while showing (and speaking) some message." |
170 |
220 |
171 <action> |
221 <action> |
172 |
222 |
173 |xLatedMessage messageView talkDone| |
223 |xLatedMessage messageView talkDone| |
323 |
375 |
324 |component| |
376 |component| |
325 |
377 |
326 component := self componentNamed:componentName. |
378 component := self componentNamed:componentName. |
327 self movePointerToComponent:component. |
379 self movePointerToComponent:component. |
|
380 Display ctrlDown ifTrue:[^ self]. |
328 self circlePointerAroundComponent:component. |
381 self circlePointerAroundComponent:component. |
329 |
382 |
330 "Created: / 19-07-2019 / 11:20:42 / Claus Gittinger" |
383 "Created: / 19-07-2019 / 11:20:42 / Claus Gittinger" |
331 "Modified: / 19-07-2019 / 15:38:11 / Claus Gittinger" |
384 "Modified: / 19-07-2019 / 15:38:11 / Claus Gittinger" |
332 ! |
385 ! |
459 type:aString |
512 type:aString |
460 "enter text into the last component" |
513 "enter text into the last component" |
461 |
514 |
462 <action> |
515 <action> |
463 |
516 |
|
517 |t| |
|
518 |
464 verifying ifTrue:[^ self]. |
519 verifying ifTrue:[^ self]. |
465 |
520 |
466 lastComponent simulateTextInput:aString at:(lastComponent extent // 2) sendDisplayEvent:false |
521 t := Display ctrlDown ifTrue:[0.05] ifFalse:[0.1]. |
|
522 lastComponent |
|
523 simulateTextInput:aString at:(lastComponent extent // 2) |
|
524 sendDisplayEvent:false keyPressTime:t |
467 |
525 |
468 "Created: / 19-07-2019 / 15:50:40 / Claus Gittinger" |
526 "Created: / 19-07-2019 / 15:50:40 / Claus Gittinger" |
469 ! ! |
527 ! ! |
470 |
528 |
471 !ShowMeHowItWorks methodsFor:'defaults'! |
529 !ShowMeHowItWorks methodsFor:'defaults'! |
636 |
694 |
637 findComponent:componentName |
695 findComponent:componentName |
638 "find a component by name - in the active and possibly in any app. |
696 "find a component by name - in the active and possibly in any app. |
639 Can return either a view or a menu item" |
697 Can return either a view or a menu item" |
640 |
698 |
641 |component candidates| |
699 |component candidates modalGroup| |
642 |
700 |
643 application notNil ifTrue:[ |
701 application notNil ifTrue:[ |
644 component := self findComponent:componentName in:application. |
702 component := self findComponent:componentName in:application. |
645 ]. |
703 ]. |
646 |
|
647 component isNil ifTrue:[ |
704 component isNil ifTrue:[ |
|
705 candidates := OrderedCollection new. |
|
706 |
|
707 "/ is there a modal dialog open for the app? |
|
708 (modalGroup := application windowGroup modalGroup) notNil ifTrue:[ |
|
709 modalGroup topViews do:[:eachModalTopView | |
|
710 component := self findComponent:componentName in:eachModalTopView. |
|
711 component notNil ifTrue:[ |
|
712 candidates add:component |
|
713 ]. |
|
714 ]. |
|
715 candidates size == 1 ifTrue:[ |
|
716 ^ candidates first |
|
717 ]. |
|
718 ]. |
|
719 |
648 "/ search through all current applications |
720 "/ search through all current applications |
649 candidates := OrderedCollection new. |
|
650 WindowGroup scheduledWindowGroups do:[:eachWG | |
721 WindowGroup scheduledWindowGroups do:[:eachWG | |
651 |eachApp| |
722 |eachApp| |
652 |
723 |
653 (eachApp := eachWG application) notNil ifTrue:[ |
724 (eachApp := eachWG application) notNil ifTrue:[ |
654 component := self findComponent:componentName in:eachApp. |
725 component := self findComponent:componentName in:eachApp. |