288 |
298 |
289 (diagramEditor := lastComponent) isScrollWrapper ifTrue:[ |
299 (diagramEditor := lastComponent) isScrollWrapper ifTrue:[ |
290 diagramEditor := lastComponent scrolledView |
300 diagramEditor := lastComponent scrolledView |
291 ]. |
301 ]. |
292 pinPO := self pinPOForPin:pinName ofStep:stepName. |
302 pinPO := self pinPOForPin:pinName ofStep:stepName. |
|
303 pinPO isNil ifTrue:[ |
|
304 self error:('No pin named "%1" for step "%2" found in diagram' bindWith:pinName with:stepName). |
|
305 ^ self. |
|
306 ]. |
293 |
307 |
294 diagramEditor selection:{ pinPO }. |
308 diagramEditor selection:{ pinPO }. |
295 diagramEditor doubleClickOn:pinPO. |
309 diagramEditor doubleClickOn:pinPO. |
296 self fastMoveTo:(lastComponentName,'/','EditField'). |
310 self fastMoveTo:(lastComponentName,'/','EditField'). |
297 self click. |
311 self click. |
386 |
400 |
387 |newApplication| |
401 |newApplication| |
388 |
402 |
389 (newApplication := newApplicationOrName) isString ifTrue:[ |
403 (newApplication := newApplicationOrName) isString ifTrue:[ |
390 newApplication := self findApplication:newApplicationOrName ifMultiple:nil. |
404 newApplication := self findApplication:newApplicationOrName ifMultiple:nil. |
391 self assert: newApplication notNil. |
405 newApplication isNil ifTrue:[ |
|
406 self error:('Could not find an application named "%1" (to switch to)' bindWith:newApplicationOrName). |
|
407 ]. |
|
408 "/ self assert: newApplication notNil. |
392 ]. |
409 ]. |
393 |
410 |
394 applicationStack isNil ifTrue:[applicationStack := OrderedCollection new]. |
411 applicationStack isNil ifTrue:[applicationStack := OrderedCollection new]. |
395 |
412 |
396 applicationStack add:application. |
413 applicationStack add:application. |
429 count := 0. |
446 count := 0. |
430 [ |
447 [ |
431 Delay waitForSeconds:0.1. |
448 Delay waitForSeconds:0.1. |
432 pinPO := self pinPOForPin:pinName ofStep:stepName. |
449 pinPO := self pinPOForPin:pinName ofStep:stepName. |
433 ] doWhile:[pinPO isNil and:[ (count := count+1) < 20]]. |
450 ] doWhile:[pinPO isNil and:[ (count := count+1) < 20]]. |
434 |
451 pinPO isNil ifTrue:[ |
|
452 self error:('No pin named "%1" for step "%2" found in diagram' bindWith:pinName with:stepName). |
|
453 ^ self. |
|
454 ]. |
435 self movePointerToComponent:diagramEditor offset:(pinPO frame center). |
455 self movePointerToComponent:diagramEditor offset:(pinPO frame center). |
436 diagramEditor selection:{ pinPO }. |
456 diagramEditor selection:{ pinPO }. |
437 ! |
457 ! |
438 |
458 |
439 show:message |
459 show:message |
1110 ]. |
1130 ]. |
1111 ]. |
1131 ]. |
1112 |
1132 |
1113 (component isKindOf:NoteBookView) ifTrue:[ |
1133 (component isKindOf:NoteBookView) ifTrue:[ |
1114 (idx := itemsIndexOrLabelOrPattern) isInteger ifFalse:[ |
1134 (idx := itemsIndexOrLabelOrPattern) isInteger ifFalse:[ |
1115 idx := component list |
1135 idx := component tabList |
1116 findFirst:[:eachNotebookTab| |
1136 findFirst:[:eachNotebookTab| |
1117 eachNotebookTab label string = itemsIndexOrLabelOrPattern string |
1137 eachNotebookTab labelString string = itemsIndexOrLabelOrPattern string |
1118 or:[ eachNotebookTab printableLabel string = itemsIndexOrLabelOrPattern string ] |
1138 or:[ (eachNotebookTab printableLabel string = itemsIndexOrLabelOrPattern string) |
1119 ]. |
1139 or:[ eachNotebookTab label isString not |
|
1140 and:[eachNotebookTab label label = itemsIndexOrLabelOrPattern string ]]] |
|
1141 ]. |
|
1142 idx == 0 ifTrue:[ |
|
1143 self error:('No tab named "%1" found' with:itemsIndexOrLabelOrPattern string) |
|
1144 ]. |
1120 "/ idx := component indexOfTabNamed:itemsIndexOrLabelOrPattern |
1145 "/ idx := component indexOfTabNamed:itemsIndexOrLabelOrPattern |
1121 ]. |
1146 ]. |
1122 tab := component tabAtIndex:idx. |
1147 tab := component tabAtIndex:idx. |
1123 self movePointerToComponent:component offset:(tab layout center). |
1148 self movePointerToComponent:component offset:(tab layout center). |
1124 component selection:idx. |
1149 component selection:idx. |
1909 |
1934 |
1910 click:buttonNr inComponent:viewOrMenuItem clickTime:clickTime |
1935 click:buttonNr inComponent:viewOrMenuItem clickTime:clickTime |
1911 "press-release in a component" |
1936 "press-release in a component" |
1912 |
1937 |
1913 self withViewAndPositionFor:viewOrMenuItem do:[:viewToClick :clickPos | |
1938 self withViewAndPositionFor:viewOrMenuItem do:[:viewToClick :clickPos | |
|
1939 |clickDone| |
|
1940 |
|
1941 clickDone := false. |
1914 Display activePointerGrab == Display rootView ifTrue:[ |
1942 Display activePointerGrab == Display rootView ifTrue:[ |
1915 |pos| |
1943 |pos| |
1916 |
1944 |
1917 pos := Display translatePoint:clickPos fromView:viewToClick toView:nil. |
1945 pos := Display translatePoint:clickPos fromView:viewToClick toView:nil. |
1918 OperatingSystem isOSXlike ifTrue:[ |
1946 Error handle:[:ex | |
1919 OperatingSystem |
1947 ] do:[ |
1920 generateMouseMoveEventX:pos x y:pos y; |
1948 OperatingSystem isOSXlike ifTrue:[ |
1921 generateButtonEvent:buttonNr down:true x:pos x y:pos y; |
1949 OperatingSystem |
1922 yourself. |
1950 generateMouseMoveEventX:pos x y:pos y; |
|
1951 generateButtonEvent:buttonNr down:true x:pos x y:pos y; |
|
1952 yourself. |
|
1953 Delay waitForSeconds:clickTime. |
|
1954 OperatingSystem |
|
1955 generateButtonEvent:buttonNr down:false x:pos x y:pos y; |
|
1956 "/ generateButtonEvent:buttonNr down:true x:pos x y:pos y; |
|
1957 "/ generateButtonEvent:buttonNr down:false x:pos x y:pos y; |
|
1958 yourself. |
|
1959 ^ self. |
|
1960 ]. |
|
1961 Display rootView simulateButtonPress:buttonNr at:pos sendDisplayEvent:true. |
1923 Delay waitForSeconds:clickTime. |
1962 Delay waitForSeconds:clickTime. |
1924 OperatingSystem |
1963 Display rootView simulateButtonRelease:buttonNr at:pos sendDisplayEvent:true. |
1925 generateButtonEvent:buttonNr down:false x:pos x y:pos y; |
1964 clickDone := true. |
1926 "/ generateButtonEvent:buttonNr down:true x:pos x y:pos y; |
1965 ]. |
1927 "/ generateButtonEvent:buttonNr down:false x:pos x y:pos y; |
1966 ]. |
1928 yourself. |
1967 clickDone ifFalse:[ |
1929 ^ self. |
|
1930 ]. |
|
1931 Display rootView simulateButtonPress:buttonNr at:pos sendDisplayEvent:true. |
|
1932 Delay waitForSeconds:clickTime. |
|
1933 Display rootView simulateButtonRelease:buttonNr at:pos sendDisplayEvent:true. |
|
1934 ] ifFalse:[ |
|
1935 viewToClick simulateButtonPress:buttonNr at:clickPos sendDisplayEvent:false. |
1968 viewToClick simulateButtonPress:buttonNr at:clickPos sendDisplayEvent:false. |
1936 Delay waitForSeconds:clickTime. |
1969 Delay waitForSeconds:clickTime. |
1937 viewToClick simulateButtonRelease:buttonNr at:clickPos sendDisplayEvent:false. |
1970 viewToClick simulateButtonRelease:buttonNr at:clickPos sendDisplayEvent:false. |
1938 ]. |
1971 ]. |
1939 ]. |
1972 ]. |
2183 ]. |
2216 ]. |
2184 where == #bottomRight ifTrue:[ |
2217 where == #bottomRight ifTrue:[ |
2185 ^ aComponent bottomLeft - (5 @ 5) |
2218 ^ aComponent bottomLeft - (5 @ 5) |
2186 ]. |
2219 ]. |
2187 self error:'where is this' |
2220 self error:'where is this' |
|
2221 ! ! |
|
2222 |
|
2223 !ShowMeHowItWorks methodsFor:'initialization'! |
|
2224 |
|
2225 initialize |
|
2226 "Invoked when a new instance is created." |
|
2227 |
|
2228 "/ please change as required (and remove this comment) |
|
2229 "/ application := nil. |
|
2230 "/ opStream := nil. |
|
2231 "/ streamStack := nil. |
|
2232 "/ lastComponentName := nil. |
|
2233 "/ lastComponent := nil. |
|
2234 "/ lastResult := nil. |
|
2235 "/ voice := nil. |
|
2236 "/ translate := nil. |
|
2237 "/ language := nil. |
|
2238 verifying := false. |
|
2239 "/ closeApplicationWhenFinished := nil. |
|
2240 "/ defaultComponentWaitTime := nil. |
|
2241 "/ ui := nil. |
|
2242 "/ theShowFile := nil. |
|
2243 "/ defaultElementTimeout := nil. |
|
2244 "/ applicationStack := nil. |
|
2245 "/ pronunciations := nil. |
|
2246 |
|
2247 "/ super initialize. -- commented since inherited method does nothing |
2188 ! ! |
2248 ! ! |
2189 |
2249 |
2190 !ShowMeHowItWorks methodsFor:'running'! |
2250 !ShowMeHowItWorks methodsFor:'running'! |
2191 |
2251 |
2192 do:specArray |
2252 do:specArray |