-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from OpenSmock/dev
update main to test the current CI
- Loading branch information
Showing
347 changed files
with
13,798 additions
and
17,323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
'srcDirectory' : 'src' | ||
} | ||
'srcDirectory' : 'src', | ||
'tags' : [ #opensmock ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Extension { #name : #BlColorPaint } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlColorPaint >> pyramidBackgroundPreview [ | ||
|
||
^ PyramidPaintPreviewSolidColor new color: self color | ||
] | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlColorPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [ | ||
|
||
aPyramidPaintInput buttonColor click. | ||
aPyramidPaintInput inputSolid defaultColor: self color | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Extension { #name : #BlCompositeBackground } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlCompositeBackground >> pyramidBackgroundStrategy [ | ||
|
||
^ PyramidBackgroundPropertyInputUnknownStrategy new | ||
] | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlCompositeBackground >> pyramidSelectMenuOnModal: aModal [ | ||
|
||
aModal buttonComposite click | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Extension { #name : #BlElementGeometry } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlElementGeometry >> pyramidSelectOnPresenter: aPresenter [ | ||
|
||
| selection | | ||
aPresenter model: PyramidGeometryModel default. | ||
selection := aPresenter model select: [ :each | | ||
each isSelectableWith: self ]. | ||
selection ifNotEmpty: [ selection first selectModelWith: self ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Extension { #name : #BlGradientPaint } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlGradientPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [ | ||
|
||
aPyramidPaintInput buttonGradient click. | ||
aPyramidPaintInput inputGradient stopsColor stopManager from: self stops. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Extension { #name : #BlImageBackground } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlImageBackground >> pyramidBackgroundStrategy [ | ||
|
||
(self image respondsTo: #pyramidExternalRessourceSource) ifTrue: [ | ||
^ PyramidBackgroundPropertyInputImage new | ||
ressource: self image pyramidExternalRessourceSource; | ||
yourself ]. | ||
^ PyramidBackgroundPropertyInputImage new | ||
ressource: nil; | ||
yourself | ||
] | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlImageBackground >> pyramidSelectMenuOnModal: aModal [ | ||
|
||
aModal buttonImage click. | ||
aModal currentPresenter setImage: self image | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Extension { #name : #BlLayoutCommonConstraintsAxis } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlLayoutCommonConstraintsAxis >> pyramidSelectConstraintsOn: aPyramidConstraintsPresenter [ | ||
|
||
self resizer pyramidSelectConstraintsResizerOn: aPyramidConstraintsPresenter | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Extension { #name : #BlLayoutExactResizer } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlLayoutExactResizer >> pyramidSelectConstraintsResizerOn: aPyramidConstraintsPresenter [ | ||
|
||
| item | | ||
item := (aPyramidConstraintsPresenter selectorInputs select: [ :each | | ||
each value targetClass = self class ]) first. | ||
item key click. | ||
aPyramidConstraintsPresenter submit: item value. | ||
item value associatedPresenter number: self size. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Extension { #name : #BlLayoutResizer } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlLayoutResizer >> pyramidSelectConstraintsResizerOn: aPyramidConstraintsPresenter [ | ||
|
||
| item | | ||
item := (aPyramidConstraintsPresenter selectorInputs select: [ :each | | ||
each value targetClass = self class ]) first. | ||
item key click. | ||
aPyramidConstraintsPresenter submit: item value | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Extension { #name : #BlLinearGradientPaint } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlLinearGradientPaint >> pyramidBackgroundPreview [ | ||
|
||
^ PyramidPaintPreviewGradientColor new | ||
stops: self stops; | ||
yourself | ||
] | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlLinearGradientPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [ | ||
|
||
super pyramidModalDefaultPaint: aPyramidPaintInput. | ||
aPyramidPaintInput inputGradient modeSelector buttonLinear click. | ||
aPyramidPaintInput inputGradient modeSelector linearDirection point: self end - self start | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Extension { #name : #BlPaintBackground } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlPaintBackground >> pyramidBackgroundStrategy [ | ||
|
||
^ PyramidBackgroundPropertyInputPaint new paint: self paint; yourself | ||
] | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlPaintBackground >> pyramidSelectMenuOnModal: aModal [ | ||
|
||
aModal buttonPaint click. | ||
aModal currentPresenter setDefaultPaint: self paint | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Extension { #name : #BlRadialGradientPaint } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlRadialGradientPaint >> pyramidBackgroundPreview [ | ||
|
||
^ PyramidPaintPreviewGradientColor new | ||
stops: self stops; | ||
yourself | ||
] | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlRadialGradientPaint >> pyramidModalDefaultPaint: aPyramidPaintInput [ | ||
|
||
super pyramidModalDefaultPaint: aPyramidPaintInput. | ||
aPyramidPaintInput inputGradient modeSelector buttonRadial click. | ||
aPyramidPaintInput inputGradient modeSelector linearDirection point: | ||
self center. | ||
aPyramidPaintInput inputGradient modeSelector radialPosition point: | ||
self center. | ||
aPyramidPaintInput inputGradient modeSelector radialRadius number: | ||
self radius | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Extension { #name : #BlTransparentBackground } | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlTransparentBackground >> pyramidBackgroundStrategy [ | ||
|
||
^ PyramidBackgroundPropertyInputTransparent new | ||
] | ||
|
||
{ #category : #'*Pyramid-Bloc' } | ||
BlTransparentBackground >> pyramidSelectMenuOnModal: aModal [ | ||
|
||
aModal buttonTransparent click. | ||
] |
11 changes: 11 additions & 0 deletions
11
src/Pyramid-Bloc/PyramidBackgroundAbstractBackgroundInput.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Class { | ||
#name : #PyramidBackgroundAbstractBackgroundInput, | ||
#superclass : #SpPresenter, | ||
#category : #'Pyramid-Bloc-custom-specs-background' | ||
} | ||
|
||
{ #category : #accessing } | ||
PyramidBackgroundAbstractBackgroundInput >> background [ | ||
|
||
^ self shouldBeImplemented | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
Class { | ||
#name : #PyramidBackgroundInputImage, | ||
#superclass : #PyramidBackgroundAbstractBackgroundInput, | ||
#instVars : [ | ||
'form', | ||
'classMethodPresenter', | ||
'pathInput', | ||
'exploreButton' | ||
], | ||
#category : #'Pyramid-Bloc-custom-specs-background' | ||
} | ||
|
||
{ #category : #'as yet unclassified' } | ||
PyramidBackgroundInputImage >> actionOpenFileExplorer [ | ||
|
||
| dialog result | | ||
dialog := FileDialogWindow onFileSystem: FileSystem disk. | ||
result := dialog openModal answer. | ||
result | ||
ifNil: [ self pathInput text: '' ] | ||
ifNotNil: [ self pathInput text: result ]. | ||
] | ||
|
||
{ #category : #accessing } | ||
PyramidBackgroundInputImage >> background [ | ||
|
||
self submitFormFromText: self pathInput text. | ||
self form ifNil: [ ^ BlBackground transparent ]. | ||
^ BlBackground image: self form | ||
] | ||
|
||
{ #category : #layout } | ||
PyramidBackgroundInputImage >> defaultLayout [ | ||
|
||
^ SpBoxLayout newHorizontal | ||
add: self pathInput expand: true; | ||
add: self exploreButton expand: false; | ||
yourself | ||
] | ||
|
||
{ #category : #accessing } | ||
PyramidBackgroundInputImage >> exploreButton [ | ||
^ exploreButton | ||
] | ||
|
||
{ #category : #accessing } | ||
PyramidBackgroundInputImage >> form [ | ||
|
||
^ form | ||
] | ||
|
||
{ #category : #accessing } | ||
PyramidBackgroundInputImage >> form: anObject [ | ||
|
||
form := anObject | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
PyramidBackgroundInputImage >> formFromClass: class andSelector: selector [ | ||
|
||
self form: (PyramidExternalRessourceProxy fromSource: | ||
(PyramidExternalRessourceSource target: class selector: selector)) | ||
] | ||
|
||
{ #category : #initialization } | ||
PyramidBackgroundInputImage >> initializePresenters [ | ||
|
||
pathInput := SpTextInputFieldPresenter new whenSubmitDo: [ :text | | ||
self submitFormFromText: text ]. | ||
exploreButton := SpButtonPresenter new | ||
icon: (self iconNamed: #configNew); | ||
action: [ self actionOpenFileExplorer ]; | ||
yourself | ||
] | ||
|
||
{ #category : #accessing } | ||
PyramidBackgroundInputImage >> pathInput [ | ||
|
||
^ pathInput | ||
] | ||
|
||
{ #category : #initialization } | ||
PyramidBackgroundInputImage >> previewPresenterFrom: model [ | ||
|
||
| object | | ||
model targetClass ifNil: [ | ||
^ SpLabelPresenter new | ||
label: 'No class selected.'; | ||
yourself ]. | ||
(model targetClass canUnderstand: model methodSelector) ifFalse: [ | ||
^ SpLabelPresenter new | ||
label: 'Can not perform method.'; | ||
yourself ]. | ||
object := model targetClass perform: model methodSelector. | ||
(object isKindOf: Form) ifFalse: [ ^ SpLabelPresenter new | ||
label: 'Image is not a Form. Will be remplaced by a BlTransparentBackground.'; | ||
yourself ]. | ||
^ SpImagePresenter new | ||
image: object; | ||
yourself | ||
] | ||
|
||
{ #category : #initialization } | ||
PyramidBackgroundInputImage >> setImage: anImage [ | ||
|
||
(anImage respondsTo: #pyramidExternalRessourceSource) ifTrue: [ | ||
self pathInput text: anImage pyramidExternalRessourceSource arguments first fullName ] | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
PyramidBackgroundInputImage >> submitFormFromText: aString [ | ||
|
||
aString asFileReference exists ifFalse: [ self pathInput text: '' ]. | ||
self form: (PyramidExternalRessourceProxy fromSource: | ||
(PyramidExternalRessourceSource formFromFileNamed: | ||
(aString))) | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
PyramidBackgroundInputImage >> validateSelection: model [ | ||
|
||
model targetClass ifNil: [ ^ false ]. | ||
model methodSelector ifNil: [ ^ false ]. | ||
(model targetClass class canUnderstand: model methodSelector) ifFalse: [ ^ false ]. | ||
^ (model targetClass perform: model methodSelector withArguments: model methodArguments) isKindOf: Form | ||
|
||
] |
17 changes: 17 additions & 0 deletions
17
src/Pyramid-Bloc/PyramidBackgroundInputTransparent.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Class { | ||
#name : #PyramidBackgroundInputTransparent, | ||
#superclass : #PyramidBackgroundAbstractBackgroundInput, | ||
#category : #'Pyramid-Bloc-custom-specs-background' | ||
} | ||
|
||
{ #category : #accessing } | ||
PyramidBackgroundInputTransparent >> background [ | ||
|
||
^ BlBackground transparent | ||
] | ||
|
||
{ #category : #layout } | ||
PyramidBackgroundInputTransparent >> defaultLayout [ | ||
|
||
^ SpBoxLayout newHorizontal add: 'Transparent. Nothing to see here.'; yourself | ||
] |
Oops, something went wrong.