406 ^ self click:1 inComponent:(self componentNamed:componentName) |
435 ^ self click:1 inComponent:(self componentNamed:componentName) |
407 |
436 |
408 "Created: / 19-07-2019 / 16:09:58 / Claus Gittinger" |
437 "Created: / 19-07-2019 / 16:09:58 / Claus Gittinger" |
409 ! |
438 ! |
410 |
439 |
|
440 drag:itemsIndexOrLabelOrPattern toComponent:targetComponentName dropAt:where |
|
441 "drag an item (by index or label) from the current treeView, |
|
442 into another component. |
|
443 where is one of: #top, #center or #bottom. |
|
444 allowed after moving to: |
|
445 aSelectionInHierarchyView |
|
446 " |
|
447 |
|
448 <action> |
|
449 |
|
450 |sourceComponent targetComponent idx yPos sourcePos sourcePosOnScreen |
|
451 targetPos targetPosOnScreen targetPosInSource| |
|
452 |
|
453 self assert:( #(top center bottom) includes:where). |
|
454 |
|
455 verifying ifTrue:[^ self]. |
|
456 |
|
457 targetComponent := self findComponent:targetComponentName. |
|
458 self assert:targetComponent notNil. |
|
459 |
|
460 ((sourceComponent := lastComponent) isKindOf:ScrollableView) ifTrue:[ |
|
461 sourceComponent := sourceComponent scrolledView. |
|
462 ]. |
|
463 |
|
464 (sourceComponent isKindOf:HierarchicalListView) ifTrue:[ |
|
465 where == #top ifTrue:[ |
|
466 targetPos := targetComponent topCenter. |
|
467 ] ifFalse:[ |
|
468 where == #center ifTrue:[ |
|
469 targetPos := targetComponent center |
|
470 ] ifFalse:[ |
|
471 where == #bottom ifTrue:[ |
|
472 targetPos := targetComponent bottomCenter - (0 @ 1) |
|
473 ]. |
|
474 ]. |
|
475 ]. |
|
476 |
|
477 itemsIndexOrLabelOrPattern isInteger ifTrue:[ |
|
478 idx := itemsIndexOrLabelOrPattern |
|
479 ] ifFalse:[ |
|
480 itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[ |
|
481 idx := sourceComponent indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string]. |
|
482 ] ifFalse:[ |
|
483 idx := sourceComponent indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern]. |
|
484 ]. |
|
485 idx == 0 ifTrue:[ |
|
486 self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern |
|
487 ]. |
|
488 ]. |
|
489 yPos := sourceComponent yVisibleOfLine:idx. |
|
490 self movePointerToComponent:sourceComponent rightOffset:(10 @ (yPos + 3)). |
|
491 Delay waitForSeconds:0.5. |
|
492 sourcePosOnScreen := Display pointerPosition. |
|
493 sourcePos := Display translatePoint:sourcePosOnScreen from:nil to:sourceComponent. |
|
494 |
|
495 targetPosOnScreen := Display translatePoint:targetPos from:targetComponent to:nil. |
|
496 targetPosInSource := Display translatePoint:targetPosOnScreen from:nil to:sourceComponent. |
|
497 |
|
498 sourceComponent simulateButtonPress:1 at:sourcePos sendDisplayEvent:true. |
|
499 Delay waitForSeconds:0.5. |
|
500 self movePointerToComponent:targetComponent offset:targetPos. |
|
501 sourceComponent simulateButtonMotion:1 to:targetPosInSource sendDisplayEvent:false. |
|
502 sourceComponent simulateButtonRelease:1 at:targetPosInSource sendDisplayEvent:false. |
|
503 self halt. |
|
504 sourceComponent simulateButtonMotion:1 to:targetPosInSource sendDisplayEvent:false. |
|
505 Delay waitForSeconds:0.5. |
|
506 sourceComponent simulateButtonRelease:1 at:targetPosInSource sendDisplayEvent:true. |
|
507 |
|
508 "/ self movePointerToComponent:targetComponent offset:targetPos. |
|
509 "/ Delay waitForSeconds:2. |
|
510 "/ self press:1. |
|
511 "/ Delay waitForSeconds:2. |
|
512 "/ self release:1. |
|
513 "/ Delay waitForSeconds:0.5. |
|
514 self halt. |
|
515 ^ self |
|
516 ]. |
|
517 |
|
518 self error:'cannot expand in this component' |
|
519 |
|
520 "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger" |
|
521 "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger" |
|
522 ! |
|
523 |
|
524 expand:itemsIndexOrLabelOrPattern |
|
525 "expand an item in a treeView by label, |
|
526 allowed after moving to: |
|
527 aSelectionInHierarchyView |
|
528 " |
|
529 |
|
530 <action> |
|
531 |
|
532 |component| |
|
533 |
|
534 verifying ifTrue:[^ self]. |
|
535 |
|
536 ((component := lastComponent) isKindOf:ScrollableView) ifTrue:[ |
|
537 component := component scrolledView. |
|
538 ]. |
|
539 |
|
540 (component isKindOf:HierarchicalListView) ifTrue:[ |
|
541 |idx yPos| |
|
542 |
|
543 itemsIndexOrLabelOrPattern isInteger ifTrue:[ |
|
544 idx := itemsIndexOrLabelOrPattern |
|
545 ] ifFalse:[ |
|
546 itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[ |
|
547 idx := component indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string]. |
|
548 ] ifFalse:[ |
|
549 idx := component indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern]. |
|
550 ]. |
|
551 idx == 0 ifTrue:[ |
|
552 self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern |
|
553 ]. |
|
554 ]. |
|
555 yPos := component yVisibleOfLine:idx. |
|
556 self movePointerToComponent:component offset:(0 @ (yPos + 3)). |
|
557 Delay waitForSeconds:0.5. |
|
558 (component listAt:idx) expand. |
|
559 ^ self |
|
560 ]. |
|
561 |
|
562 self error:'cannot expand in this component' |
|
563 |
|
564 "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger" |
|
565 "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger" |
|
566 ! |
|
567 |
411 fastMoveTo:componentName |
568 fastMoveTo:componentName |
412 "move the mouse to componentName without circling" |
569 "move the mouse to componentName without circling" |
413 |
570 |
414 <action> |
571 <action> |
415 |
572 |
465 (component isKindOf:ComboView) ifTrue:[ |
622 (component isKindOf:ComboView) ifTrue:[ |
466 "/ click on the menubutton |
623 "/ click on the menubutton |
467 self movePointerToComponent:component menuButton. |
624 self movePointerToComponent:component menuButton. |
468 self click:1 inComponent:component menuButton. |
625 self click:1 inComponent:component menuButton. |
469 Delay waitForSeconds:0.3. |
626 Delay waitForSeconds:0.3. |
470 (idx := component list indexOf:itemsLabel ifAbsent:[nil]) isNil ifTrue:[ |
627 itemsIndexOrLabelOrPattern isInteger ifTrue:[ |
471 self error:'no such item in comboList: ',itemsLabel |
628 idx := itemsIndexOrLabelOrPattern |
|
629 ] ifFalse:[ |
|
630 itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[ |
|
631 idx := component list findFirst:[:lbl | itemsIndexOrLabelOrPattern match:lbl] |
|
632 ] ifFalse:[ |
|
633 idx := component list indexOf:itemsIndexOrLabelOrPattern. |
|
634 ]. |
|
635 idx == 0 ifTrue:[ |
|
636 self error:'no such item in comboList: ',itemsIndexOrLabelOrPattern |
|
637 ]. |
472 ]. |
638 ]. |
473 component select:idx. |
639 component select:idx. |
474 Delay waitForSeconds:0.3. |
640 Delay waitForSeconds:0.3. |
475 component shownMenu notNil ifTrue:[ |
641 component shownMenu notNil ifTrue:[ |
476 component shownMenu hide. |
642 component shownMenu hide. |
477 ]. |
643 ]. |
478 ^ self |
644 ^ self |
479 ]. |
645 ]. |
480 (component isKindOf:HierarchicalListView) ifTrue:[ |
646 (component isKindOf:HierarchicalListView) ifTrue:[ |
481 component |
647 |idx yPos| |
482 selectElementForWhich:[:el | |
648 |
483 el label string = itemsLabel |
649 itemsIndexOrLabelOrPattern isInteger ifTrue:[ |
484 ] |
650 idx := itemsIndexOrLabelOrPattern |
485 ifAbsent:[ |
651 ] ifFalse:[ |
486 self error:'no such item in hierarchicalList: ',itemsLabel |
652 itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[ |
|
653 idx := component indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string]. |
|
654 ] ifFalse:[ |
|
655 idx := component indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern]. |
487 ]. |
656 ]. |
|
657 idx == 0 ifTrue:[ |
|
658 self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern |
|
659 ]. |
|
660 ]. |
|
661 yPos := component yVisibleOfLine:idx. |
|
662 self movePointerToComponent:component offset:(0 @ (yPos + 3)). |
|
663 component simulateButtonPress:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false. |
|
664 Delay waitForSeconds:0.1. |
|
665 component simulateButtonRelease:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false. |
|
666 "/ component selection:idx. |
488 ^ self |
667 ^ self |
489 ]. |
668 ]. |
490 |
669 |
491 self error:'cannot select this component' |
670 self error:'cannot select this component' |
492 |
671 |
773 |
951 |
774 findComponent:componentName |
952 findComponent:componentName |
775 "find a component by name - in the active and possibly in any app. |
953 "find a component by name - in the active and possibly in any app. |
776 Can return either a view or a menu item" |
954 Can return either a view or a menu item" |
777 |
955 |
778 |component candidates modalGroup| |
956 ^ self |
779 |
957 findComponent:componentName |
780 application notNil ifTrue:[ |
958 inAllApplications:true |
781 (component := self findComponent:componentName in:application) notNil ifTrue:[ |
959 ifMultiple:[ |
782 ^ component. |
960 self proceedableError:('multiple components found by name: ',componentName). |
783 ]. |
961 nil |
784 ]. |
962 ]. |
785 candidates := OrderedCollection new. |
963 |
786 |
964 " |
787 "/ is there a modal dialog open for the app? |
965 ShowMeHowItWorks basicNew findComponent:'Classes' |
788 (modalGroup := application windowGroup modalGroup) notNil ifTrue:[ |
966 ShowMeHowItWorks basicNew findComponent:'Klassen' |
789 modalGroup topViews do:[:eachModalTopView | |
967 " |
790 component := self findComponent:componentName in:eachModalTopView. |
968 |
791 component notNil ifTrue:[ |
969 "Created: / 19-07-2019 / 12:02:30 / Claus Gittinger" |
792 candidates add:component |
970 "Modified: / 19-07-2019 / 16:44:30 / Claus Gittinger" |
793 ]. |
971 "Modified (comment): / 23-07-2019 / 09:32:44 / Claus Gittinger" |
794 ]. |
972 ! |
795 candidates size == 1 ifTrue:[ |
973 |
796 ^ candidates first |
974 findComponent:componentName ifMultiple:exceptionalValue |
797 ]. |
975 "find a component by name - in the active and possibly in any app. |
798 ]. |
976 Can return either a view or a menu item" |
799 true "application isNil" ifTrue:[ |
977 |
800 "/ search through all current applications |
978 ^ self |
801 WindowGroup scheduledWindowGroups do:[:eachWG | |
979 findComponent:componentName |
802 |eachApp| |
980 inAllApplications:true |
803 |
981 ifMultiple:exceptionalValue |
804 (eachApp := eachWG application) notNil ifTrue:[ |
|
805 component := self findComponent:componentName in:eachApp. |
|
806 component notNil ifTrue:[ |
|
807 candidates add:component |
|
808 ]. |
|
809 ]. |
|
810 ]. |
|
811 |
|
812 candidates size == 1 ifTrue:[ |
|
813 ^ candidates first |
|
814 ]. |
|
815 candidates notEmpty ifTrue:[ |
|
816 "/ multiple elements (probably there are multiple topviews open... |
|
817 "/ check the current windowGroup |
|
818 self error:'multiple components found by name: ',componentName. |
|
819 ]. |
|
820 ]. |
|
821 |
|
822 ^ nil |
|
823 |
982 |
824 " |
983 " |
825 ShowMeHowItWorks basicNew findComponent:'Classes' |
984 ShowMeHowItWorks basicNew findComponent:'Classes' |
826 ShowMeHowItWorks basicNew findComponent:'Klassen' |
985 ShowMeHowItWorks basicNew findComponent:'Klassen' |
827 " |
986 " |
952 |
1111 |
953 "Created: / 19-07-2019 / 11:36:21 / Claus Gittinger" |
1112 "Created: / 19-07-2019 / 11:36:21 / Claus Gittinger" |
954 "Modified (comment): / 23-07-2019 / 09:31:34 / Claus Gittinger" |
1113 "Modified (comment): / 23-07-2019 / 09:31:34 / Claus Gittinger" |
955 ! |
1114 ! |
956 |
1115 |
|
1116 findComponent:componentName inAllApplications:inAllApplicationsBool ifMultiple:exceptionalValue |
|
1117 "find a component by name - in the active and possibly in any app. |
|
1118 Can return either a view or a menu item" |
|
1119 |
|
1120 |component candidates modalGroup| |
|
1121 |
|
1122 application notNil ifTrue:[ |
|
1123 (component := self findComponent:componentName in:application) notNil ifTrue:[ |
|
1124 ^ component. |
|
1125 ]. |
|
1126 ]. |
|
1127 candidates := OrderedCollection new. |
|
1128 |
|
1129 "/ is there a modal dialog open for the app? |
|
1130 (modalGroup := application windowGroup modalGroup) notNil ifTrue:[ |
|
1131 modalGroup topViews do:[:eachModalTopView | |
|
1132 component := self findComponent:componentName in:eachModalTopView. |
|
1133 component notNil ifTrue:[ |
|
1134 candidates add:component |
|
1135 ]. |
|
1136 ]. |
|
1137 candidates size == 1 ifTrue:[ |
|
1138 ^ candidates first |
|
1139 ]. |
|
1140 ]. |
|
1141 inAllApplicationsBool ifTrue:[ |
|
1142 "/ search through all current applications |
|
1143 WindowGroup scheduledWindowGroups do:[:eachWG | |
|
1144 |eachApp| |
|
1145 |
|
1146 (eachApp := eachWG application) notNil ifTrue:[ |
|
1147 component := self findComponent:componentName in:eachApp. |
|
1148 component notNil ifTrue:[ |
|
1149 candidates add:component |
|
1150 ]. |
|
1151 ]. |
|
1152 ]. |
|
1153 |
|
1154 candidates size == 1 ifTrue:[ |
|
1155 ^ candidates first |
|
1156 ]. |
|
1157 candidates notEmpty ifTrue:[ |
|
1158 "/ multiple elements (probably there are multiple topviews open... |
|
1159 "/ check the current windowGroup |
|
1160 ^ exceptionalValue value |
|
1161 ]. |
|
1162 ]. |
|
1163 |
|
1164 ^ nil |
|
1165 |
|
1166 " |
|
1167 ShowMeHowItWorks basicNew findComponent:'Classes' |
|
1168 ShowMeHowItWorks basicNew findComponent:'Klassen' |
|
1169 " |
|
1170 |
|
1171 "Created: / 19-07-2019 / 12:02:30 / Claus Gittinger" |
|
1172 "Modified: / 19-07-2019 / 16:44:30 / Claus Gittinger" |
|
1173 "Modified (comment): / 23-07-2019 / 09:32:44 / Claus Gittinger" |
|
1174 ! |
|
1175 |
957 screenBoundsOfComponent:aWidgetOrMenuItem |
1176 screenBoundsOfComponent:aWidgetOrMenuItem |
958 aWidgetOrMenuItem isView ifTrue:[ |
1177 aWidgetOrMenuItem isView ifTrue:[ |
959 ^ aWidgetOrMenuItem screenBounds |
1178 ^ aWidgetOrMenuItem screenBounds |
960 ]. |
1179 ]. |
961 (aWidgetOrMenuItem askFor:#isMenuItem) ifTrue:[ |
1180 (aWidgetOrMenuItem askFor:#isMenuItem) ifTrue:[ |
1167 |
1386 |
1168 "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger" |
1387 "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger" |
1169 "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger" |
1388 "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger" |
1170 ! |
1389 ! |
1171 |
1390 |
|
1391 movePointerToComponent:aWidgetOrMenuItem rightBottomOffset:offset |
|
1392 "move the mouse to position inside aWidget's. |
|
1393 Offset is from the rightBottom" |
|
1394 |
|
1395 |bounds| |
|
1396 |
|
1397 bounds := self screenBoundsOfComponent:aWidgetOrMenuItem. |
|
1398 self movePointerToScreenPosition:(bounds corner - offset) rounded. |
|
1399 |
|
1400 "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger" |
|
1401 "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger" |
|
1402 ! |
|
1403 |
|
1404 movePointerToComponent:aWidgetOrMenuItem rightOffset:offset |
|
1405 "move the mouse to position inside aWidget's. |
|
1406 Offset is from the rightTop (i.e. x is subtracted, y is added)" |
|
1407 |
|
1408 |bounds pos| |
|
1409 |
|
1410 bounds := self screenBoundsOfComponent:aWidgetOrMenuItem. |
|
1411 pos := (bounds right - offset x) @ (bounds top + offset y). |
|
1412 self movePointerToScreenPosition:pos rounded. |
|
1413 |
|
1414 "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger" |
|
1415 "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger" |
|
1416 ! |
|
1417 |
1172 movePointerToComponent:aWidgetOrMenuItem speed:pixelsPerSecond |
1418 movePointerToComponent:aWidgetOrMenuItem speed:pixelsPerSecond |
1173 "move the mouse to aWidget's center" |
1419 "move the mouse to aWidget's center" |
1174 |
1420 |
1175 |bounds position| |
1421 |bounds position| |
1176 |
1422 |
1273 |
1495 |
1274 "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger" |
1496 "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger" |
1275 "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger" |
1497 "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger" |
1276 ! |
1498 ! |
1277 |
1499 |
|
1500 do:specArray from:startLabelOrNil withUI:withUIBoolean |
|
1501 "must run as a separate process; |
|
1502 otherwise - if started by the app itself - |
|
1503 no events will be processed while running" |
|
1504 |
|
1505 withUIBoolean ifTrue:[ |
|
1506 ui := ShowMeHowItWorksRunner openOn:self. |
|
1507 ]. |
|
1508 self do:specArray from:startLabelOrNil |
|
1509 |
|
1510 " |
|
1511 ShowMeHowItWorks |
|
1512 do:#( |
|
1513 (show: 'blah blah') |
|
1514 (moveTo: NameOfComponent) |
|
1515 ) |
|
1516 withUI:true |
|
1517 " |
|
1518 |
|
1519 "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger" |
|
1520 "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger" |
|
1521 ! |
|
1522 |
1278 do:specArray withUI:withUIBoolean |
1523 do:specArray withUI:withUIBoolean |
1279 "must run as a separate process; |
1524 "must run as a separate process; |
1280 otherwise - if started by the app itself - |
1525 otherwise - if started by the app itself - |
1281 no events will be processed while running" |
1526 no events will be processed while running" |
1282 |
1527 |
1283 withUIBoolean ifTrue:[ |
1528 withUIBoolean ifTrue:[ |
1284 ui := ShowMeHowItWorksRunner openOn:self. |
1529 ui := ShowMeHowItWorksRunner openOn:self. |
1285 ]. |
1530 ]. |
1286 self do:specArray |
1531 self do:specArray from:nil |
1287 |
1532 |
1288 " |
1533 " |
1289 ShowMeHowItWorks |
1534 ShowMeHowItWorks |
1290 do:#( |
1535 do:#( |
1291 (show: 'blah blah') |
1536 (show: 'blah blah') |
1330 verifying := false. |
1575 verifying := false. |
1331 ]. |
1576 ]. |
1332 ! ! |
1577 ! ! |
1333 |
1578 |
1334 !ShowMeHowItWorks methodsFor:'running - private'! |
1579 !ShowMeHowItWorks methodsFor:'running - private'! |
|
1580 |
|
1581 do:specArray from:startLabelOrNil |
|
1582 "must run as a separate process; |
|
1583 otherwise - if started by the app itself - |
|
1584 no events will be processed while running" |
|
1585 |
|
1586 |wasActive| |
|
1587 |
|
1588 (wasActive := ActiveHelp isActive) ifTrue:[ |
|
1589 ActiveHelp stop. |
|
1590 ]. |
|
1591 self prepare. |
|
1592 |
|
1593 "/ run once in verifying mode |
|
1594 [ |
|
1595 self verify:specArray. |
|
1596 ] ensure:[ |
|
1597 wasActive ifTrue:[ActiveHelp start]. |
|
1598 ]. |
|
1599 |
|
1600 [ |
|
1601 ActiveHelp stop. |
|
1602 [ |
|
1603 Error handle:[:ex | |
|
1604 Dialog warn:(self class classResources |
|
1605 stringWithCRs:'An error was encountered in the show:\\%1' |
|
1606 with:ex description withCRs) |
|
1607 ] do:[ |
|
1608 self doStream:(specArray readStream) from:startLabelOrNil |
|
1609 ]. |
|
1610 ] ensure:[ |
|
1611 wasActive ifTrue:[ActiveHelp start]. |
|
1612 ]. |
|
1613 ] fork. |
|
1614 |
|
1615 " |
|
1616 ShowMeHowItWorks do: |
|
1617 #( |
|
1618 (show: 'blah blah') |
|
1619 (moveTo: NameOfComponent) |
|
1620 ) |
|
1621 " |
|
1622 |
|
1623 "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger" |
|
1624 "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger" |
|
1625 ! |
1335 |
1626 |
1336 doCommand:op |
1627 doCommand:op |
1337 "execute a single command" |
1628 "execute a single command" |
1338 |
1629 |
1339 |numArgs sel args method| |
1630 |numArgs sel args method| |
1394 "Created: / 19-07-2019 / 15:34:55 / Claus Gittinger" |
1685 "Created: / 19-07-2019 / 15:34:55 / Claus Gittinger" |
1395 "Modified: / 23-07-2019 / 09:14:26 / Claus Gittinger" |
1686 "Modified: / 23-07-2019 / 09:14:26 / Claus Gittinger" |
1396 ! |
1687 ! |
1397 |
1688 |
1398 doStream:specStream |
1689 doStream:specStream |
1399 |previousStream resources| |
1690 self doStream:specStream from:nil |
1400 |
|
1401 resources := self class classResources. |
|
1402 |
|
1403 streamStack isNil ifTrue:[ streamStack := OrderedCollection new ]. |
|
1404 streamStack add:opStream. |
|
1405 |
|
1406 previousStream := opStream. |
|
1407 [ |
|
1408 opStream := specStream. |
|
1409 [opStream atEnd] whileFalse:[ |
|
1410 self nextCommand. |
|
1411 Display shiftDown ifTrue:[ |
|
1412 (IntroShownCount ? 0) > 3 ifFalse:[ |
|
1413 self tell:(self possiblyTranslate:'You pressed the SHIFT key.'). |
|
1414 ]. |
|
1415 self tell:(self possiblyTranslate:'Do you want to stop the show?'). |
|
1416 (Dialog confirm:(resources stringWithCRs:'Stop the demonstration?')) |
|
1417 ifTrue:[ |
|
1418 self tell:(self possiblyTranslate:'OK,'). |
|
1419 self tell:(self possiblyTranslate:(self randomThankYou)). |
|
1420 ^ AbortOperationRequest raise |
|
1421 ]. |
|
1422 ]. |
|
1423 ]. |
|
1424 ] ensure:[ |
|
1425 streamStack removeLast. |
|
1426 opStream := previousStream |
|
1427 ]. |
|
1428 |
1691 |
1429 "<<END |
1692 "<<END |
1430 ShowMeHowItWorks do:#( |
1693 ShowMeHowItWorks do:#( |
1431 showing: 'Choose the number of arguments' |
1694 showing: 'Choose the number of arguments' |
1432 do: ( |
1695 do: ( |
1456 |
1719 |
1457 "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger" |
1720 "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger" |
1458 "Modified: / 23-07-2019 / 11:48:45 / Claus Gittinger" |
1721 "Modified: / 23-07-2019 / 11:48:45 / Claus Gittinger" |
1459 ! |
1722 ! |
1460 |
1723 |
1461 nextCommand |
1724 doStream:specStream from:startLabelOrNil |
1462 self doCommand:(opStream next). |
1725 |previousStream resources| |
1463 |
1726 |
|
1727 resources := self class classResources. |
|
1728 |
|
1729 streamStack isNil ifTrue:[ streamStack := OrderedCollection new ]. |
|
1730 streamStack add:opStream. |
|
1731 |
|
1732 previousStream := opStream. |
|
1733 [ |
|
1734 |nextCommand| |
|
1735 |
|
1736 opStream := specStream. |
|
1737 startLabelOrNil notNil ifTrue:[ |
|
1738 |found| |
|
1739 |
|
1740 "/ skip for that label |
|
1741 found := false. |
|
1742 [ found ] whileFalse:[ |
|
1743 |cmd| |
|
1744 |
|
1745 cmd := opStream nextOrNil. |
|
1746 cmd isNil ifTrue:[ |
|
1747 self proceedableError:'label not found: ',startLabelOrNil. |
|
1748 ^ self. |
|
1749 ]. |
|
1750 (cmd = 'label:') ifTrue:[ |
|
1751 found := (opStream next = startLabelOrNil) |
|
1752 ]. |
|
1753 ]. |
|
1754 ]. |
|
1755 |
|
1756 [opStream atEnd] whileFalse:[ |
|
1757 nextCommand := opStream next. |
|
1758 self doCommand:nextCommand. |
|
1759 |
|
1760 Display shiftDown ifTrue:[ |
|
1761 (IntroShownCount ? 0) > 3 ifFalse:[ |
|
1762 self tell:(self possiblyTranslate:'You pressed the SHIFT key.'). |
|
1763 ]. |
|
1764 self tell:(self possiblyTranslate:'Do you want to stop the show?'). |
|
1765 (Dialog confirm:(resources stringWithCRs:'Stop the demonstration?')) |
|
1766 ifTrue:[ |
|
1767 self tell:(self possiblyTranslate:'OK,'). |
|
1768 self tell:(self possiblyTranslate:(self randomThankYou)). |
|
1769 ^ AbortOperationRequest raise |
|
1770 ]. |
|
1771 ]. |
|
1772 ]. |
|
1773 ] ensure:[ |
|
1774 streamStack removeLast. |
|
1775 opStream := previousStream |
|
1776 ]. |
|
1777 |
1464 "<<END |
1778 "<<END |
1465 ShowMeHowItWorks do:#( |
1779 ShowMeHowItWorks do:#( |
1466 showing: 'Choose the number of arguments' |
1780 showing: 'Choose the number of arguments' |
1467 do: ( |
1781 do: ( |
1468 moveTo: NumberOfArguments |
1782 moveTo: NumberOfArguments |