Skip to content

Commit 39db74f

Browse files
authored
Merge pull request #73 from OpenSmock/issue_0056
rename strings + help on multiples inputs + chage icon of visibility
2 parents 0f5ff5b + 1d18658 commit 39db74f

20 files changed

Lines changed: 182 additions & 538 deletions

src/Pyramid-Bloc/PyramidBasicConstraintsInputPresenter.class.st

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,32 @@ PyramidBasicConstraintsInputPresenter >> initializePresenters [
4646
whenValueChangedDo := [ :visibility | ].
4747
buttonExact := SpButtonPresenter new
4848
label: 'Exact';
49+
help: 'Set the constraints to an exact value in px.';
4950
action: [
5051
self value:
5152
(BlLayoutCommonConstraintsAxis new exact: 50).
5253
self whenValueChangedDo value: self value ];
5354
enabled: false;
5455
yourself.
5556
buttonMatchParent := SpButtonPresenter new
56-
label: 'Match Parent';
57-
action: [
58-
self value:
59-
(BlLayoutCommonConstraintsAxis new matchParent).
60-
self whenValueChangedDo value: self value ];
61-
enabled: false;
62-
yourself.
63-
buttonFitContent := SpButtonPresenter new
64-
label: 'Fit Content';
65-
action: [
66-
self value:
67-
(BlLayoutCommonConstraintsAxis new fitContent).
68-
self whenValueChangedDo value: self value ];
69-
enabled: false;
70-
yourself
57+
label: 'Match Parent';
58+
help: 'Set the constraints to match the parent size.';
59+
action: [
60+
self value:
61+
BlLayoutCommonConstraintsAxis new
62+
matchParent.
63+
self whenValueChangedDo value: self value ];
64+
enabled: false;
65+
yourself.
66+
buttonFitContent := SpButtonPresenter new
67+
label: 'Fit Content';
68+
help: 'Set the constraints to match the children size.';
69+
action: [
70+
self value:
71+
BlLayoutCommonConstraintsAxis new fitContent.
72+
self whenValueChangedDo value: self value ];
73+
enabled: false;
74+
yourself
7175
]
7276

