Skip to content

Commit

Permalink
Merge pull request #73 from OpenSmock/issue_0056
Browse files Browse the repository at this point in the history
rename strings + help on multiples inputs + chage icon of visibility
  • Loading branch information
Nyan11 authored Aug 10, 2023
2 parents 0f5ff5b + 1d18658 commit 39db74f
Show file tree
Hide file tree
Showing 20 changed files with 182 additions and 538 deletions.
34 changes: 19 additions & 15 deletions src/Pyramid-Bloc/PyramidBasicConstraintsInputPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -46,28 +46,32 @@ PyramidBasicConstraintsInputPresenter >> initializePresenters [
whenValueChangedDo := [ :visibility | ].
buttonExact := SpButtonPresenter new
label: 'Exact';
help: 'Set the constraints to an exact value in px.';
action: [
self value:
(BlLayoutCommonConstraintsAxis new exact: 50).
self whenValueChangedDo value: self value ];
enabled: false;
yourself.
buttonMatchParent := SpButtonPresenter new
label: 'Match Parent';
action: [
self value:
(BlLayoutCommonConstraintsAxis new matchParent).
self whenValueChangedDo value: self value ];
enabled: false;
yourself.
buttonFitContent := SpButtonPresenter new
label: 'Fit Content';
action: [
self value:
(BlLayoutCommonConstraintsAxis new fitContent).
self whenValueChangedDo value: self value ];
enabled: false;
yourself
label: 'Match Parent';
help: 'Set the constraints to match the parent size.';
action: [
self value:
BlLayoutCommonConstraintsAxis new
matchParent.
self whenValueChangedDo value: self value ];
enabled: false;
yourself.
buttonFitContent := SpButtonPresenter new
label: 'Fit Content';
help: 'Set the constraints to match the children size.';
action: [
self value:
BlLayoutCommonConstraintsAxis new fitContent.
self whenValueChangedDo value: self value ];
enabled: false;
yourself
]

