diff --git a/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st b/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st index 142a3b61..0283622e 100644 --- a/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st +++ b/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st @@ -14,13 +14,13 @@ Class { } { #category : #accessing } -SBExampleValueDisplay >> exampleFinished: anExample [ +SBExampleValueDisplay >> exampleFinished: anExample [ display exampleFinished: anExample. - statusLabel contents: (hadValue - ifTrue: [''] - ifFalse: ['- Not reached -']) + statusLabel + contents: (hadValue ifTrue: [''] ifFalse: ['- Not reached -']); + visible: hadValue not ] { #category : #accessing } @@ -69,11 +69,13 @@ SBExampleValueDisplay >> layoutCommands [ ^ SBAlgebraCommand container morph: self; - data: (self submorphs collect: #layoutCommands separatedBy: [SBAlgebraCommand gap]) + data: ((self submorphs select: [:s | s visible]) + collect: #layoutCommands + separatedBy: [SBAlgebraCommand gap]) ] { #category : #naming } -SBExampleValueDisplay >> name: aString [ +SBExampleValueDisplay >> name: aString [ label contents: aString ] @@ -83,5 +85,6 @@ SBExampleValueDisplay >> reportValue: anObject name: aString [ display reportValue: anObject. label contents: aString. + label visible: aString notEmpty. hadValue := true ] diff --git a/packages/Sandblocks-Core/SBBlock.class.st b/packages/Sandblocks-Core/SBBlock.class.st index a4a79af5..604c6fda 100644 --- a/packages/Sandblocks-Core/SBBlock.class.st +++ b/packages/Sandblocks-Core/SBBlock.class.st @@ -1165,6 +1165,12 @@ SBBlock >> dynamicNumberOfChildren [ ^ self fixedNumberOfChildren not ] +{ #category : #'colors and color policies' } +SBBlock >> emphasis [ + + ^ self colorPolicy defaultEmphasis +] + { #category : #actions } SBBlock >> endInput [ diff --git a/packages/Sandblocks-Core/SBEditor.class.st b/packages/Sandblocks-Core/SBEditor.class.st index cb7a9aa8..f6524e46 100644 --- a/packages/Sandblocks-Core/SBEditor.class.st +++ b/packages/Sandblocks-Core/SBEditor.class.st @@ -1268,7 +1268,9 @@ SBEditor >> performForSelection: anActionSymbol [ self selection notNil ifTrue: [(self selection performAction: anActionSymbol) ifTrue: [^ true]]. globalShortcutListeners do: [:listener | - (listener lookupGlobalAction: anActionSymbol) ifNotNil: [listener perform: anActionSymbol. ^ true]]. + (listener lookupGlobalAction: anActionSymbol) ifNotNil: [ + listener perform: anActionSymbol. + ^ true]]. ^ false ] @@ -1679,7 +1681,7 @@ SBEditor >> summarizeActionsDuring: aBlock [ { #category : #'as yet unclassified' } SBEditor >> textFocus [ - ^ self selection activeTextMorph + ^ self selection ifNotNil: #activeTextMorph ] { #category : #actions } diff --git a/packages/Sandblocks-Core/SBErrorDecorator.class.st b/packages/Sandblocks-Core/SBErrorDecorator.class.st index e64ca79c..9597ee8d 100644 --- a/packages/Sandblocks-Core/SBErrorDecorator.class.st +++ b/packages/Sandblocks-Core/SBErrorDecorator.class.st @@ -29,6 +29,12 @@ SBErrorDecorator >> fixActions: aCollection [ fixActions := aCollection ] +{ #category : #'as yet unclassified' } +SBErrorDecorator >> message [ + + ^ message +] + { #category : #'as yet unclassified' } SBErrorDecorator >> message: aString [ @@ -58,6 +64,9 @@ SBErrorDecorator >> subtle: aBoolean [ { #category : #'as yet unclassified' } SBErrorDecorator >> tryFixIfFail: aBlock [ + | index | (fixActions isNil or: [fixActions isEmpty]) ifTrue: [^ aBlock value]. - self morph proposeCodeActions: fixActions for: self morph + + index := UIManager default chooseFrom: (fixActions collect: #label). + index > 0 ifTrue: [(fixActions at: index) do] ifFalse: [^ aBlock value] ] diff --git a/packages/Sandblocks-Morphs/SBMultilineOwnTextMorph.class.st b/packages/Sandblocks-Morphs/SBMultilineOwnTextMorph.class.st index 75d13ad9..d9e5191b 100644 --- a/packages/Sandblocks-Morphs/SBMultilineOwnTextMorph.class.st +++ b/packages/Sandblocks-Morphs/SBMultilineOwnTextMorph.class.st @@ -312,6 +312,16 @@ SBMultilineOwnTextMorph >> selectionBounds [ ^ {self selectionBound min: self cursor. self selectionBound max: self cursor} ] +{ #category : #'as yet unclassified' } +SBMultilineOwnTextMorph >> setBoundsDirect: aRectangle [ + + | delta | + delta := aRectangle origin - bounds origin. + paragraph ifNotNil: [:p | p moveBy: delta]. + + super setBoundsDirect: aRectangle +] + { #category : #'as yet unclassified' } SBMultilineOwnTextMorph >> showPlaceholder [