From 1f87a6045aa5e723b0caaeb19f73e61e72ebe630 Mon Sep 17 00:00:00 2001 From: Aliaksei Syrel Date: Fri, 10 Nov 2017 18:13:31 +0100 Subject: [PATCH] [examples] added TBlExample Trait --- .../BlBasicExamples.class/properties.json | 12 +++++++----- .../class/rotated.st | 8 ++++++++ .../class/scaled.st | 8 ++++++++ .../properties.json | 12 +++++++----- .../TBlExample.trait/README.md | 1 + .../class/openInWindow.named.extent..st | 18 ++++++++++++++++++ .../TBlExample.trait/properties.json | 5 +++++ 7 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 src/Bloc-Examples.package/BlTransformationExamples.class/class/rotated.st create mode 100644 src/Bloc-Examples.package/BlTransformationExamples.class/class/scaled.st create mode 100644 src/Bloc-Examples.package/TBlExample.trait/README.md create mode 100644 src/Bloc-Examples.package/TBlExample.trait/class/openInWindow.named.extent..st create mode 100644 src/Bloc-Examples.package/TBlExample.trait/properties.json diff --git a/src/Bloc-Examples.package/BlBasicExamples.class/properties.json b/src/Bloc-Examples.package/BlBasicExamples.class/properties.json index e9fd7e01b..1de2c3ca7 100644 --- a/src/Bloc-Examples.package/BlBasicExamples.class/properties.json +++ b/src/Bloc-Examples.package/BlBasicExamples.class/properties.json @@ -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" } \ No newline at end of file diff --git a/src/Bloc-Examples.package/BlTransformationExamples.class/class/rotated.st b/src/Bloc-Examples.package/BlTransformationExamples.class/class/rotated.st new file mode 100644 index 000000000..fe43a79fb --- /dev/null +++ b/src/Bloc-Examples.package/BlTransformationExamples.class/class/rotated.st @@ -0,0 +1,8 @@ +examples +rotated + + + self + openInWindow: self new rotate + named: 'Rotated by 45 degrees' + extent: 300@300 \ No newline at end of file diff --git a/src/Bloc-Examples.package/BlTransformationExamples.class/class/scaled.st b/src/Bloc-Examples.package/BlTransformationExamples.class/class/scaled.st new file mode 100644 index 000000000..53fe4069c --- /dev/null +++ b/src/Bloc-Examples.package/BlTransformationExamples.class/class/scaled.st @@ -0,0 +1,8 @@ +examples +scaled + + + self + openInWindow: self new scale + named: 'Scaled by 2' + extent: 300@300 \ No newline at end of file diff --git a/src/Bloc-Examples.package/BlTransformationExamples.class/properties.json b/src/Bloc-Examples.package/BlTransformationExamples.class/properties.json index b726c79ff..661240a05 100644 --- a/src/Bloc-Examples.package/BlTransformationExamples.class/properties.json +++ b/src/Bloc-Examples.package/BlTransformationExamples.class/properties.json @@ -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" } \ No newline at end of file diff --git a/src/Bloc-Examples.package/TBlExample.trait/README.md b/src/Bloc-Examples.package/TBlExample.trait/README.md new file mode 100644 index 000000000..b57354cfa --- /dev/null +++ b/src/Bloc-Examples.package/TBlExample.trait/README.md @@ -0,0 +1 @@ +I contain useful helper methods that simplify creation of examples \ No newline at end of file diff --git a/src/Bloc-Examples.package/TBlExample.trait/class/openInWindow.named.extent..st b/src/Bloc-Examples.package/TBlExample.trait/class/openInWindow.named.extent..st new file mode 100644 index 000000000..71e6861d0 --- /dev/null +++ b/src/Bloc-Examples.package/TBlExample.trait/class/openInWindow.named.extent..st @@ -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 \ No newline at end of file diff --git a/src/Bloc-Examples.package/TBlExample.trait/properties.json b/src/Bloc-Examples.package/TBlExample.trait/properties.json new file mode 100644 index 000000000..0f8420059 --- /dev/null +++ b/src/Bloc-Examples.package/TBlExample.trait/properties.json @@ -0,0 +1,5 @@ +{ + "name" : "TBlExample", + "commentStamp" : "AliakseiSyrel 11/10/2017 17:49", + "category" : "Bloc-Examples" +} \ No newline at end of file