[squeak-dev] The Inbox: MorphicExtras-kfr.148.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jun 28 11:48:29 UTC 2014


A new version of MorphicExtras was added to project The Inbox:
http://source.squeak.org/inbox/MorphicExtras-kfr.148.mcz

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

Name: MorphicExtras-kfr.148
Author: kfr
Time: 28 June 2014, 1:44:10.323 pm
UUID: 5281164b-1be4-434c-99ac-d48214dcd109
Ancestors: MorphicExtras-tpr.147

Add convenience method for graphics in Standard Graphics Library: encode graphics to a Workspace so graphics can be added in methods.

=============== Diff against MorphicExtras-tpr.147 ===============

Item was added:
+ ----- Method: GraphicalDictionaryMenu>>encodeToWorkspace (in category 'menu commands') -----
+ encodeToWorkspace
+ | stream encodedStream pict text |
+ pict := formChoices at: currentIndex.
+ stream := RWBinaryOrTextStream on: (String new).
+ PNGReadWriter putForm: pict onStream: stream.
+ encodedStream := stream contents asByteArray base64Encoded.
+ text := (Workspace open) model.
+ text contents: 'Form fromBinaryStream: (Base64MimeConverter mimeDecodeToBytes: ''', encodedStream,''' readStream)'!

Item was changed:
  ----- Method: GraphicalDictionaryMenu>>showMenu (in category 'menu commands') -----
  showMenu
  	"Show the receiver's menu"
  
  	| aMenu |
  	aMenu := MenuMorph new defaultTarget: self.
  	aMenu title: 'Graphics Library'.
  	aMenu addStayUpItem.
  	aMenu addList: #(
  		('remove'			removeEntry			'Remove this entry from the dictionary')
  		('rename'			renameEntry			'Rename this entry')
  		('repaint'			repaintEntry			'Edit the actual graphic for this entry' )
  		-
  		('hand me one'		handMeOne				'Hand me a morph with this picture as its form')
+ 		('encode to Workspace'	encodeToWorkspace		'Open a Workspace with the grapics encoded to be added to code')
  		('browse symbol references'
  							browseIconReferences	'Browse methods that refer to this icon''s name')
  		('browse string references'
  							browseStringIconReferences 'Browse methods that refer to string constants that contain this icon''s name')
  		('copy name'		copyName				'Copy the name of this graphic to the clipboard')
  		-
  		('find...'			findEntry				'Find an entry by name')
  		('find again'		findAgain				'Find the next match for the keyword previously searched for')).
  	aMenu popUpInWorld
  !



More information about the Squeak-dev mailing list