-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bloc] renamed BlElement>>#defaultPath to defaultGeometry.
[example] …
…added \"sorftware chicken\" example
- Loading branch information
Showing
36 changed files
with
208 additions
and
138 deletions.
There are no files selected for viewing
File renamed without changes.
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,18 @@ | ||
examples | ||
open | ||
<example> | ||
| space chicken | | ||
|
||
space := BlSpace new. | ||
space extent: 500 @ 500. | ||
space title: 'Software chicken'. | ||
|
||
chicken := BlChicken new. | ||
chicken size: 300 @ 350. | ||
space root addChild: chicken. | ||
space root | ||
addEventHandler: | ||
(BlEventHandler | ||
on: BlDblClickEvent | ||
do: [ :evt | BlElementSelection on: evt target ]). | ||
space show |
3 changes: 3 additions & 0 deletions
3
src/Bloc-Examples.package/BlChicken.class/instance/defaultLayout.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,3 @@ | ||
initialization | ||
defaultLayout | ||
^ BlChickenLayout new |
40 changes: 40 additions & 0 deletions
40
src/Bloc-Examples.package/BlChicken.class/instance/initialize.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,40 @@ | ||
initialization | ||
initialize | ||
super initialize. | ||
|
||
|
||
self addChildren: { | ||
BlChickenHead new | ||
constraintsDo: [ :c | | ||
c frame horizontal alignCenter. | ||
c horizontal exact: 75. | ||
c vertical exact: 75 ]; | ||
yourself. | ||
BlChickenBody new | ||
constraintsDo: [ :c | | ||
c frame horizontal alignCenter. | ||
c frame vertical alignCenter. | ||
c horizontal exact: 250. | ||
c vertical exact: 200 ]; | ||
yourself. | ||
|
||
BlElement new | ||
layout: BlLinearLayout horizontal; | ||
constraintsDo: [ :c | | ||
c frame horizontal alignCenter. | ||
c frame vertical alignBottom. | ||
c horizontal fitContent. | ||
c vertical fitContent ]; | ||
addChildren: { | ||
BlChickenLeg new | ||
size: 50@100; | ||
margin: (BlInsets right: 5). | ||
BlChickenLeg new | ||
size: 50@100; | ||
margin: (BlInsets left: 5). | ||
}; | ||
yourself | ||
|
||
|
||
|
||
} |
6 changes: 3 additions & 3 deletions
6
...entSelectionExample.class/properties.json → ...s.package/BlChicken.class/properties.json
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,14 +1,14 @@ | ||
{ | ||
"category" : "Bloc-Sparta-Text", | ||
"category" : "Bloc-Examples-Chicken", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "BlElementSelectionExample", | ||
"name" : "BlChicken", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"super" : "BlElement", | ||
"type" : "normal" } |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
src/Bloc-Examples.package/BlChickenBody.class/instance/defaultBackground.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,8 @@ | ||
initialization | ||
defaultBackground | ||
^ BlRadialGradientPaint new | ||
stops: { | ||
0 -> Color yellow . | ||
1 -> Color orange }; | ||
radius: 200; | ||
center: 100@100 |
3 changes: 3 additions & 0 deletions
3
src/Bloc-Examples.package/BlChickenBody.class/instance/defaultBorder.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,3 @@ | ||
initialization | ||
defaultBorder | ||
^ BlBorder paint: Color brown lighter width: 1 |
3 changes: 3 additions & 0 deletions
3
src/Bloc-Examples.package/BlChickenBody.class/instance/defaultGeometry.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,3 @@ | ||
initialization | ||
defaultGeometry | ||
^ BlEllipse new |
8 changes: 4 additions & 4 deletions
8
...ge/BlSelectionEvent.class/properties.json → ...ckage/BlChickenBody.class/properties.json
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,14 +1,14 @@ | ||
{ | ||
"category" : "Bloc-Sparta-Text", | ||
"category" : "Bloc-Examples-Chicken", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"area" ], | ||
"name" : "BlSelectionEvent", | ||
], | ||
"name" : "BlChickenBody", | ||
"pools" : [ | ||
], | ||
"super" : "BlMouseEvent", | ||
"super" : "BlElement", | ||
"type" : "normal" } |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
src/Bloc-Examples.package/BlChickenHead.class/instance/defaultBackground.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,3 @@ | ||
initialization | ||
defaultBackground | ||
^ Color yellow |
3 changes: 3 additions & 0 deletions
3
src/Bloc-Examples.package/BlChickenHead.class/instance/defaultBorder.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,3 @@ | ||
initialization | ||
defaultBorder | ||
^ BlBorder paint: Color brown width: 1 |
3 changes: 3 additions & 0 deletions
3
src/Bloc-Examples.package/BlChickenHead.class/instance/defaultGeometry.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,3 @@ | ||
initialization | ||
defaultGeometry | ||
^ BlEllipse new |
62 changes: 62 additions & 0 deletions
62
src/Bloc-Examples.package/BlChickenHead.class/instance/drawPathOnSpartaCanvas..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,62 @@ | ||
drawing | ||
drawPathOnSpartaCanvas: aCanvas | ||
| anEye | | ||
super drawPathOnSpartaCanvas: aCanvas. | ||
|
||
anEye := aCanvas shape circleAt: 0@0 radius: self extent min / 8.0. | ||
|
||
aCanvas transform | ||
push; | ||
translateBy: (self width / 4.0) @ (self height / 3.0); | ||
apply. | ||
|
||
aCanvas fill | ||
paint: Color white; | ||
path: anEye; | ||
draw; | ||
paint: Color black; | ||
path: (aCanvas shape circleAt: (self extent min / 32.0) @ 0 radius: self extent min / 16.0); | ||
draw. | ||
|
||
aCanvas stroke | ||
paint: Color brown; | ||
path: anEye; | ||
width: 1; | ||
draw. | ||
|
||
aCanvas transform | ||
translateBy: (self width / 2.0) @ 0; | ||
apply. | ||
|
||
aCanvas fill | ||
paint: Color white; | ||
path: anEye; | ||
draw; | ||
paint: Color black; | ||
path: (aCanvas shape circleAt: (self extent min / 32.0) negated @ 0 radius: self extent min / 16.0); | ||
draw. | ||
|
||
aCanvas stroke | ||
paint: Color brown; | ||
path: anEye; | ||
width: 1; | ||
draw. | ||
|
||
aCanvas transform | ||
translateBy: (self width / 4.0) negated @ (self height / 4.0); | ||
apply. | ||
|
||
aCanvas fill | ||
path: (aCanvas path | ||
relative; | ||
moveTo: self width / -16.0 @ 0; | ||
lineTo: self width / 16.0 @ (self height / 2.0); | ||
lineTo: self width / 16.0 @ (self height / -2.0); | ||
lineTo: self width / 16.0 negated @ 0; | ||
close; | ||
finish); | ||
paint: Color red; | ||
draw. | ||
|
||
aCanvas transform pop. | ||
|
9 changes: 4 additions & 5 deletions
9
.../BlSelectionHandler.class/properties.json → ...ckage/BlChickenHead.class/properties.json
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,15 +1,14 @@ | ||
{ | ||
"category" : "Bloc-Sparta-Text", | ||
"category" : "Bloc-Examples-Chicken", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"origin", | ||
"corner" ], | ||
"name" : "BlSelectionHandler", | ||
], | ||
"name" : "BlChickenHead", | ||
"pools" : [ | ||
], | ||
"super" : "BlElementEventListener", | ||
"super" : "BlElement", | ||
"type" : "normal" } |
Empty file.
14 changes: 14 additions & 0 deletions
14
src/Bloc-Examples.package/BlChickenLayout.class/properties.json
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 @@ | ||
{ | ||
"category" : "Bloc-Examples-Chicken", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "BlChickenLayout", | ||
"pools" : [ | ||
], | ||
"super" : "BlFrameLayout", | ||
"type" : "normal" } |
Empty file.
19 changes: 19 additions & 0 deletions
19
src/Bloc-Examples.package/BlChickenLeg.class/instance/drawPathOnSpartaCanvas..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,19 @@ | ||
drawing | ||
drawPathOnSpartaCanvas: aCanvas | ||
| aLegPath | | ||
super drawPathOnSpartaCanvas: aCanvas. | ||
|
||
aLegPath := aCanvas path | ||
relative; | ||
moveTo: (self width / 2) asFloat @ 0; | ||
lineTo: 0 @ (self height * 2 / 3) asFloat; | ||
lineTo: self width / 2 * 1.25 negated asFloat @ (self height / 3) asFloat; | ||
moveTo: (self width / 2 * 1.25 negated asFloat @ (self height / 3) asFloat) negated; | ||
lineTo: (self width / 2 * 1.25) asFloat @ (self height / 3) asFloat ; | ||
finish. | ||
|
||
aCanvas stroke | ||
path: aLegPath; | ||
paint: Color red; | ||
width: 2; | ||
draw. |
14 changes: 14 additions & 0 deletions
14
src/Bloc-Examples.package/BlChickenLeg.class/properties.json
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 @@ | ||
{ | ||
"category" : "Bloc-Examples-Chicken", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "BlChickenLeg", | ||
"pools" : [ | ||
], | ||
"super" : "BlElement", | ||
"type" : "normal" } |
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,6 +1,7 @@ | ||
SystemOrganization addCategory: #'Bloc-Examples'! | ||
SystemOrganization addCategory: 'Bloc-Examples-Animation'! | ||
SystemOrganization addCategory: 'Bloc-Examples-Basic'! | ||
SystemOrganization addCategory: 'Bloc-Examples-Chicken'! | ||
SystemOrganization addCategory: 'Bloc-Examples-Events'! | ||
SystemOrganization addCategory: 'Bloc-Examples-Layout'! | ||
SystemOrganization addCategory: 'Bloc-Examples-MobilePhone'! |
51 changes: 0 additions & 51 deletions
51
src/Bloc-Sparta.package/BlElementSelectionExample.class/class/createContainer.st
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/Bloc-Sparta.package/BlElementSelectionExample.class/class/exampleText.st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/Bloc-Sparta.package/BlSelectionEvent.class/instance/area..st
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/Bloc-Sparta.package/BlSelectionEvent.class/instance/area.st
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/Bloc-Sparta.package/BlSelectionHandler.class/instance/dragEndEvent..st
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/Bloc-Sparta.package/BlSelectionHandler.class/instance/dragOverEvent..st
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/Bloc-Sparta.package/BlSelectionHandler.class/instance/dragStartEvent..st
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/Bloc-Sparta.package/BlSelectionHandler.class/instance/hasOrigin.st
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.