Skip to content

Commit

Permalink
[examples] added TBlExample Trait
Browse files Browse the repository at this point in the history
  • Loading branch information
syrel committed Nov 10, 2017
1 parent 78f1ab2 commit 1f87a60
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/Bloc-Examples.package/BlBasicExamples.class/properties.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"classtraitcomposition" : "TBlExample classTrait",
"classvars" : [ ],
"instvars" : [ ],
"name" : "BlBasicExamples",
"commentStamp" : "AliakseiSyrel 1/24/2017 15:10",
"super" : "Object",
"category" : "Bloc-Examples-Basic",
"traitcomposition" : "TBlExample",
"type" : "normal",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BlBasicExamples",
"type" : "normal"
"category" : "Bloc-Examples-Basic"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
examples
rotated
<script: 'self rotated'>

self
openInWindow: self new rotate
named: 'Rotated by 45 degrees'
extent: 300@300
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
examples
scaled
<script: 'self scaled'>

self
openInWindow: self new scale
named: 'Scaled by 2'
extent: 300@300
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"classtraitcomposition" : "TBlExample classTrait",
"classvars" : [ ],
"instvars" : [ ],
"name" : "BlTransformationExamples",
"commentStamp" : "AliakseiSyrel 11/2/2017 14:35",
"super" : "Object",
"category" : "Bloc-Examples-Basic",
"traitcomposition" : "TBlExample",
"type" : "normal",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BlTransformationExamples",
"type" : "normal"
"category" : "Bloc-Examples-Basic"
}
1 change: 1 addition & 0 deletions src/Bloc-Examples.package/TBlExample.trait/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I contain useful helper methods that simplify creation of examples
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
opening
openInWindow: anElement named: aTitleString extent: aPoint
"Open a given element in a window of a provided extent and specified title"
| aSpace |
aSpace := BlSpace new
extent: aPoint;
title: aTitleString.

aSpace root
addChild: anElement;
yourself.

aSpace root addEventHandler:
(BlEventHandler
on: BlDblClickEvent
do: [ :evt | BlElementSelection on: evt target ]).

aSpace show
5 changes: 5 additions & 0 deletions src/Bloc-Examples.package/TBlExample.trait/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name" : "TBlExample",
"commentStamp" : "AliakseiSyrel 11/10/2017 17:49",
"category" : "Bloc-Examples"
}

0 comments on commit 1f87a60

Please sign in to comment.