Skip to content

Commit 57e0b23

Browse files
authored
Merge pull request #202 from OpenSmock/Issue_0158
Issue 0158
2 parents 05aef3f + 918cfd3 commit 57e0b23

53 files changed

Lines changed: 1006 additions & 716 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Extension { #name : #BlBezierCurveGeometry }
2+
3+
{ #category : #'*Pyramid-Bloc' }
4+
BlBezierCurveGeometry class >> asIcon [
5+
6+
^ super asIcon copy: (0 @ 12 extent: 16 @ 12)
7+
]
8+
9+
{ #category : #'*Pyramid-Bloc' }
10+
BlBezierCurveGeometry class >> pyramidDefaultValue [
11+
12+
^ self controlPoints: {
13+
(0 @ 0).
14+
(0 @ 75).
15+
(50 @ -25).
16+
(50 @ 50) }
17+
]
18+
19+
{ #category : #'*Pyramid-Bloc' }
20+
BlBezierCurveGeometry class >> pyramidDefaultValueForIcon [
21+
22+
^ self controlPoints: {
23+
(0 @ 0).
24+
(0 @ 24).
25+
(16 @ -12).
26+
(16 @ 12) }
27+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Extension { #name : #BlElementGeometry }
2+
3+
{ #category : #'*Pyramid-Bloc' }
4+
BlElementGeometry class >> asIcon [
5+
6+
| element |
7+
element := BlElement new
8+
size: 16 @ 12;
9+
background: (Color gray: 0.75);
10+
border: (BlBorder paint: Color black width: 1);
11+
geometry: self pyramidDefaultValueForIcon;
12+
yourself.
13+
^ element exportAsForm
14+
]
15+
16+
{ #category : #'*Pyramid-Bloc' }
17+
BlElementGeometry class >> asPyramidMagicButton [
18+
19+
^ PyramidMagicButtonModel new
20+
icon: self asIcon;
21+
helpSelected:
22+
('The geometry is <1s>.' expandMacrosWith: self name);
23+
helpNotSelected:
24+
('Set the geometry to <1s>.' expandMacrosWith: self name);
25+
label: '';
26+
inputValue: self pyramidDefaultValue;
27+
inputValidation: [ :value | value isKindOf: self ];
28+
yourself
29+
]
30+
31+
{ #category : #'*Pyramid-Bloc' }
32+
BlElementGeometry class >> pyramidDefaultValue [
33+
34+
^ self new
35+
]
36+
37+
{ #category : #'*Pyramid-Bloc' }
38+
BlElementGeometry class >> pyramidDefaultValueForIcon [
39+
40+
^ self pyramidDefaultValue
41+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Extension { #name : #BlLineGeometry }
2+
3+
{ #category : #'*Pyramid-Bloc' }
4+
BlLineGeometry class >> pyramidDefaultValue [
5+
6+
^ self from: 0 asPoint to: 50 asPoint
7+
]
8+
9+
{ #category : #'*Pyramid-Bloc' }
10+
BlLineGeometry class >> pyramidDefaultValueForIcon [
11+
12+
^ self from: 0 asPoint to: 12 asPoint
13+
]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Extension { #name : #BlPolygonGeometry }
2+
3+
{ #category : #'*Pyramid-Bloc' }
4+
BlPolygonGeometry class >> pyramidDefaultValue [
5+
6+
^ self vertices: {
7+
(0 @ 50).
8+
(0 @ 0).
9+
(25 @ 25).
10+
(50 @ 0).
11+
(50 @ 50) }
12+
]
13+
14+
{ #category : #'*Pyramid-Bloc' }
15+
BlPolygonGeometry class >> pyramidDefaultValueForIcon [
16+
17+
^ self vertices:
18+
(self pyramidDefaultValue vertices collect: [ :each | each / 4.2 ])
19+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Extension { #name : #BlPolylineGeometry }
2+
3+
{ #category : #'*Pyramid-Bloc' }
4+
BlPolylineGeometry class >> pyramidDefaultValue [
5+
6+
^ self vertices: {
7+
(0 @ 50).
8+
(0 @ 0).
9+
(25 @ 25).
10+
(50 @ 0).
11+
(50 @ 50) }
12+
]
13+
14+
{ #category : #'*Pyramid-Bloc' }
15+
BlPolylineGeometry class >> pyramidDefaultValueForIcon [
16+
17+
^ self vertices: (self pyramidDefaultValue vertices collect: [ :each | each / 4.2 ])
18+
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Extension { #name : #BlRoundedRectangleGeometry }
2+
3+
{ #category : #'*Pyramid-Bloc' }
4+
BlRoundedRectangleGeometry class >> pyramidDefaultValue [
5+
6+
^ self cornerRadius: 8
7+
]

src/Pyramid-Bloc/BlVisibility.extension.st

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@ Extension { #name : #BlVisibility }
22

33
{ #category : #'*Pyramid-Bloc' }
44
BlVisibility >> asIcon [
5-
"return a 16 by 16 `Form`"
6-
^ self shouldBeImplemented
5+
6+
| bloc target |
7+
bloc := self class blocIcon.
8+
target := bloc isCollection
9+
ifTrue: [
10+
BlElement new
11+
layout: BlFrameLayout new;
12+
constraintsDo: [ :c |
13+
c horizontal fitContent.
14+
c vertical fitContent ];
15+
addChildren: bloc;
16+
yourself ]
17+
ifFalse: [ bloc ].
18+
^ target exportAsForm
719
]
820

921
{ #category : #'*Pyramid-Bloc' }
@@ -13,6 +25,12 @@ BlVisibility >> asString [
1325
^ self shouldBeImplemented
1426
]
1527

28+
{ #category : #'*Pyramid-Bloc' }
29+
BlVisibility class >> blocIcon [
30+
31+
^ self shouldBeImplemented
32+
]
33+
1634
{ #category : #'*Pyramid-Bloc' }
1735
BlVisibility >> nextVisibilityForTree [
1836
"return the next visibility.

src/Pyramid-Bloc/BlVisibilityGone.extension.st

Lines changed: 105 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,116 @@
11
Extension { #name : #BlVisibilityGone }
22

33
{ #category : #'*Pyramid-Bloc' }
4-
BlVisibilityGone >> asIcon [
4+
BlVisibilityGone >> asString [
55

6-
^ self iconNamed: #haloDismiss
6+
^ 'gone'
77
]
88

99
{ #category : #'*Pyramid-Bloc' }
10-
BlVisibilityGone >> asString [
10+
BlVisibilityGone class >> blocIcon [
11+
"This class has been generated using Pyramid.
1112
12-
^ 'gone'
13+
By: YannLEGOFF
14+
2024-08-02 09:26:40"
15+
16+
<pyStash>
17+
^ [
18+
| blinsets1 |
19+
blinsets1 := BlInsets
20+
top: 0.0
21+
right: 2.0
22+
bottom: 0.0
23+
left: 0.0.
24+
{ (BlElement new
25+
geometry: BlRectangleGeometry new;
26+
constraintsDo: [ :constraints |
27+
constraints horizontal exact: 24.0.
28+
constraints vertical exact: 12.0 ];
29+
layout: BlLinearLayout horizontal;
30+
addChildren: {
31+
(BlElement new
32+
background: (BlPaintBackground new
33+
paint: (BlColorPaint new
34+
color: (Color
35+
r: 0.5728250244379277
36+
g: 0.8191593352883676
37+
b: 1.0
38+
alpha: 1.0);
39+
yourself);
40+
opacity: 1.0;
41+
yourself);
42+
border: (BlBorderBuilder new
43+
paint: (BlColorPaint new
44+
color: (Color
45+
r: 0.0
46+
g: 0.0
47+
b: 0.0
48+
alpha: 1.0);
49+
yourself);
50+
build);
51+
geometry: BlRectangleGeometry new;
52+
constraintsDo: [ :constraints |
53+
constraints horizontal matchParent.
54+
constraints vertical matchParent.
55+
constraints margin: blinsets1 ];
56+
id: #B;
57+
yourself).
58+
(BlElement new
59+
background: (BlPaintBackground new
60+
paint: (BlColorPaint new
61+
color: (Color
62+
r: 0.5728250244379277
63+
g: 0.8191593352883676
64+
b: 1.0
65+
alpha: 1.0);
66+
yourself);
67+
opacity: 1.0;
68+
yourself);
69+
border: (BlBorderBuilder new
70+
paint: (BlColorPaint new
71+
color: (Color
72+
r: 0.0
73+
g: 0.0
74+
b: 0.0
75+
alpha: 1.0);
76+
yourself);
77+
build);
78+
geometry: BlRectangleGeometry new;
79+
constraintsDo: [ :constraints |
80+
constraints horizontal matchParent.
81+
constraints vertical matchParent.
82+
constraints margin: blinsets1 ];
83+
id: #C;
84+
yourself).
85+
(BlElement new
86+
background: (BlPaintBackground new
87+
paint: (BlColorPaint new
88+
color: (Color
89+
r: 0.5728250244379277
90+
g: 0.8191593352883676
91+
b: 1.0
92+
alpha: 1.0);
93+
yourself);
94+
opacity: 1.0;
95+
yourself);
96+
border: (BlBorderBuilder new
97+
paint: (BlColorPaint new
98+
color: (Color
99+
r: 0.0
100+
g: 0.0
101+
b: 0.0
102+
alpha: 1.0);
103+
yourself);
104+
build);
105+
geometry: BlRectangleGeometry new;
106+
visibility: BlVisibility hidden;
107+
constraintsDo: [ :constraints |
108+
constraints horizontal matchParent.
109+
constraints vertical matchParent ];
110+
id: #D;
111+
yourself) };
112+
id: #A;
113+
yourself) } ] value
13114
]
14115

15116
{ #category : #'*Pyramid-Bloc' }

0 commit comments

Comments
 (0)