{ #category : #initialization }
Expand Down
57 changes: 36 additions & 21 deletions src/Pyramid-Bloc/PyramidBlocPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ PyramidBlocPlugin class >> background [
pyramidInputPresenterClass:
PyramidBackgroundInputWithModalPresenter;
yourself.
property pyramidInputPresenterModel help:
'Change the background of the element with a color, a gradient, an image'.
property pyramidInputPresenterModel windowTitle: 'Change background'.
property pyramidInputPresenterStrings help:
'Change the background of the element with a color, a gradient, an image.'.
property pyramidInputPresenterStrings windowTitle: 'Change background'.
^ property
]

Expand All @@ -35,12 +35,11 @@ PyramidBlocPlugin class >> clipChildren [
command: PyramidClipChildrenCommand new;
pyramidInputPresenterClass: PyramidSwitchInputPresenter;
yourself.
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.'.
property pyramidInputPresenterModel onLabel: 'True'.
property pyramidInputPresenterModel offLabel:
'False'.
property pyramidInputPresenterModel uncertainLabel:
'Uncertain'.
property pyramidInputPresenterStrings 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.'.
property pyramidInputPresenterStrings onLabel: 'True'.
property pyramidInputPresenterStrings offLabel: 'False'.
property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'.
^ property
]

Expand Down Expand Up @@ -68,7 +67,7 @@ PyramidBlocPlugin class >> constraintsBasicHExact [
PyramidBasicExactHorizontalConstraintsBlocCommand new;
pyramidInputPresenterClass: PyramidNumberInputPresenter;
yourself.
property pyramidInputPresenterModel help:
property pyramidInputPresenterStrings help:
'Change the width of the object'.
^ property
]
Expand All @@ -93,10 +92,11 @@ PyramidBlocPlugin class >> constraintsBasicVExact [
| property |
property := PyramidProperty new
name: 'Constraints - height';
command: PyramidBasicExactVerticalConstraintsBlocCommand new;
command:
PyramidBasicExactVerticalConstraintsBlocCommand new;
pyramidInputPresenterClass: PyramidNumberInputPresenter;
yourself.
property pyramidInputPresenterModel help:
property pyramidInputPresenterStrings help:
'Change the height of the object'.
^ property
]
Expand All @@ -111,7 +111,7 @@ PyramidBlocPlugin class >> constraintsPropH [
PyramidProportionnalHorizontalConstraintsCommand new;
pyramidInputPresenterClass: PyramidPointInputPresenter;
yourself.
property pyramidInputPresenterModel
property pyramidInputPresenterStrings
help: 'Define the proportion of the horizontal component.';
labelX: 'Left';
labelY: 'Right'.
Expand All @@ -128,7 +128,7 @@ PyramidBlocPlugin class >> constraintsPropV [
PyramidProportionnalVerticalConstraintsCommand new;
pyramidInputPresenterClass: PyramidPointInputPresenter;
yourself.
property pyramidInputPresenterModel
property pyramidInputPresenterStrings
help: 'Define the proportion of the vertical component.';
labelX: 'Top';
labelY: 'Bottom'.
Expand All @@ -145,6 +145,11 @@ PyramidBlocPlugin class >> cornerRadii [
pyramidInputPresenterClass:
PyramidCornerRadiiInputPresenter;
yourself.
property pyramidInputPresenterStrings help:
'Change the corner radius of the geometry. For example:
- "10" to set a radius of 10 px on each corner.
- "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.
- "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.'.
^ property
]

Expand All @@ -157,7 +162,7 @@ PyramidBlocPlugin class >> elementId [
command: PyramidElementIdCommand new;
pyramidInputPresenterClass: PyramidTextInputPresenter;
yourself.
property pyramidInputPresenterModel help: 'Change the id.'.
property pyramidInputPresenterStrings help: 'Change the id.'.
^ property
]

Expand All @@ -171,11 +176,11 @@ PyramidBlocPlugin class >> flowLayoutOrientation [
pyramidInputPresenterClass:
PyramidFlowLayoutOrientationPresenter;
yourself.
property pyramidInputPresenterModel help:
property pyramidInputPresenterStrings help:
'Change the orientation of the flow layout.'.
property pyramidInputPresenterModel onLabel: 'Vertical'.
property pyramidInputPresenterModel offLabel: 'Horizontal'.
property pyramidInputPresenterModel uncertainLabel: 'Uncertain'.
property pyramidInputPresenterStrings onLabel: 'Vertical'.
property pyramidInputPresenterStrings offLabel: 'Horizontal'.
property pyramidInputPresenterStrings uncertainLabel: 'Uncertain'.
^ property
]

Expand Down Expand Up @@ -221,6 +226,10 @@ PyramidBlocPlugin class >> margin [
command: PyramidMarginCommand new;
pyramidInputPresenterClass: PyramidInsetsInputPresenter;
yourself.
property pyramidInputPresenterStrings help: 'Change the margin. The margin will affect the space between the border and the elements outside. For example:
- "10" to set a margin of 10 px on each size.
- "10 20" to set a margin of 10 px on the top and bottom and 20 px on the right and left.
- "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.'..
^ property
]

Expand All @@ -233,6 +242,11 @@ PyramidBlocPlugin class >> padding [
command: PyramidPaddingCommand new;
pyramidInputPresenterClass: PyramidInsetsInputPresenter;
yourself.
property pyramidInputPresenterStrings help:
'Change the padding. The padding will affect the space between the border and the elements inside. For example:
- "10" to set a padding of 10 px on each size.
- "10 20" to set a padding of 10 px on the top and bottom and 20 px on the right and left.
- "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.'.
^ property
]

Expand All @@ -245,7 +259,7 @@ PyramidBlocPlugin class >> position [
command: PyramidPositionCommand new;
pyramidInputPresenterClass: PyramidPointInputPresenter;
yourself.
property pyramidInputPresenterModel help:
property pyramidInputPresenterStrings help:
'Set the position x and y of the element inside his parent.'.
^ property
]
Expand All @@ -271,7 +285,8 @@ PyramidBlocPlugin class >> zIndex [
command: PyramidZIndexCommand new;
pyramidInputPresenterClass: PyramidNumberInputPresenter;
yourself.
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.'.
property pyramidInputPresenterStrings 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.'.
^ property
]

Expand Down
9 changes: 4 additions & 5 deletions src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PyramidBlocTextPlugin class >> changeText [
command: PyramidChangeTextCommand new;
pyramidInputPresenterClass: PyramidTextInputPresenter;
yourself.
property pyramidInputPresenterModel help:
property pyramidInputPresenterStrings help:
'Change the value of the text'.
^ property
]
Expand All @@ -29,8 +29,7 @@ PyramidBlocTextPlugin class >> fontSize [
command: PyramidFontSizeCommand new;
pyramidInputPresenterClass: PyramidNumberInputPresenter;
yourself.
property pyramidInputPresenterModel help:
'Change the font size.'.
property pyramidInputPresenterStrings help: 'Change the font size.'.
^ property
]

Expand All @@ -43,7 +42,7 @@ PyramidBlocTextPlugin class >> fontWeight [
command: PyramidFontWeightCommand new;
pyramidInputPresenterClass: PyramidNumberInputPresenter;
yourself.
property pyramidInputPresenterModel help: 'Change the font weight.'.
property pyramidInputPresenterStrings help: 'Change the font weight.'.
^ property
]

Expand All @@ -63,7 +62,7 @@ PyramidBlocTextPlugin class >> textForeground [
pyramidInputPresenterClass:
PyramidColorInputSingleLineWithPickupButtonPresenter;
yourself.
property pyramidInputPresenterModel help:
property pyramidInputPresenterStrings help:
'Change the color of the text'.
^ property
]
Expand Down
6 changes: 6 additions & 0 deletions src/Pyramid-Bloc/PyramidCornerRadiiInputPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Class {
#category : #'Pyramid-Bloc-plugin-bloc'
}

{ #category : #'as yet unclassified' }
PyramidCornerRadiiInputPresenter >> applyStrings [

self inputArray strings: self strings
]

{ #category : #'as yet unclassified' }
PyramidCornerRadiiInputPresenter >> cornerRadiiFrom: anArray [

Expand Down
6 changes: 6 additions & 0 deletions src/Pyramid-Bloc/PyramidInsetsInputPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Class {
#category : #'Pyramid-Bloc-plugin-bloc'
}

{ #category : #'as yet unclassified' }
PyramidInsetsInputPresenter >> applyStrings [

self inputArray strings: self strings.
]

{ #category : #layout }
PyramidInsetsInputPresenter >> defaultLayout [

Expand Down
9 changes: 7 additions & 2 deletions src/Pyramid-Bloc/PyramidLayoutInputPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,28 @@ PyramidLayoutInputPresenter >> initializePresenters [
whenValueChangedDo := [ :visibility | ].
buttonBasic := SpButtonPresenter new
label: 'No layout';
help:
'Remove the layout. The children will be place according to their position.';
action: [
self value: BlBasicLayout new.
self whenValueChangedDo value: self value ];
enabled: false;
yourself.
buttonFlow := SpButtonPresenter new
label: 'Flow';
help:
'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.';
action: [
self value: BlFlowLayout horizontal.
self whenValueChangedDo value: self value ];
enabled: false;
yourself.
buttonProportionnal := SpButtonPresenter new
label: 'ST layout';
help:
'Set the layout as Proportional. The children will be place according to their relative top/bottom and left/right proportion.';
action: [
self value:
BlProportionalLayout new.
self value: BlProportionalLayout new.
self whenValueChangedDo value: self value ];
enabled: false;
yourself
Expand Down
14 changes: 7 additions & 7 deletions src/Pyramid-Bloc/PyramidSwitchInputPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -554,16 +554,16 @@ PyramidSwitchInputPresenter class >> formToggleUncertain [
]

{ #category : #accessing }
PyramidSwitchInputPresenter class >> modelClass [
PyramidSwitchInputPresenter class >> stringsClass [

^ PyramidSwitchInputStrings
]

{ #category : #'as yet unclassified' }
PyramidSwitchInputPresenter >> applyModel [
PyramidSwitchInputPresenter >> applyStrings [

self button help: self model help.
self button label: self model offLabel
self button help: self strings help.
self button label: self strings offLabel
]

{ #category : #accessing }
Expand Down Expand Up @@ -631,13 +631,13 @@ PyramidSwitchInputPresenter >> value: aBoolean [
self button action: [ self switchState ].
aBoolean
ifTrue: [ self button icon: self class formToggleOn.
self button label: self model onLabel ]
self button label: self strings onLabel ]
ifFalse: [ self button icon: self class formToggleOff.
self button label: self model offLabel ].
self button label: self strings offLabel ].
^ self ].
self state: PyramidUnknowState new.
self button icon: self class formToggleUncertain.
self button label: self model uncertainLabel.
self button label: self strings uncertainLabel.
self button action: [ ]
]

Expand Down
Loading

0 comments on commit 39db74f

Please sign in to comment.