From f40aba38a6cc64f983926748969a6249976e3c42 Mon Sep 17 00:00:00 2001 From: Joana Bergsiek Date: Fri, 29 Mar 2024 01:33:18 +0100 Subject: [PATCH] renames, improvements --- .../Sandblocks-Babylonian/SBCluster.class.st | 30 ++++--- .../SBCorrelationCluster.class.st | 32 +++++-- .../SBCorrelationView.class.st | 11 ++- .../SBCustomView.class.st | 2 +- .../SBDiffTabView.class.st | 22 +---- .../Sandblocks-Babylonian/SBExample.class.st | 85 +++++++++++++------ .../SBExampleCluster.class.st | 18 +--- .../SBExampleValueDisplay.class.st | 7 +- .../SBExampleWatch.class.st | 56 +++++------- .../Sandblocks-Babylonian/SBGrid.class.st | 2 +- .../SBPartialPermutationLabel.class.st | 23 ++--- .../SBPartialPermutationLabel.extension.st | 7 -- .../SBPermutationGridsView.class.st | 4 +- .../SBPermutationLabel.class.st | 50 +++++++++++ .../SBPermutationLabel.extension.st | 6 ++ .../SBResizableResultsView.class.st | 2 +- .../SBStMessageSend.extension.st | 2 +- .../Sandblocks-Core/SBNamedBlock.class.st | 4 +- packages/Sandblocks-Core/SBTabView.class.st | 10 +-- packages/Sandblocks-Morphs/SBButton.class.st | 2 +- 20 files changed, 211 insertions(+), 164 deletions(-) delete mode 100644 packages/Sandblocks-Babylonian/SBPartialPermutationLabel.extension.st diff --git a/packages/Sandblocks-Babylonian/SBCluster.class.st b/packages/Sandblocks-Babylonian/SBCluster.class.st index a454e812..a24004b4 100644 --- a/packages/Sandblocks-Babylonian/SBCluster.class.st +++ b/packages/Sandblocks-Babylonian/SBCluster.class.st @@ -42,7 +42,8 @@ SBCluster >> initialize [ changeTableLayout; listDirection: #topToBottom; vResizing: #shrinkWrap; - hResizing: #shrinkWrap + hResizing: #shrinkWrap; + cellInset: 0@10 ] { #category : #accessing } @@ -113,8 +114,7 @@ SBCluster >> newTopRowFrom: aCollectionOfMorphs [ cellPositioning: #topCenter; hResizing: #spaceFill; addAllMorphsBack: (aCollectionOfMorphs collect: [:aMorph | - aMorph rotationDegrees: 90. - (self wrapInCell: aMorph owner flexVertically: true flexHorizontally: false) borderWidth: 0]) + self morphResizer applyOn: aMorph]) ] { #category : #visualisation } @@ -138,16 +138,19 @@ SBCluster >> visualize [ (matrix rowCount < 2 or: [matrix columnCount < 2]) ifTrue:[self visualizeNothingToDisplay. ^ self]. - self addAllMorphsBack: { - self newTopRowFrom: (matrix atRow: 1) allButFirst. "ignore placeholder morph" + self addMorphBack: ( self newContainerMorph - listDirection: #leftToRight; - cellInset: 0; - addAllMorphsBack: { - self newLeftColumnFrom: (matrix atColumn: 1) allButFirst. "ignore placeholder morph" - SBGrid newDisplaying: - ((matrix atRows: 2 to: matrix rowCount columns: 2 to: matrix columnCount) - collect: [:aMorph | self wrapInCell: aMorph])}} + cellInset: 0@0; + addAllMorphsBack: { + self newTopRowFrom: (matrix atRow: 1) allButFirst. "ignore placeholder morph" + self newContainerMorph + listDirection: #leftToRight; + cellInset: 5@(-10); + addAllMorphsBack: { + self newLeftColumnFrom: (matrix atColumn: 1) allButFirst. "ignore placeholder morph" + SBGrid newDisplaying: + ((matrix atRows: 2 to: matrix rowCount columns: 2 to: matrix columnCount) + collect: [:aMorph | self wrapInCell: aMorph])}}) ] { #category : #visualisation } @@ -171,6 +174,7 @@ SBCluster >> wrapInCell: aMorph flexVertically: aVBoolean flexHorizontally: aHBo | cell targetExtent| cell := self newCellMorph. + cell on: #click send: #value to: [aMorph triggerEvent: #clicked]. aVBoolean ifTrue: [cell vResizing: #shrinkWrap]. aHBoolean ifTrue: [cell hResizing: #shrinkWrap]. @@ -189,6 +193,6 @@ SBCluster >> wrapInCell: aMorph flexVertically: aVBoolean flexHorizontally: aHBo cell addMorph: (ImageMorph new newForm: (aMorph imageForm scaledIntoFormOfSize: targetExtent); when: #clicked send: #triggerEvent: to: aMorph with: #clicked). - cell on: #click send: #value to: [cell submorphs first triggerEvent: #clicked]. + ^ cell ] diff --git a/packages/Sandblocks-Babylonian/SBCorrelationCluster.class.st b/packages/Sandblocks-Babylonian/SBCorrelationCluster.class.st index 43033d83..6e247006 100644 --- a/packages/Sandblocks-Babylonian/SBCorrelationCluster.class.st +++ b/packages/Sandblocks-Babylonian/SBCorrelationCluster.class.st @@ -120,6 +120,19 @@ SBCorrelationCluster >> extractedTopHeadingsFrom: aCollectionOfCorrelatingUniver referingTo: aCorrelatingUniverse] ] +{ #category : #visualisation } +SBCorrelationCluster >> newLeftColumnFrom: aCollectionOfMorphs [ + + "Height should be set, but width can vary" + ^ self newContainerMorph + cellPositioning: #rightCenter; + addAllMorphsBack: (aCollectionOfMorphs collect: [:aMorph | + aMorph wrapFlag: false. + (self wrapInCell: aMorph flexVertically: false flexHorizontally: true) + listDirection: #rightToLeft; + borderWidth: 0]) +] + { #category : #visualisation } SBCorrelationCluster >> newTopRowFrom: aCollectionOfPermutationLabels [ @@ -127,14 +140,17 @@ SBCorrelationCluster >> newTopRowFrom: aCollectionOfPermutationLabels [ ^ self newContainerMorph listDirection: #leftToRight; listCentering: #bottomRight; - cellPositioning: #topCenter; + cellPositioning: #bottomCenter; hResizing: #spaceFill; addAllMorphsBack: (aCollectionOfPermutationLabels collect: [:aLabel | - self newContainerMorph - addAllMorphsBack: { - (self - wrapInCell: aLabel - flexVertically: true - flexHorizontally: false) borderWidth: 0. - SBButton newApplyPermutationFor: (aLabel universe activePermutation).}]) + self morphResizer applyOn: aLabel]) +] + +{ #category : #helper } +SBCorrelationCluster >> wrapInCell: aMorph [ + + ^ self morphResizer label = SBMorphResizer newIdentity label + ifTrue: [self wrapInCell: aMorph flexVertically: true flexHorizontally: true] + ifFalse: [self wrapInCell: aMorph flexVertically: true flexHorizontally: false] + ] diff --git a/packages/Sandblocks-Babylonian/SBCorrelationView.class.st b/packages/Sandblocks-Babylonian/SBCorrelationView.class.st index ee2666aa..143658ca 100644 --- a/packages/Sandblocks-Babylonian/SBCorrelationView.class.st +++ b/packages/Sandblocks-Babylonian/SBCorrelationView.class.st @@ -33,9 +33,12 @@ SBCorrelationView >> buildForExample: anExample watching: aWatch [ self containerRow listDirection: #topToBottom; addAllMorphsBack: { SBOwnTextMorph new contents: ( - '{1}, {2}' format: {anExample label. + '{1}{2}' format: {"anExample label" ''. (aWatch cleanedExpression sourceString)}). - self buildGridsFor: anExample watching: aWatch} flatten}) + self containerRow + listDirection: #topToBottom; + cellPositioning: #rightCenter; + addAllMorphsBack: ((self buildGridsFor: anExample watching: aWatch) flatten)}}) ] { #category : #building } @@ -63,7 +66,7 @@ SBCorrelationView >> buildSelectionRow [ | container selectedString | container := self containerRow. self ensureVariantSelectionIn: container. - selectedString := 'Selected: '. + selectedString := ''. selectedVariants ifEmpty: [ selectedString := selectedString, 'None' ] ifNotEmpty: [ selectedString := selectedString, ((selectedVariants collect: #name) fold: [:a :b | a, ', ', Character cr, b ])]. @@ -80,7 +83,7 @@ SBCorrelationView >> buildVariantSelection [ topLevelVariant := options detect: [:aVariant | aVariant parentVariant isNil] ifNone: [options first]. ^ SBComboBox new - prefix: 'Add or Remove'; + prefix: 'Configure Y Axis'; labels: (options collect: #name); values: options; object: topLevelVariant; diff --git a/packages/Sandblocks-Babylonian/SBCustomView.class.st b/packages/Sandblocks-Babylonian/SBCustomView.class.st index 13ec7048..86baef41 100644 --- a/packages/Sandblocks-Babylonian/SBCustomView.class.st +++ b/packages/Sandblocks-Babylonian/SBCustomView.class.st @@ -20,7 +20,7 @@ SBCustomView >> buildViewOptions [ options := self viewClasses collect: [:aClass | aClass new hasBeenRenamed: true]. ^ SBComboBox new - prefix: 'Current View: '; + prefix: 'Current Grid View: '; labels: (options collect: #name); values: options ; object: options first; diff --git a/packages/Sandblocks-Babylonian/SBDiffTabView.class.st b/packages/Sandblocks-Babylonian/SBDiffTabView.class.st index 2a968edf..7b49db85 100644 --- a/packages/Sandblocks-Babylonian/SBDiffTabView.class.st +++ b/packages/Sandblocks-Babylonian/SBDiffTabView.class.st @@ -7,22 +7,6 @@ Class { #category : #'Sandblocks-Babylonian' } -{ #category : #nil } -SBDiffTabView >> addButton [ - - ^ SBButton new - icon: (SBIcon iconPlus - size: 7.0 sbScaled; - color: (Color green)) - do: [self addTab]; - makeSmall; - cornerStyle: #squared; - vResizing: #spaceFill; - balloonText: 'Add'; - cellGap: -1.0 sbScaled; - layoutInset: (4.0 @ 4.0) sbScaled -] - { #category : #callbacks } SBDiffTabView >> artefactSaved: aMethodBlock [ @@ -72,14 +56,12 @@ SBDiffTabView >> buildView [ SBDiffTabView >> diffButton [ ^ SBButton new - icon: (SBIcon iconCodeFork size: 12.0) + icon: (SBIcon iconCodeFork size: 10) do: [self toggleDiffView]; makeSmall; balloonText: 'Toggle diff to others'; vResizing: #spaceFill; - cornerStyle: #squared; - cellGap: -1.0 sbScaled; - layoutInset: (4.0 @ 3.0) + cornerStyle: #squared ] { #category : #diffing } diff --git a/packages/Sandblocks-Babylonian/SBExample.class.st b/packages/Sandblocks-Babylonian/SBExample.class.st index 706cf44e..f5e75205 100644 --- a/packages/Sandblocks-Babylonian/SBExample.class.st +++ b/packages/Sandblocks-Babylonian/SBExample.class.st @@ -386,8 +386,7 @@ SBExample >> run [ self sendStartNotification. processRunning := true. - currentProcess := [ - | returned | + currentProcess := [ | returned | SBExecutionEnvironment value: self. [returned := self evaluate] on: Error do: [:e | @@ -397,12 +396,19 @@ SBExample >> run [ self scheduleLastError: nil. currentProcess := nil. processRunning := false. - Project current addDeferredUIMessage: [ - returnValue reportValues: {returned asSBWatchValue} sized: SBMorphResizer newThumbmail. - returnValue updateDisplay. - self sendFinishNotification] - ] forkAt: Processor userBackgroundPriority. - + 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. + ^ currentProcess ] @@ -424,7 +430,12 @@ SBExample >> runSetup [ errorDecorator ifNotNil: #detach. errorDecorator := nil. traceSize := 0. - returnValue clear. + SBVariant + named: 'clear' + associations: {'with' -> [returnValue clear]. 'without' -> []} + activeIndex: 2 + id: '62643a5a-1d80-7f43-a32f-f23665e98f83' + isActive: false ] { #category : #execution } @@ -449,19 +460,39 @@ SBExample >> scheduleLastError: anError [ { #category : #initialization } SBExample >> self: aBlock args: aCollectionBlock label: aString [ - self - removeAllMorphs; - addMorphBack: (icon := SBIcon iconPause - small; - color: Color white; - 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 + 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 ] { #category : #initialization } @@ -527,11 +558,15 @@ SBExample >> stopRunning [ self stopSteppingSelector: #run. active := false. - returnValue clear. + 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]] + self sandblockEditor allMorphsDo: [:morph | (morph isSandblock and: [morph listensToExamples]) ifTrue: [morph exampleStopped: self]] ] { #category : #actions } diff --git a/packages/Sandblocks-Babylonian/SBExampleCluster.class.st b/packages/Sandblocks-Babylonian/SBExampleCluster.class.st index 16d268e3..c0520503 100644 --- a/packages/Sandblocks-Babylonian/SBExampleCluster.class.st +++ b/packages/Sandblocks-Babylonian/SBExampleCluster.class.st @@ -95,21 +95,5 @@ SBExampleCluster >> newTopRowFrom: aCollectionOfPermutationLabels [ cellPositioning: #topCenter; hResizing: #spaceFill; addAllMorphsBack: (aCollectionOfPermutationLabels collect: [:aLabel | - | wrappedLabel button | - aLabel rotationDegrees: 90. - wrappedLabel := (self wrapInCell: aLabel owner - flexVertically: true - flexHorizontally: false) borderWidth: 0. - "Rotating morphs somehow clips their right border, so dirty hack so container gets clipped 1px" - button := self newContainerMorph - cellInset: 1; - addMorphBack: (SBButton newApplyPermutationFor: aLabel permutation); - rotationDegrees: 90. - button owner width > wrappedLabel width ifTrue: [button firstSubmorph makeTiny]. - - self newContainerMorph - cellPositioning: #bottomToTop; - cellPositioning: #topCenter; - cellInset: 0@2; - addAllMorphsBack: {button owner. wrappedLabel}]) + self morphResizer applyOn: aLabel]) ] diff --git a/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st b/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st index 3d82a123..279ea71e 100644 --- a/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st +++ b/packages/Sandblocks-Babylonian/SBExampleValueDisplay.class.st @@ -136,7 +136,12 @@ SBExampleValueDisplay >> reportValues: aCollectionOfWatchValues name: aString si display reportValues: aCollectionOfWatchValues sized: aSBMorphResizer. label contents: aString. - label visible: aString notEmpty. + label visible: (SBVariant + named: 'visible:' + associations: {'with' -> [aString notEmpty]. 'without' -> [false]} + activeIndex: 2 + id: '15acb8c3-94a2-9348-8d02-0c6fa11e9f7c' + isActive: false). hadValue := true ] diff --git a/packages/Sandblocks-Babylonian/SBExampleWatch.class.st b/packages/Sandblocks-Babylonian/SBExampleWatch.class.st index b7a29069..e74639a8 100644 --- a/packages/Sandblocks-Babylonian/SBExampleWatch.class.st +++ b/packages/Sandblocks-Babylonian/SBExampleWatch.class.st @@ -325,43 +325,20 @@ SBExampleWatch >> identifier: aSymbol [ ] { #category : #initialization } -SBExampleWatch >> initialize [ +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). - | options | - super initialize. - options := SBMorphResizer standardOptions. - - exampleToDisplay := IdentityDictionary new. - exampleToValues := IdentityDictionary new. - watchedExpression := SBStMessageSend new. - dimensionOptions := SBComboBox new - prefix: 'Preview sizes: '; - 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. - SBVariant - named: 'modifyExpression' - associations: {'with' -> [modifyExpression]. 'without' -> []} - activeIndex: 2 - id: '90d7c718-89b8-7e48-8262-467d07d56880' - isActive: false}; - yourself ] { #category : #initialization } @@ -439,7 +416,12 @@ SBExampleWatch >> modifyExpression: aBlock [ modifyExpression ifNotNil: #delete. modifyExpression := aBlock. - self addMorphBack: modifyExpression. + SBVariant + named: 'addMorphBack:' + associations: {'with' -> [self addMorphBack: modifyExpression]. 'without' -> []} + activeIndex: 2 + id: 'c3b856eb-2899-cd44-b45c-3b099b02aad6' + isActive: false ] { #category : #accessing } diff --git a/packages/Sandblocks-Babylonian/SBGrid.class.st b/packages/Sandblocks-Babylonian/SBGrid.class.st index 9ae5f41e..b64dacc0 100644 --- a/packages/Sandblocks-Babylonian/SBGrid.class.st +++ b/packages/Sandblocks-Babylonian/SBGrid.class.st @@ -51,5 +51,5 @@ SBGrid >> initialize [ { #category : #visualisation } SBGrid >> updateWidthToPersistColumns [ - self width: (columnCount * (self submorphs first width + (2 * self cellInset))) + self width: (columnCount * (self submorphs first width + (2 * self cellInset))) ] diff --git a/packages/Sandblocks-Babylonian/SBPartialPermutationLabel.class.st b/packages/Sandblocks-Babylonian/SBPartialPermutationLabel.class.st index 4320f5dd..bede6ade 100644 --- a/packages/Sandblocks-Babylonian/SBPartialPermutationLabel.class.st +++ b/packages/Sandblocks-Babylonian/SBPartialPermutationLabel.class.st @@ -1,8 +1,7 @@ Class { #name : #SBPartialPermutationLabel, - #superclass : #TextMorph, + #superclass : #SBPermutationLabel, #instVars : [ - 'permutation', 'universe' ], #category : #'Sandblocks-Babylonian' @@ -18,22 +17,10 @@ SBPartialPermutationLabel class >> newDisplaying: aSBPermutation referingTo: aUn yourself ] -{ #category : #'*Sandblocks-Babylonian' } -SBPartialPermutationLabel >> listensToPermutations [ - - ^ true -] - -{ #category : #accessing } -SBPartialPermutationLabel >> permutation [ - - ^ permutation -] - -{ #category : #accessing } -SBPartialPermutationLabel >> permutation: aPermutation [ - - permutation := aPermutation +{ #category : #'event handling' } +SBPartialPermutationLabel >> mouseDown: evt [ + + self universe activePermutation apply ] { #category : #accessing } diff --git a/packages/Sandblocks-Babylonian/SBPartialPermutationLabel.extension.st b/packages/Sandblocks-Babylonian/SBPartialPermutationLabel.extension.st deleted file mode 100644 index a4e59e1e..00000000 --- a/packages/Sandblocks-Babylonian/SBPartialPermutationLabel.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : #SBPartialPermutationLabel } - -{ #category : #'*Sandblocks-Babylonian' } -SBPartialPermutationLabel >> listensToPermutations [ - - ^ true -] diff --git a/packages/Sandblocks-Babylonian/SBPermutationGridsView.class.st b/packages/Sandblocks-Babylonian/SBPermutationGridsView.class.st index 74636836..9225d1c3 100644 --- a/packages/Sandblocks-Babylonian/SBPermutationGridsView.class.st +++ b/packages/Sandblocks-Babylonian/SBPermutationGridsView.class.st @@ -17,8 +17,8 @@ SBPermutationGridsView >> buildPermutationFor: aSBUniverse [ addAllMorphsBack: { self containerRow listDirection: #topToBottom; addAllMorphsBack: { - SBPermutationLabel newDisplaying: aSBUniverse activePermutation. - SBButton newApplyPermutationFor: aSBUniverse activePermutation. + (SBPermutationLabel newDisplaying: aSBUniverse activePermutation) + wrapFlag: false. (self currentClusterClass newForSize: self selectedResizer havingWatches: aSBUniverse watches)}}) diff --git a/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st b/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st index b1a45868..9db3090e 100644 --- a/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st +++ b/packages/Sandblocks-Babylonian/SBPermutationLabel.class.st @@ -16,12 +16,62 @@ SBPermutationLabel class >> newDisplaying: aSBPermutation [ yourself ] +{ #category : #'*Sandblocks-Babylonian' } +SBPermutationLabel >> applyResize: aPoint [ + + ^ self extent: aPoint +] + +{ #category : #'event handling' } +SBPermutationLabel >> click: evt [ + + self permutation apply +] + +{ #category : #initialization } +SBPermutationLabel >> initialize [ + + super initialize. + + self wrapFlag: true. +] + { #category : #'*Sandblocks-Babylonian' } SBPermutationLabel >> listensToPermutations [ ^ true ] +{ #category : #'event handling' } +SBPermutationLabel >> mouseDown: evt [ + + self permutation apply +] + +{ #category : #'event handling' } +SBPermutationLabel >> mouseEnter: evt [ + + "nothing" +] + +{ #category : #'event handling' } +SBPermutationLabel >> mouseLeave: evt [ + + "nothing" +] + +{ #category : #'event handling' } +SBPermutationLabel >> mouseMove: evt [ + + ^ Cursor execute show +] + +{ #category : #'event handling' } +SBPermutationLabel >> mouseUp: evt [ + + "nothing" +] + { #category : #accessing } SBPermutationLabel >> permutation [ diff --git a/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st b/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st index ad89430d..b49ace75 100644 --- a/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st +++ b/packages/Sandblocks-Babylonian/SBPermutationLabel.extension.st @@ -1,5 +1,11 @@ Extension { #name : #SBPermutationLabel } +{ #category : #'*Sandblocks-Babylonian' } +SBPermutationLabel >> applyResize: aPoint [ + + ^ self extent: aPoint +] + { #category : #'*Sandblocks-Babylonian' } SBPermutationLabel >> listensToPermutations [ diff --git a/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st b/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st index ab04b549..33d1f55a 100644 --- a/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st +++ b/packages/Sandblocks-Babylonian/SBResizableResultsView.class.st @@ -21,7 +21,7 @@ SBResizableResultsView >> buildDimensionOptions [ options := SBMorphResizer standardOptions. ^ SBComboBox new - prefix: 'Preview sizes: '; + prefix: 'Preview size: '; labels: (options collect: #label); values: options; object: options third; diff --git a/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st b/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st index a98bfc2a..2beeeb0b 100644 --- a/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st +++ b/packages/Sandblocks-Babylonian/SBStMessageSend.extension.st @@ -4,7 +4,7 @@ Extension { #name : #SBStMessageSend } SBStMessageSend >> suggestedAlternationName [ ^ self isAssignment - ifTrue: ['{2}{1}' format: {self selector. self receiver suggestedAlternationName}] + ifTrue: [self receiver suggestedAlternationName] ifFalse: [ SBVariant named: 'format: to ''{1} to {2}''' diff --git a/packages/Sandblocks-Core/SBNamedBlock.class.st b/packages/Sandblocks-Core/SBNamedBlock.class.st index d86ca02d..0341c4fa 100644 --- a/packages/Sandblocks-Core/SBNamedBlock.class.st +++ b/packages/Sandblocks-Core/SBNamedBlock.class.st @@ -95,8 +95,8 @@ SBNamedBlock >> suggestedName [ String streamContents: [:aStream | aStream nextPutAll: ((self block statements collect: #suggestedAlternationName) fold: [:a :b | a, ' ', b])] - limitedTo: 20. - limitedString size < 20 ifTrue: [^ limitedString]. + limitedTo: 14. + limitedString size < 14 ifTrue: [^ limitedString]. ^ limitedString , '...' ] diff --git a/packages/Sandblocks-Core/SBTabView.class.st b/packages/Sandblocks-Core/SBTabView.class.st index 4bee0880..22826748 100644 --- a/packages/Sandblocks-Core/SBTabView.class.st +++ b/packages/Sandblocks-Core/SBTabView.class.st @@ -113,15 +113,13 @@ SBTabView >> addButton [ ^ SBButton new icon: (SBIcon iconPlus - size: 7.0 sbScaled; + size: 10; color: (Color green)) do: [self addTab]; makeSmall; cornerStyle: #squared; vResizing: #spaceFill; - balloonText: 'Add'; - cellGap: -1.0 sbScaled; - layoutInset: (4.0 @ 4.0) sbScaled + balloonText: 'Add' ] { #category : #commands } @@ -395,6 +393,8 @@ SBTabView >> removeCurrentTab [ { #category : #tabs } SBTabView >> setActive: aNamedBlock [ + self containingArtefact ifNil: [^ self activeIndex: (self namedBlocks indexOf: aNamedBlock ifAbsent: 1)]. + self containingArtefact isMethod ifFalse: [self basicSetActive: aNamedBlock. ^ self]. self containingArtefact hasUnsavedChanges @@ -402,7 +402,7 @@ SBTabView >> setActive: aNamedBlock [ ifFalse: ["changing tabs is latest change" self basicSetActive: aNamedBlock. SBExploriants uniqueInstance ignoreUpdate: true. - self sandblockEditor save: self containingArtefact tryFixing: false quick: true.]. + self sandblockEditor save: self containingArtefact tryFixing: false quick: false.]. ] diff --git a/packages/Sandblocks-Morphs/SBButton.class.st b/packages/Sandblocks-Morphs/SBButton.class.st index fb411f14..fd959f20 100644 --- a/packages/Sandblocks-Morphs/SBButton.class.st +++ b/packages/Sandblocks-Morphs/SBButton.class.st @@ -15,7 +15,7 @@ SBButton class >> newApplyPermutationFor: aPermutation [ ^ self new icon: (SBIcon iconArrowDown - size: 10.0 sbScaled; + size: 10.0; color: (Color r: 0.0 g: 1 b: 0.0)) label: 'Apply' do: [aPermutation apply];