Skip to content

Commit bbae554

Browse files
committed
Change the value rendering in probe morphs to work with line breaks, lays the foundation for richer probe value representations
1 parent d4c57f6 commit bbae554

File tree

11 files changed

+60
-53
lines changed

11 files changed

+60
-53
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
private - ui
2+
newContainerMorph
3+
4+
^ Morph new
5+
color: Color transparent;
6+
vResizing: #shrinkWrap;
7+
hResizing: #shrinkWrap;
8+
changeTableLayout;
9+
listDirection: #leftToRight;
10+
borderWidth: 0;
11+
yourself

packages/Babylonian-UI.package/BPAnnotationMorph.class/methodProperties.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"isSlider" : "pre 1/24/2020 16:15",
3232
"methodReference" : "pre 11/18/2019 12:28",
3333
"methodReference:" : "pre 11/18/2019 12:28",
34+
"newContainerMorph" : "pre 10/12/2020 17:19",
3435
"newRemoveButton" : "pre 8/21/2020 10:32",
3536
"removeButtonClicked" : "pre 11/18/2019 12:29",
3637
"scrollBarSize" : "pre 7/23/2019 11:18",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
private
2+
valueMorphFor: traceValue
3+
4+
| initialValueMorph previousValueMorph |
5+
initialValueMorph := super valueMorphFor: traceValue.
6+
initialValueMorph addMorphFront: '|' asText asMorph.
7+
8+
previousValueMorph := (traceValue previousValueOf: traceValue assignedVariableNames first) printString asText asMorph.
9+
initialValueMorph addMorphFront: previousValueMorph.
10+
11+
^ initialValueMorph

packages/Babylonian-UI.package/BPAssignmentProbeMorph.class/instance/valueTextFor..st

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/Babylonian-UI.package/BPAssignmentProbeMorph.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"class" : {
33
},
44
"instance" : {
5-
"valueTextFor:" : "pre 7/10/2020 15:55" } }
5+
"valueMorphFor:" : "pre 10/12/2020 17:27" } }

packages/Babylonian-UI.package/BPProbeMorph.class/instance/updateFrom..st

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ updateFrom: traces
2020

2121
scrollPane scroller removeAllMorphs.
2222

23-
valuesMorph := (self valuesTextFor: t) asMorph
23+
valuesMorph := (self valuesMorphFor: t)
2424
lock;
2525
hResizing: #shrinkWrap;
26-
color: PluggableTextMorph basicNew userInterfaceTheme textColor;
2726
yourself.
2827

2928
scrollPane scroller addMorph: valuesMorph.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
private
2+
valueMorphFor: traceValue
3+
4+
| value valueContainer morph |
5+
value := traceValue tracedValue.
6+
valueContainer := self newContainerMorph.
7+
morph := (value isCollection or: [value isNumber])
8+
ifTrue: [valueContainer addMorphBack: value printString asText asMorph]
9+
ifFalse: [
10+
valueContainer
11+
addMorphBack: (self iconForValue: value);
12+
addMorphBack: (' ' , value printString) asText asMorph].
13+
14+
morph on: #click send: #value to: [value explore].
15+
^ morph

packages/Babylonian-UI.package/BPProbeMorph.class/instance/valueTextFor..st

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
private
2+
valuesMorphFor: trace
3+
4+
| values valuesContainer |
5+
values := trace valuesForProbeId: self id.
6+
values first traceHasFailedBefore ifTrue: [
7+
^ 'Error during execution: ' , trace recordedException printString].
8+
9+
values := self filterValues: values throughSliderForTrace: trace.
10+
values ifEmpty: [^ self noValuesText].
11+
12+
valuesContainer := self newContainerMorph.
13+
values
14+
do: [:v | valuesContainer addMorphBack: (self valueMorphFor: v)]
15+
separatedBy: [valuesContainer addMorphBack: ', ' asMorph].
16+
17+
^ valuesContainer

packages/Babylonian-UI.package/BPProbeMorph.class/instance/valuesTextFor..st

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)