diff --git a/packages/Sandblocks-Babylonian/Object.extension.st b/packages/Sandblocks-Babylonian/Object.extension.st index 52a49113..6fa8ddae 100644 --- a/packages/Sandblocks-Babylonian/Object.extension.st +++ b/packages/Sandblocks-Babylonian/Object.extension.st @@ -63,7 +63,7 @@ Object >> sbWatchValueMorphFor: aSBWatchValue sized: aSBMorphResizer [ "Objects can choose if they want to apply a changed extent" ^ (SBWatchValue newContainerMorphFor: aSBWatchValue) - addMorphBack: (SBIcon iconFor: aSBWatchValue watchedValueIdentityHash) asMorph; + "addMorphBack: (SBIcon iconFor: aSBWatchValue watchedValueIdentityHash) asMorph;" addMorphBack: self asMorph; yourself ] diff --git a/packages/Sandblocks-Babylonian/SBCorrelationView.class.st b/packages/Sandblocks-Babylonian/SBCorrelationView.class.st index 143658ca..6879ba54 100644 --- a/packages/Sandblocks-Babylonian/SBCorrelationView.class.st +++ b/packages/Sandblocks-Babylonian/SBCorrelationView.class.st @@ -13,10 +13,6 @@ Class { { #category : #building } SBCorrelationView >> buildAllPossibleResults [ - self multiverse activeExamples - ifEmpty: [gridContainer addMorph: (TextMorph new contents: 'No examples active'). - gridContainer width: gridContainer firstSubmorph width + 5 "a bit of margin"]. - groupedUniverses := self groupUniversesContainingAllVariantsIn: selectedVariants. basePermutations := self collectAllPermutationsOfSelectedVariants asOrderedCollection. @@ -61,17 +57,22 @@ SBCorrelationView >> buildGridsFor: anExample watching: aWatch [ ] { #category : #building } -SBCorrelationView >> buildSelectionRow [ +SBCorrelationView >> buildSelectionOptions [ | container selectedString | - container := self containerRow. + container := Morph new + color: Color transparent; + changeTableLayout; + vResizing: #shrinkWrap; + hResizing: #shrinkWrap; + listDirection: #leftToRight. self ensureVariantSelectionIn: container. selectedString := ''. selectedVariants ifEmpty: [ selectedString := selectedString, 'None' ] ifNotEmpty: [ selectedString := selectedString, ((selectedVariants collect: #name) fold: [:a :b | a, ', ', Character cr, b ])]. container addMorphBack: selectedString asMorph. - self block addMorph: container. + ^ container ] @@ -91,10 +92,10 @@ SBCorrelationView >> buildVariantSelection [ displayPrefixOnly ] -{ #category : #accessing } +{ #category : #'as yet unclassified' } SBCorrelationView >> buttons [ - - ^ {} + + ^ super buttons, {self buildSelectionOptions} ] { #category : #building } @@ -190,20 +191,6 @@ SBCorrelationView >> initialize [ ] -{ #category : #actions } -SBCorrelationView >> visualize [ - - self clean. - - self buildSelectionRow. - self block addMorph: dimensionOptions. - - self buildButtonRow. - - self buildAllPossibleResults . - self concludeContainerWidth. -] - { #category : #accessing } SBCorrelationView >> wantsReloadOnSaveWhenOpen [ diff --git a/packages/Sandblocks-Babylonian/SBCustomView.class.st b/packages/Sandblocks-Babylonian/SBCustomView.class.st index 86baef41..adc871ba 100644 --- a/packages/Sandblocks-Babylonian/SBCustomView.class.st +++ b/packages/Sandblocks-Babylonian/SBCustomView.class.st @@ -27,6 +27,12 @@ SBCustomView >> buildViewOptions [ when: #selectionChanged send: #switchView to: self ] +{ #category : #accessing } +SBCustomView >> buttons [ + + ^ {viewOptions}, super buttons +] + { #category : #initialization } SBCustomView >> initialize [ @@ -36,8 +42,6 @@ SBCustomView >> initialize [ self name: 'Results'. self buildButtonRow. - - self block addMorphBack: viewOptions. self block addMorphBack: self selectedView ] diff --git a/packages/Sandblocks-Babylonian/SBExample.class.st b/packages/Sandblocks-Babylonian/SBExample.class.st index f5e75205..b5ec7f49 100644 --- a/packages/Sandblocks-Babylonian/SBExample.class.st +++ b/packages/Sandblocks-Babylonian/SBExample.class.st @@ -320,12 +320,9 @@ SBExample >> lastError: anError [ anError ifNotNil: [ true ifTrue: [ - "ToolSet debugException: anError" ^ reportedError := self sandblockEditor reportError: anError - process: ((Process forContext: anError signal copyStack priority: Processor activeProcess priority) - shouldResumeFromDebugger: false; - yourself) + process: currentProcess source: self]. errorIndicator ifNil: [ @@ -396,18 +393,7 @@ SBExample >> run [ self scheduleLastError: nil. currentProcess := nil. processRunning := false. - SBVariant - named: 'addDeferredUIMessage:' - associations: { - 'with' -> [ - Project current addDeferredUIMessage: [ - returnValue reportValues: {returned asSBWatchValue} sized: SBMorphResizer newThumbmail. - returnValue updateDisplay. - self sendFinishNotification]]. - 'without' -> [Project current addDeferredUIMessage: [self sendFinishNotification]]} - activeIndex: 2 - id: '60c08640-321a-fb4c-90f8-8d2bd5ab0bcc' - isActive: false] forkAt: Processor userBackgroundPriority. + Project current addDeferredUIMessage: [self sendFinishNotification]] forkAt: Processor userBackgroundPriority. ^ currentProcess ] @@ -429,13 +415,7 @@ SBExample >> runSetup [ errorDecorator ifNotNil: #detach. errorDecorator := nil. - traceSize := 0. - SBVariant - named: 'clear' - associations: {'with' -> [returnValue clear]. 'without' -> []} - activeIndex: 2 - id: '62643a5a-1d80-7f43-a32f-f23665e98f83' - isActive: false + traceSize := 0 ] { #category : #execution } @@ -460,39 +440,18 @@ SBExample >> scheduleLastError: anError [ { #category : #initialization } SBExample >> self: aBlock args: aCollectionBlock label: aString [ - SBVariant - named: 'remove returnValue' - associations: { - 'with' -> [ - self - removeAllMorphs; - addMorphBack: (icon := SBIcon iconPause - small; - color: (Color r: 1 g: 1 b: 1); - on: #click send: #toggleRunning to: self); - addMorphBack: (nameInput := SBTextBubble new contents: aString); - addMorphBack: (SBStringMorph new contents: 'self:'); - addMorphBack: aBlock; - addMorphBack: (SBStringMorph new contents: 'args:'); - addMorphBack: aCollectionBlock; - addMorphBack: (returnValue := SBExampleWatchView new); - updateIcon]. - 'w/o' -> [ - self - removeAllMorphs; - addMorphBack: (icon := SBIcon iconPause - small; - color: (Color r: 1 g: 1 b: 1); - on: #click send: #toggleRunning to: self); - addMorphBack: (nameInput := SBTextBubble new contents: aString); - addMorphBack: (SBStringMorph new contents: 'self:'); - addMorphBack: aBlock; - addMorphBack: (SBStringMorph new contents: 'args:'); - addMorphBack: aCollectionBlock; - updateIcon]} - activeIndex: 2 - id: '769c6446-2026-6547-a0ff-101e54bf3665' - isActive: false + self + removeAllMorphs; + addMorphBack: (icon := SBIcon iconPause + small; + color: (Color r: 1 g: 1 b: 1); + on: #click send: #toggleRunning to: self); + addMorphBack: (nameInput := SBTextBubble new contents: aString); + addMorphBack: (SBStringMorph new contents: 'self:'); + addMorphBack: aBlock; + addMorphBack: (SBStringMorph new contents: 'args:'); + addMorphBack: aCollectionBlock; + updateIcon ] { #category : #initialization } @@ -558,12 +517,6 @@ SBExample >> stopRunning [ self stopSteppingSelector: #run. active := false. - SBVariant - named: 'clear' - associations: {'with' -> [returnValue clear]. 'without' -> []} - activeIndex: 2 - id: 'f319a83a-f7aa-9a40-b959-f56ad3c4cfbc' - isActive: false. self updateIcon. self sandblockEditor allMorphsDo: [:morph | (morph isSandblock and: [morph listensToExamples]) ifTrue: [morph exampleStopped: self]] diff --git a/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st b/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st index 279ea71e..1bdc5fb2 100644 --- a/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st +++ b/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st @@ -136,12 +136,7 @@ SBExampleValueDisplay >> reportValues: aCollectionOfWatchValues name: aString si display reportValues: aCollectionOfWatchValues sized: aSBMorphResizer. label contents: aString. - label visible: (SBVariant - named: 'visible:' - associations: {'with' -> [aString notEmpty]. 'without' -> [false]} - activeIndex: 2 - id: '15acb8c3-94a2-9348-8d02-0c6fa11e9f7c' - isActive: false). + label visible: false. hadValue := true ] diff --git a/packages/Sandblocks-Babylonian/SBExampleWatch.class.st b/packages/Sandblocks-Babylonian/SBExampleWatch.class.st index e74639a8..a0b1f3b4 100644 --- a/packages/Sandblocks-Babylonian/SBExampleWatch.class.st +++ b/packages/Sandblocks-Babylonian/SBExampleWatch.class.st @@ -325,20 +325,37 @@ SBExampleWatch >> identifier: aSymbol [ ] { #category : #initialization } -SBExampleWatch >> initialize [ | options | -(super initialize). -(options := (SBMorphResizer standardOptions)). - -(exampleToDisplay := (IdentityDictionary new)). -(exampleToValues := (IdentityDictionary new)). -(watchedExpression := (SBStMessageSend new)). -(dimensionOptions := ((SBComboBox new) prefix: 'Preview size: '; labels: (options collect: #'label'); values: options; object: (options third); when: #'selectionChanged' send: #'applyResizerOnValues' to: self)). -(modifyExpression := (SBStBlockBody identityNamed: 'each')). - -(SBVariant named: 'remove modify' associations: {'with' -> [(self changeTableLayout; cellGap: 4; layoutInset: 2; vResizing: #'shrinkWrap'; hResizing: #'shrinkWrap'; addAllMorphsBack: {watchedExpression. ((SBRow new) hResizing: #'spaceFill'; listCentering: #'bottomRight'; addMorphBack: dimensionOptions; yourself). modifyExpression}; yourself). -].'w/o' -> [(self changeTableLayout; cellGap: 4; layoutInset: 2; vResizing: #'shrinkWrap'; hResizing: #'shrinkWrap'; addAllMorphsBack: {watchedExpression. ((SBRow new) hResizing: #'spaceFill'; listCentering: #'bottomRight'; addMorphBack: dimensionOptions; yourself)}; yourself). -]} activeIndex: 2 id: 'f771db53-c26a-2c40-a3f6-5c31ec7aeb44' isActive: false). +SBExampleWatch >> initialize [ + | options | + super initialize. + options := SBMorphResizer standardOptions. + + exampleToDisplay := IdentityDictionary new. + exampleToValues := IdentityDictionary new. + watchedExpression := SBStMessageSend new. + dimensionOptions := SBComboBox new + prefix: 'Preview size: '; + labels: (options collect: #label); + values: options; + object: options third; + when: #selectionChanged send: #applyResizerOnValues to: self. + modifyExpression := SBStBlockBody identityNamed: 'each'. + + self + changeTableLayout; + cellGap: 4; + layoutInset: 2; + vResizing: #shrinkWrap; + hResizing: #shrinkWrap; + addAllMorphsBack: { + watchedExpression. + SBRow new + hResizing: #spaceFill; + listCentering: #bottomRight; + addMorphBack: dimensionOptions; + yourself}; + yourself ] { #category : #initialization } @@ -415,13 +432,7 @@ SBExampleWatch >> modifyExpression [ SBExampleWatch >> modifyExpression: aBlock [ modifyExpression ifNotNil: #delete. - modifyExpression := aBlock. - SBVariant - named: 'addMorphBack:' - associations: {'with' -> [self addMorphBack: modifyExpression]. 'without' -> []} - activeIndex: 2 - id: 'c3b856eb-2899-cd44-b45c-3b099b02aad6' - isActive: false + modifyExpression := aBlock ] { #category : #accessing } diff --git a/packages/Sandblocks-Babylonian/SBInputBroadcaster.class.st b/packages/Sandblocks-Babylonian/SBInputBroadcaster.class.st index bc3f3c5a..da5890e2 100644 --- a/packages/Sandblocks-Babylonian/SBInputBroadcaster.class.st +++ b/packages/Sandblocks-Babylonian/SBInputBroadcaster.class.st @@ -53,6 +53,7 @@ SBInputBroadcaster >> eventProcessMouse: aMouse goingTo: aPosition in: aMorph [ { #category : #events } SBInputBroadcaster >> filterEvent: anEvent for: aMorph [ + self listeners withIndexDo: [:aListener :i | | localTarget newEvent delta | localTarget := self translatedPositionOf: anEvent from: aMorph to: aListener. diff --git a/packages/Sandblocks-Babylonian/SBLiveView.class.st b/packages/Sandblocks-Babylonian/SBLiveView.class.st index 111fd12e..c0b5ddbb 100644 --- a/packages/Sandblocks-Babylonian/SBLiveView.class.st +++ b/packages/Sandblocks-Babylonian/SBLiveView.class.st @@ -39,7 +39,7 @@ SBLiveView >> buildPreviewFor: aPermutation [ addAllMorphsBack: { self containerRow listDirection: #topToBottom; addAllMorphsBack: { - SBPermutationLabel newDisplaying: aPermutation. + (SBPermutationLabel newDisplaying: aPermutation) wrapFlag: false. self newPermutationButtonRowFor: aPermutation showing: preview. preview}}). ] diff --git a/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st b/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st index 33d1f55a..51337ef7 100644 --- a/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st +++ b/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st @@ -28,6 +28,12 @@ SBResizableResultsView >> buildDimensionOptions [ when: #selectionChanged send: #applyResizer to: self ] +{ #category : #accessing } +SBResizableResultsView >> buttons [ + + ^ {dimensionOptions} +] + { #category : #initialization } SBResizableResultsView >> initialize [ @@ -41,15 +47,3 @@ SBResizableResultsView >> selectedResizer [ ^ dimensionOptions object ] - -{ #category : #'as yet unclassified' } -SBResizableResultsView >> visualize [ - - self clean. - - self block addMorph: dimensionOptions. - self buildButtonRow. - - self buildAllPossibleResults . - self concludeContainerWidth. -] diff --git a/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st b/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st index 2beeeb0b..0a7e0b7a 100644 --- a/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st +++ b/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st @@ -5,13 +5,5 @@ SBStMessageSend >> suggestedAlternationName [ ^ self isAssignment ifTrue: [self receiver suggestedAlternationName] - ifFalse: [ - SBVariant - named: 'format: to ''{1} to {2}''' - associations: { - 'with sender' -> ['{1} to {2}' format: {self selector. self receiver suggestedAlternationName}]. - 'w/o sender' -> ['{1}' format: {self selector}]} - activeIndex: 2 - id: '1949332c-4768-ff4a-98ba-0356e4a3f2fa' - isActive: false] + ifFalse: ['{1}' format: {self selector}] ] diff --git a/packages/Sandblocks-Babylonian/SBSwitchableResultsView.class.st b/packages/Sandblocks-Babylonian/SBSwitchableResultsView.class.st index f1482132..a186cf87 100644 --- a/packages/Sandblocks-Babylonian/SBSwitchableResultsView.class.st +++ b/packages/Sandblocks-Babylonian/SBSwitchableResultsView.class.st @@ -13,7 +13,7 @@ Class { { #category : #accessing } SBSwitchableResultsView >> buttons [ - ^ {self toggleViewButton} + ^ super buttons, {self toggleViewButton} ] { #category : #accessing } diff --git a/packages/Sandblocks-Core/SBTabView.class.st b/packages/Sandblocks-Core/SBTabView.class.st index 22826748..5372d65c 100644 --- a/packages/Sandblocks-Core/SBTabView.class.st +++ b/packages/Sandblocks-Core/SBTabView.class.st @@ -117,6 +117,7 @@ SBTabView >> addButton [ color: (Color green)) do: [self addTab]; makeSmall; + cellPositioning: #center; cornerStyle: #squared; vResizing: #spaceFill; balloonText: 'Add' diff --git a/packages/Sandblocks-Morphs/SBButton.class.st b/packages/Sandblocks-Morphs/SBButton.class.st index fd959f20..e484cb83 100644 --- a/packages/Sandblocks-Morphs/SBButton.class.st +++ b/packages/Sandblocks-Morphs/SBButton.class.st @@ -14,9 +14,7 @@ Class { SBButton class >> newApplyPermutationFor: aPermutation [ ^ self new - icon: (SBIcon iconArrowDown - size: 10.0; - color: (Color r: 0.0 g: 1 b: 0.0)) + icon: (SBIcon iconArrowDown size: 8.0 sbScaled) label: 'Apply' do: [aPermutation apply]; makeSmall; diff --git a/packages/Sandblocks-Utils/SBPermutation.class.st b/packages/Sandblocks-Utils/SBPermutation.class.st index 64cb68df..8f26fb6a 100644 --- a/packages/Sandblocks-Utils/SBPermutation.class.st +++ b/packages/Sandblocks-Utils/SBPermutation.class.st @@ -65,7 +65,8 @@ SBPermutation >> asString [ "collecting instead of calling (a active name), ', ', (b active name) in fold as one variant only will not return a string but a variant" ^ (self referencedVariants collect: [:aVariant | - aVariant name, ': ', (aVariant blockAt: (self at: aVariant id)) nameToDisplay ]) + ((aVariant name endsWith: ':') ifTrue: [aVariant name, ' '] ifFalse: [aVariant name, ': ']), + (aVariant blockAt: (self at: aVariant id)) nameToDisplay ]) fold: [:a :b | a, ', ', Character cr, b ]