7377
{ #category : #initialization }

src/Pyramid-Bloc/PyramidBlocPlugin.class.st

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ PyramidBlocPlugin class >> background [
2020
pyramidInputPresenterClass:
2121
PyramidBackgroundInputWithModalPresenter;
2222
yourself.
23-
property pyramidInputPresenterModel help:
24-
'Change the background of the element with a color, a gradient, an image'.
25-
property pyramidInputPresenterModel windowTitle: 'Change background'.
23+
property pyramidInputPresenterStrings help:
24+
'Change the background of the element with a color, a gradient, an image.'.
25+
property pyramidInputPresenterStrings windowTitle: 'Change background'.
2626
^ property
2727
]
2828

@@ -35,12 +35,11 @@ PyramidBlocPlugin class >> clipChildren [
3535
command: PyramidClipChildrenCommand new;
3636
pyramidInputPresenterClass: PyramidSwitchInputPresenter;
3737
yourself.
38-
property pyramidInputPresenterModel help: 'If clipChildren is true, the children will not display outside the geometry of the parent element. If clipChildren is false, the children will display outside the geometry of the parent element.'.
39-
property pyramidInputPresenterModel onLabel: 'True'.
40-
property pyramidInputPresenterModel offLabel:
41-
'False'.
42-
property pyramidInputPresenterModel uncertainLabel:
43-
'Uncertain'.
38+
property pyramidInputPresenterStrings help:
39+
'If clipChildren is true, the children will not display outside the geometry of the parent element. If clipChildren is false, the children will display outside the geometry of the parent element.'.
40+
property pyramidInputPresenterStrings onLabel: 'True'.
41+
property pyramidInputPresenterStrings offLabel: 'False'.
42+
property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'.
4443
^ property
4544
]
4645

@@ -68,7 +67,7 @@ PyramidBlocPlugin class >> constraintsBasicHExact [
6867
PyramidBasicExactHorizontalConstraintsBlocCommand new;
6968
pyramidInputPresenterClass: PyramidNumberInputPresenter;
7069
yourself.
71-
property pyramidInputPresenterModel help:
70+
property pyramidInputPresenterStrings help:
7271
'Change the width of the object'.
7372
^ property
7473
]
@@ -93,10 +92,11 @@ PyramidBlocPlugin class >> constraintsBasicVExact [
9392
| property |
9493
property := PyramidProperty new
9594
name: 'Constraints - height';
96-
command: PyramidBasicExactVerticalConstraintsBlocCommand new;
95+
command:
96+
PyramidBasicExactVerticalConstraintsBlocCommand new;
9797
pyramidInputPresenterClass: PyramidNumberInputPresenter;
9898
yourself.
99-
property pyramidInputPresenterModel help:
99+
property pyramidInputPresenterStrings help:
100100
'Change the height of the object'.
101101
^ property
102102
]
@@ -111,7 +111,7 @@ PyramidBlocPlugin class >> constraintsPropH [
111111
PyramidProportionnalHorizontalConstraintsCommand new;
112112
pyramidInputPresenterClass: PyramidPointInputPresenter;
113113
yourself.
114-
property pyramidInputPresenterModel
114+
property pyramidInputPresenterStrings
115115
help: 'Define the proportion of the horizontal component.';
116116
labelX: 'Left';
117117
labelY: 'Right'.
@@ -128,7 +128,7 @@ PyramidBlocPlugin class >> constraintsPropV [
128128
PyramidProportionnalVerticalConstraintsCommand new;
129129
pyramidInputPresenterClass: PyramidPointInputPresenter;
130130
yourself.
131-
property pyramidInputPresenterModel
131+
property pyramidInputPresenterStrings
132132
help: 'Define the proportion of the vertical component.';
133133
labelX: 'Top';
134134
labelY: 'Bottom'.
@@ -145,6 +145,11 @@ PyramidBlocPlugin class >> cornerRadii [
145145
pyramidInputPresenterClass:
146146
PyramidCornerRadiiInputPresenter;
147147
yourself.
148+
property pyramidInputPresenterStrings help:
149+
'Change the corner radius of the geometry. For example:
150+
- "10" to set a radius of 10 px on each corner.
151+
- "10 20" to set a radius of 10 px on the top-left and bottom-right corner and 20 px on the top-right and bottom-left corner.
152+
- "10 20 30 40" to set a radius of 10 px on top-left, 20 px on top-right, 30 px on bottom-right and 40 px on bottom-left.'.
148153
^ property
149154
]
150155

@@ -157,7 +162,7 @@ PyramidBlocPlugin class >> elementId [
157162
command: PyramidElementIdCommand new;
158163
pyramidInputPresenterClass: PyramidTextInputPresenter;
159164
yourself.
160-
property pyramidInputPresenterModel help: 'Change the id.'.
165+
property pyramidInputPresenterStrings help: 'Change the id.'.
161166
^ property
162167
]
163168

@@ -171,11 +176,11 @@ PyramidBlocPlugin class >> flowLayoutOrientation [
171176
pyramidInputPresenterClass:
172177
PyramidFlowLayoutOrientationPresenter;
173178
yourself.
174-
property pyramidInputPresenterModel help:
179+
property pyramidInputPresenterStrings help:
175180
'Change the orientation of the flow layout.'.
176-
property pyramidInputPresenterModel onLabel: 'Vertical'.
177-
property pyramidInputPresenterModel offLabel: 'Horizontal'.
178-
property pyramidInputPresenterModel uncertainLabel: 'Uncertain'.
181+
property pyramidInputPresenterStrings onLabel: 'Vertical'.
182+
property pyramidInputPresenterStrings offLabel: 'Horizontal'.
183+
property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'.
179184
^ property
180185
]
181186

@@ -221,6 +226,10 @@ PyramidBlocPlugin class >> margin [
221226
command: PyramidMarginCommand new;
222227
pyramidInputPresenterClass: PyramidInsetsInputPresenter;
223228
yourself.
229+
property pyramidInputPresenterStrings help: 'Change the margin. The margin will affect the space between the border and the elements outside. For example:
230+
- "10" to set a margin of 10 px on each size.
231+
- "10 20" to set a margin of 10 px on the top and bottom and 20 px on the right and left.
232+
- "10 20 30 40" to set a margin of 10 px on top, 20 px on left, 30 px on bottom and 40 px on right.'..
224233
^ property
225234
]
226235

@@ -233,6 +242,11 @@ PyramidBlocPlugin class >> padding [
233242
command: PyramidPaddingCommand new;
234243
pyramidInputPresenterClass: PyramidInsetsInputPresenter;
235244
yourself.
245+
property pyramidInputPresenterStrings help:
246+
'Change the padding. The padding will affect the space between the border and the elements inside. For example:
247+
- "10" to set a padding of 10 px on each size.
248+
- "10 20" to set a padding of 10 px on the top and bottom and 20 px on the right and left.
249+
- "10 20 30 40" to set a padding of 10 px on top, 20 px on left, 30 px on bottom and 40 px on right.'.
236250
^ property
237251
]
238252

@@ -245,7 +259,7 @@ PyramidBlocPlugin class >> position [
245259
command: PyramidPositionCommand new;
246260
pyramidInputPresenterClass: PyramidPointInputPresenter;
247261
yourself.
248-
property pyramidInputPresenterModel help:
262+
property pyramidInputPresenterStrings help:
249263
'Set the position x and y of the element inside his parent.'.
250264
^ property
251265
]
@@ -271,7 +285,8 @@ PyramidBlocPlugin class >> zIndex [
271285
command: PyramidZIndexCommand new;
272286
pyramidInputPresenterClass: PyramidNumberInputPresenter;
273287
yourself.
274-
property pyramidInputPresenterModel help: 'Change the elevation (#zIndex:). Bloc will used the elevation to determine wich of two sibling must be draw on top. The higher zIndex will be drawn on top of the lesser one.'.
288+
property pyramidInputPresenterStrings help:
289+
'Change the elevation (#zIndex:). Bloc will used the elevation to determine wich of two sibling must be draw on top. The higher zIndex will be drawn on top of the lesser one.'.
275290
^ property
276291
]
277292

src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ PyramidBlocTextPlugin class >> changeText [
1515
command: PyramidChangeTextCommand new;
1616
pyramidInputPresenterClass: PyramidTextInputPresenter;
1717
yourself.
18-
property pyramidInputPresenterModel help:
18+
property pyramidInputPresenterStrings help:
1919
'Change the value of the text'.
2020
^ property
2121
]
@@ -29,8 +29,7 @@ PyramidBlocTextPlugin class >> fontSize [
2929
command: PyramidFontSizeCommand new;
3030
pyramidInputPresenterClass: PyramidNumberInputPresenter;
3131
yourself.
32-
property pyramidInputPresenterModel help:
33-
'Change the font size.'.
32+
property pyramidInputPresenterStrings help: 'Change the font size.'.
3433
^ property
3534
]
3635

@@ -43,7 +42,7 @@ PyramidBlocTextPlugin class >> fontWeight [
4342
command: PyramidFontWeightCommand new;
4443
pyramidInputPresenterClass: PyramidNumberInputPresenter;
4544
yourself.
46-
property pyramidInputPresenterModel help: 'Change the font weight.'.
45+
property pyramidInputPresenterStrings help: 'Change the font weight.'.
4746
^ property
4847
]
4948

@@ -63,7 +62,7 @@ PyramidBlocTextPlugin class >> textForeground [
6362
pyramidInputPresenterClass:
6463
PyramidColorInputSingleLineWithPickupButtonPresenter;
6564
yourself.
66-
property pyramidInputPresenterModel help:
65+
property pyramidInputPresenterStrings help:
6766
'Change the color of the text'.
6867
^ property
6968
]

src/Pyramid-Bloc/PyramidCornerRadiiInputPresenter.class.st

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Class {
88
#category : #'Pyramid-Bloc-plugin-bloc'
99
}
1010

11+
{ #category : #'as yet unclassified' }
12+
PyramidCornerRadiiInputPresenter >> applyStrings [
13+
14+
self inputArray strings: self strings
15+
]
16+
1117
{ #category : #'as yet unclassified' }
1218
PyramidCornerRadiiInputPresenter >> cornerRadiiFrom: anArray [
1319

src/Pyramid-Bloc/PyramidInsetsInputPresenter.class.st

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Class {
88
#category : #'Pyramid-Bloc-plugin-bloc'
99
}
1010

11+
{ #category : #'as yet unclassified' }
12+
PyramidInsetsInputPresenter >> applyStrings [
13+
14+
self inputArray strings: self strings.
15+
]
16+
1117
{ #category : #layout }
1218
PyramidInsetsInputPresenter >> defaultLayout [
1319

src/Pyramid-Bloc/PyramidLayoutInputPresenter.class.st

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,28 @@ PyramidLayoutInputPresenter >> initializePresenters [
4646
whenValueChangedDo := [ :visibility | ].
4747
buttonBasic := SpButtonPresenter new
4848
label: 'No layout';
49+
help:
50+
'Remove the layout. The children will be place according to their position.';
4951
action: [
5052
self value: BlBasicLayout new.
5153
self whenValueChangedDo value: self value ];
5254
enabled: false;
5355
yourself.
5456
buttonFlow := SpButtonPresenter new
5557
label: 'Flow';
58+
help:
59+
'Set the layout as Flow. The children will be place according to their order. The flow layout will display all children in line and will wrap arround if it does not have enought place.';
5660
action: [
5761
self value: BlFlowLayout horizontal.
5862
self whenValueChangedDo value: self value ];
5963
enabled: false;
6064
yourself.
6165
buttonProportionnal := SpButtonPresenter new
6266
label: 'ST layout';
67+
help:
68+
'Set the layout as Proportional. The children will be place according to their relative top/bottom and left/right proportion.';
6369
action: [
64-
self value:
65-
BlProportionalLayout new.
70+
self value: BlProportionalLayout new.
6671
self whenValueChangedDo value: self value ];
6772
enabled: false;
6873
yourself

src/Pyramid-Bloc/PyramidSwitchInputPresenter.class.st

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,16 +554,16 @@ PyramidSwitchInputPresenter class >> formToggleUncertain [
554554
]
555555

556556
{ #category : #accessing }
557-
PyramidSwitchInputPresenter class >> modelClass [
557+
PyramidSwitchInputPresenter class >> stringsClass [
558558

559559
^ PyramidSwitchInputStrings
560560
]
561561

562562
{ #category : #'as yet unclassified' }
563-
PyramidSwitchInputPresenter >> applyModel [
563+
PyramidSwitchInputPresenter >> applyStrings [
564564

565-
self button help: self model help.
566-
self button label: self model offLabel
565+
self button help: self strings help.
566+
self button label: self strings offLabel
567567
]
568568

569569
{ #category : #accessing }
@@ -631,13 +631,13 @@ PyramidSwitchInputPresenter >> value: aBoolean [
631631
self button action: [ self switchState ].
632632
aBoolean
633633
ifTrue: [ self button icon: self class formToggleOn.
634-
self button label: self model onLabel ]
634+
self button label: self strings onLabel ]
635635
ifFalse: [ self button icon: self class formToggleOff.
636-
self button label: self model offLabel ].
636+
self button label: self strings offLabel ].
637637
^ self ].
638638
self state: PyramidUnknowState new.
639639
self button icon: self class formToggleUncertain.
640-
self button label: self model uncertainLabel.
640+
self button label: self strings uncertainLabel.
641641
self button action: [ ]
642642
]
643643

0 commit comments

Comments
 (0)