Subbu,
Thanks this is a lot of fun and useful. So I tried to use it for fractions
(although I really like your art work project at Ofset
<http://community.ofset.org/index.php/Grab_area_button>better, but I am
thinking about fractions lately)
I used the "do menu item | stencil a sketch" scripting tile in a "Mouse
Down" script. The rectangle then moves forward by its width. So with a
series of successive clicks you can make a fraction.
It get's my vote for inclusion in the next release.
Thanks,
Stephen
On Fri, Jul 22, 2011 at 10:02 PM, K. K. Subramaniam <kksubbu.ml(a)gmail.com>wrote:
> Hi Steve,
>
> I have attached a patch to Morphic that adds three functions to 'extras...'
> menu for any Morph. These enable anyone to quick convert an assembly of
> morphs
> into a sketch (e.g. a car assembled using rectangles and ellipses), use any
> morph as a stencil to cut out a sketch from underlying screen area and to
> create silhouette (shadow) sketch respectively.
>
> To use the patch, just drop it into Etoys and select "file it in". I would
> appreciate it if you could use it and let me know if it is useful. If so, I
> will send it to Etoys Inbox.
>
> Subbu
>
Karl Ramberg uploaded a new version of ReleaseBuilder to project Etoys:
http://source.squeak.org/etoys/ReleaseBuilder-kfr.12.mcz
==================== Summary ====================
Name: ReleaseBuilder-kfr.12
Author: kfr
Time: 31 July 2011, 8:34:33 pm
UUID: 73adee3e-0c81-6c4a-8816-3aca61c35978
Ancestors: ReleaseBuilder-bf.9
Fixing ancestry
=============== Diff against ReleaseBuilder-bf.9 ===============
Item was changed:
ReleaseBuilder subclass: #ReleaseBuilderSqueakland
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'ReleaseBuilder'!
+ !ReleaseBuilderSqueakland commentStamp: '<historical>' prior: 0!
- !ReleaseBuilderSqueakland commentStamp: 'bf 10/13/2010 01:16' prior: 0!
Note: as of this writing, the only reliable way to get rid of all but the current project is to execute the following, one line at a time...
+ Smalltalk zapAllOtherProjects. "close inspector if it popped up"
- Smalltalk zapAllOtherProjects.
ProjectHistory currentHistory initialize.
Smalltalk garbageCollect.
Project rebuildAllProjects.
ReleaseBuilderSqueakland new prepareReleaseImage.!
Karl Ramberg uploaded a new version of ReleaseBuilder to project Etoys:
http://source.squeak.org/etoys/ReleaseBuilder-kfr.10.mcz
==================== Summary ====================
Name: ReleaseBuilder-kfr.10
Author: kfr
Time: 31 July 2011, 3:44:03 pm
UUID: ac4444aa-8366-d44d-a648-9daed2803b8b
Ancestors: ReleaseBuilder-kfr.10
Testing
=============== Diff against ReleaseBuilder-kfr.10 ===============
In the last two pages
"Fractionator<http://www.squeakland.org/showcase/project.jsp?id=11093>"
I used a magnifier and some next/prev line buttons to "document/explain" how
the line drawing script worked.
I would like to be able to walk through the scripting tiles to "highlight
them." For example if I had a reference, I could increase the border size
and change its color.
I use the speech bubble to have the tiles "say/think" what they are doing.
For now it is simply text, but it can be anything Etoys can do, including a
mini Quickguide in a bubble).
I would also like to be able to control the "firing" each scripting tile.
So If I could reference each tile in a "Script Editor" the way I can
reference items in a Collection, I would think a script could be written
that executes the first tile, then when a particular key is hit (say <n>)
the next tile is executed, we could also either associate speech bubble
contents with each tile, or just use something similar to the holder method
I used to get started and play with the idea (Tests and Repeats may offer a
small challenge).
Thanks,
Stephen
Karl Ramberg uploaded a new version of ReleaseBuilder to project Etoys:
http://source.squeak.org/etoys/ReleaseBuilder-kfr.11.mcz
==================== Summary ====================
Name: ReleaseBuilder-kfr.11
Author: kfr
Time: 27 July 2011, 11:19:27 pm
UUID: ed20b290-f7bb-5e49-ad67-03d9b7f48031
Ancestors: ReleaseBuilder-bf.9
Package was dirty. Testing again
=============== Diff against ReleaseBuilder-bf.9 ===============
Item was changed:
ReleaseBuilder subclass: #ReleaseBuilderSqueakland
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'ReleaseBuilder'!
+ !ReleaseBuilderSqueakland commentStamp: '<historical>' prior: 0!
- !ReleaseBuilderSqueakland commentStamp: 'bf 10/13/2010 01:16' prior: 0!
Note: as of this writing, the only reliable way to get rid of all but the current project is to execute the following, one line at a time...
+ Smalltalk zapAllOtherProjects. "close inspector if it popped up"
- Smalltalk zapAllOtherProjects.
ProjectHistory currentHistory initialize.
Smalltalk garbageCollect.
+ Project rebuildAllProjects.
- Project rebuildAllProjects.
ReleaseBuilderSqueakland new prepareReleaseImage.!
Karl Ramberg uploaded a new version of Etoys to project Etoys:
http://source.squeak.org/etoys/Etoys-kfr.86.mcz
==================== Summary ====================
Name: Etoys-kfr.86
Author: kfr
Time: 26 July 2011, 7:55:34 pm
UUID: 1e086f71-3caf-c34a-927a-9e7340ed53f4
Ancestors: Etoys-kfr.85
http://tracker.squeakland.org/browse/SQ-955
=============== Diff against Etoys-kfr.84 ===============
Item was changed:
----- Method: CategoryViewer>>phraseForTest (in category 'entries') -----
phraseForTest
"Answer a phrase for the non-slot-like command represented by aMethodInterface - classic tiles"
| aPhrase aRow |
aPhrase _ PhraseTileForTest new.
aRow _ ViewerLine newRow.
aRow addMorphBack: ScriptingSystem buttonSpacer.
aRow addMorphBack: self spacerAfterButton.
aRow addMorphBack: aPhrase.
+ aRow setBalloonText: 'Press here to tear off a TEST/YES/NO unit which you can drop into your script' translated.
- aRow setBalloonText: 'Press here to tear off a TEST/YES/NO unit which you can drop into your script' translated.
^ aRow.
!
Item was changed:
----- Method: Morph class>>helpContributions (in category '*eToys-scripting') -----
helpContributions
"Answer a list of pairs of the form (<symbol> <help message> ) to contribute to the system help dictionary"
"NB: Many of the items here are not needed any more since they're specified as part of command definitions now. Someone needs to take the time to go through the list and remove items no longer needed. But who's got that kind of time?"
^ #(
(acceptScript:for:
'submit the contents of the given script editor as the code defining the given selector')
(actorState
'return the ActorState object for the receiver, creating it if necessary')
(addInstanceVariable
'start the interaction for adding a new variable to the object')
(addPlayerMenuItemsTo:hand:
'add player-specific menu items to the given menu, on behalf of the given hand. At present, these are only commands relating to the turtle')
(addYesNoToHand
+ 'Press here to tear off a TEST/YES/NO unit which you can drop into your script')
- 'Press here to tear off a TEST/YES/NO unit which you can drop into your script')
(allScriptEditors
'answer a list off the extant ScriptEditors for the receiver')
(amount
'The amount of displacement')
(angle
'The angular displacement')
(anonymousScriptEditorFor:
'answer a new ScriptEditor object to serve as the place for scripting an anonymous (unnamed, unsaved) script for the receiver')
(append:
'add an object to this container')
(prepend:
'add an object to this container')
(assignDecrGetter:setter:amt:
'evaluate the decrement variant of assignment')
(assignGetter:setter:amt:
'evaluate the vanilla variant of assignment')
(assignIncrGetter:setter:amt:
'evalute the increment version of assignment')
(assignMultGetter:setter:amt:
'evaluate the multiplicative version of assignment')
(assureEventHandlerRepresentsStatus
'make certain that the event handler associated with my current costume is set up to conform to my current script-status')
(assureExternalName
'If I do not currently have an external name assigned, get one now')
(assureUniClass
'make certain that I am a member a uniclass (i.e. a unique subclass); if I am not, create one now and become me into an instance of it')
(availableCostumeNames
'answer a list of strings representing the names of all costumes currently available for me')
(availableCostumesForArrows
'answer a list of actual, instantiated costumes for me, which can be cycled through as the user hits a next-costume or previous-costume button in a viewer')
(beep:
'make the specified sound')
(borderColor
'The color of the object''s border')
(borderWidth
'The width of the object''s border')
(bottom
'My bottom edge, measured downward from the top edge of the world')
(bounce:
'If object strayed beyond the boundaries of its container, make it reflect back into it, making the specified noise while doing so.')
(bounce
'If object strayed beyond the boundaries of its container, make it reflect back into it')
(chooseTrigger
'When this script should run.
"normal" means "only when called"')
(clearTurtleTrails
'Clear all the pen trails in the interior.')
(clearOwnersPenTrails
'Clear all the pen trails in my container.')
(color
'The object''s interior color')
(colorSees
'Whether a given color in the object is over another given color')
(colorUnder
'The color under the center of the object')
(copy
'Return a new object that is very much like this one')
(cursor
'The index of the chosen element')
(deleteCard
'Delete the current card.')
(dismiss
'Click here to dismiss me')
(doMenuItem:
'Do a menu item, the same way as if it were chosen manually')
(doScript:
'Perform the given script once, on the next tick.')
(elementNumber
'My element number as seen by my owner')
(fire
'Run any and all button-firing scripts of this object')
(firstPage
'Go to first page of book')
(followPath
'Retrace the path the object has memorized, if any.')
(forward:
'Moves the object forward in the direction it is heading')
(goto:
'Go to the specfied book page')
(goToNextCardInStack
'Go to the next card')
(goToPreviousCardInStack
'Go to the previous card.')
(goToRightOf:
'Align the object just to the right of any specified object.')
(heading
'Which direction the object is facing. 0 is straight up')
(height
'The distance between the top and bottom edges of the object')
(hide
'Make the object so that it does not display and cannot handle input')
(initiatePainting
'Initiate painting of a new object in the standard playfield.')
(initiatePaintingIn:
'Initiate painting of a new object in the given place.')
(isOverColor
'Whether any part of this object is directly over the specified color')
(isUnderMouse
'Whether any part of this object is beneath the current mouse-cursor position')
(lastPage
'Go to the last page of the book.')
(left
'My left edge, measured from the left edge of the World')
(leftRight
'The horizontal displacement')
(liftAllPens
'Lift the pens on all the objects in my interior.')
(lowerAllPens
'Lower the pens on all the objects in my interior.')
(mouseX
'The x coordinate of the mouse pointer')
(mouseY
'The y coordinate of the mouse pointer')
(moveToward:
'Move in the direction of another object.')
(insertCard
'Create a new card.')
(nextPage
'Go to next page.')
(numberAtCursor
'The number held by the object at the chosen element')
(objectNameInHalo
'Object''s name -- To change: click here, edit, hit ENTER')
(obtrudes
'Whether any part of the object sticks out beyond its container''s borders')
(offerScriptorMenu
'The Scriptee.
Press here to get a menu')
(pauseScript:
'Make a running script become paused.')
(penDown
'Whether the object''s pen is down (true) or up (false)')
(penColor
'The color of the object''s pen')
(penSize
'The size of the object''s pen')
(clearPenTrails
'Clear all pen trails in the current playfield')
(playerSeeingColorPhrase
'The player who "sees" a given color')
(previousPage
'Go to previous page')
(show
'If object was hidden, make it show itself again.')
(startScript:
'Make a script start running.')
(stopScript:
'Make a script stop running.')
(top
'My top edge, measured downward from the top edge of the world')
(right
'My right edge, measured from the left edge of the world')
(roundUpStrays
'Bring all out-of-container subparts back into view.')
(scaleFactor
'The amount by which the object is scaled')
(stopScript:
'make the specified script stop running')
(tellAllSiblings:
'send a message to all of my sibling instances')
(try
'Run this command once.' translatedNoop)
(tryMe
'Click here to run this script once; hold button down to run repeatedly' translatedNoop)
(turn:
'Change the heading of the object by the specified amount')
(unhideHiddenObjects
'Unhide all hidden objects.')
(upDown
'The vertical displacement')
(userScript
'This is a script defined by you.')
(userSlot
'This is a variable defined by you. Click here to change its type')
(valueAtCursor
'The chosen element')
(wearCostumeOf:
'Make this object''s appearance be the same as that of another object')
(width
'The distance between the left and right edges of the object')
(wrap
'If object has strayed beond the boundaries of its container, make it reappear from the opposite edge.')
(x
'The x coordinate, measured from the left of the container')
(y
'The y-coordinate, measured upward from the bottom of the container')
)
!
Karl Ramberg uploaded a new version of Morphic to project Etoys:
http://source.squeak.org/etoys/Morphic-kfr.66.mcz
==================== Summary ====================
Name: Morphic-kfr.66
Author: kfr
Time: 26 July 2011, 7:28:11 pm
UUID: 53deb299-91d2-9846-893d-ef07b87fb326
Ancestors: Morphic-kfr.65
http://tracker.squeakland.org/browse/SQ-968
=============== Diff against Morphic-kfr.65 ===============
Item was changed:
----- Method: PolygonMorph>>specifyDashedLine (in category 'menu') -----
specifyDashedLine
| executableSpec newSpec |
executableSpec _ FillInTheBlank
request:
'Enter a dash specification as
{ major dash length. minor dash length. minor dash color }
The major dash will have the normal border color.
A blank response will remove the dash specification.
[Note: You may give 5 items as, eg, {10. 5. Color white. 0. 3}
+ where the 4th item is zero, and the 5th is the number of pixels
- where the 4th ityem is zero, and the 5th is the number of pixels
by which the dashes will move in each step of animation]' translated
initialAnswer: '{ 10. 5. Color red }'.
executableSpec isEmpty ifTrue:
[^ self stopStepping; dashedBorder: nil].
newSpec _ [Compiler evaluate: executableSpec] ifError:
[^ self stopStepping; dashedBorder: nil].
newSpec first isNumber & newSpec second isNumber & newSpec third isColor ifFalse:
[^ self stopStepping; dashedBorder: nil].
newSpec size = 3 ifTrue:
[^ self stopStepping; dashedBorder: newSpec].
(newSpec size = 5 and: [newSpec fourth isNumber & newSpec fifth isNumber]) ifTrue:
[^ self dashedBorder: newSpec; startStepping].
!