Etoys: Connectors-kfr.201.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Etoys: Connectors-kfr.201.mcz

commits-2
Karl Ramberg uploaded a new version of Connectors to project Etoys:
http://source.squeak.org/etoys/Connectors-kfr.201.mcz

==================== Summary ====================

Name: Connectors-kfr.201
Author: kfr
Time: 16 October 2012, 8:39:06 am
UUID: 33e7f3dc-485a-2941-b99e-4675433b82cb
Ancestors: Connectors-kfr.200

http://tracker.squeakland.org/browse/SQ-1124
SaveGIF button on Class ButtonBar and FSM ButtonBar is broken.

=============== Diff against Connectors-kfr.200 ===============

Item was added:
+ ----- Method: PasteUpMorph>>saveNCDrawingAsGIF (in category '*connectors-misc') -----
+ saveNCDrawingAsGIF
+ "Dump the current drawing on me as a GIF file.
+ Ignore windows, flaps, etc."
+ "World saveNCDrawingAsGIF"
+ | ignore border morphs printBounds canvas fileName |
+ ignore := #(#MenuMorph #ProjectNavigationMorph #FlapTab #PasteUpMorph #SystemWindow #NCButtonBar #NCMakerButton ).
+ border := 10.
+ "border width around drawing"
+ morphs := self submorphs
+ reject: [:ea | ignore includes: ea class name].
+ morphs isEmpty
+ ifTrue: [^ self].
+ printBounds := morphs first bounds.
+ morphs
+ do: [:ea | printBounds := printBounds merge: ea bounds].
+ printBounds := printBounds outsetBy: border.
+ canvas := FormCanvas extent: printBounds extent depth: 8.
+ canvas
+ setOrigin: printBounds origin negated
+ clipRect: (0 @ 0 extent: printBounds extent).
+ canvas fillColor: self color.
+ morphs
+ reverseDo: [:ea | ea fullDrawOn: canvas].
+ fileName := FileDirectory default nextNameFor: 'drawing' extension: 'gif'.
+ fileName := FillInTheBlank request: 'GIF file name?' initialAnswer: fileName.
+ fileName isEmpty
+ ifTrue: [^ self].
+ Utilities
+ informUser: 'Writing ' , fileName
+ during: [GIFReadWriter putForm: canvas form onFileNamed: fileName]!

Item was added:
+ ----- Method: PasteUpMorph>>saveNCDrawingOnFile (in category '*connectors-misc') -----
+ saveNCDrawingOnFile
+ "Dump the current drawing on me as an object
+ stream. Ignore windows, flaps, etc."
+ "World saveNCDrawingOnFile"
+ | ignore morphs fileName fileStream |
+ ignore := #(#MenuMorph #ProjectNavigationMorph #FlapTab #PasteUpMorph #SystemWindow #NCButtonBar #NCMakerButton ).
+ morphs := self submorphs
+ reject: [:ea | ignore includes: ea class name].
+ fileName := FileDirectory default nextNameFor: 'drawing' extension: 'ncdwg'.
+ fileName := FillInTheBlank request: 'Drawing file name?' initialAnswer: fileName.
+ fileName isEmpty
+ ifTrue: [^ self].
+ morphs
+ do: [:ea | ea prepareToBeSaved].
+ Utilities
+ informUser: 'Saving ' , fileName
+ during: [fileStream := FileStream newFileNamed: fileName.
+ fileStream fileOutClass: nil andObject: morphs]!

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev