[etoys-dev] Etoys: Connectors-kfr.197.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Mar 11 14:57:35 EDT 2012


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

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

Name: Connectors-kfr.197
Author: kfr
Time: 11 March 2012, 7:57:13 pm
UUID: 793bad8d-7794-4c68-8628-7eeda85d837e
Ancestors: Connectors-kfr.196

Fixing up issues connector labels

=============== Diff against Connectors-kfr.196 ===============

Item was changed:
  ----- Method: NCAAConnectorMorph>>addCustomMenuItems:hand: (in category 'menus') -----
  addCustomMenuItems: aMenu hand: aHandMorph
  	"Use my line's menu additions"
  	super addCustomMenuItems: aMenu hand: aHandMorph.
  	aMenu addLine.
  
  
  	line addFillStyleMenuItems: aMenu hand: aHandMorph.
  	aMenu addLine.
  
  	aMenu
  		addUpdating: #handlesShowingPhrase target: self action: #showOrHideHandles;
  		addUpdating: #orthogonalityPhrase target: self action: #toggleOrthogonality.
  
  	self vertices size > 2 ifTrue: [ 
  		line isCurve
  			ifTrue: [aMenu add: 'make segmented line' translated action: #toggleSmoothing]
  			ifFalse: [aMenu add: 'make smooth line' translated action: #toggleSmoothing].
  		aMenu add: 'straighten' translated target: self selector: #straighten.
  	]. 
  	
  	self addBasicArrowMenuItemsTo: aMenu event: nil.
  
  	aMenu 
  		addLine;
+ 		add: 'add label' translated action: #addLabel.
- 		add: 'add label' translated action: #addLabel:.
  !

Item was added:
+ ----- Method: NCAAConnectorMorph>>addLabel (in category 'labeling') -----
+ addLabel
+ 	| label |
+ 	label := self labelClass new string: 'new label' translated wrap: false minWidth: 20.
+ 	label
+ 		align: label center with: self midpoint;
+ 		attachUnobnoxiouslyTo: self at: self midpoint;
+ 		dieWithInput: true;
+ 		acceptOnCR: true;
+ 		acceptOnFocusLoss: true;
+ 		selectAll.
+ 	self pasteUpMorphOrWorld addMorph: label.
+ 	
+ 	^label!

Item was changed:
  ----- Method: NCAAConnectorMorph>>addLabel: (in category 'labeling') -----
  addLabel: anEvent
  	| label |
+ 	label _ self labelClass new string: 'new label' wrap: false minWidth: 20.
- 	label _ self labelClass new string: '  ' wrap: false minWidth: 20.
  	label
+ 		align: label center with: anEvent position;
+ 		attachUnobnoxiouslyTo: self at: anEvent position;
- 		align: label center with: self midpoint;
- 		attachUnobnoxiouslyTo: self at: self midpoint;
  		dieWithInput: true;
  		acceptOnCR: true;
  		acceptOnFocusLoss: true;
  		selectAll.
  	self pasteUpMorphOrWorld addMorph: label.
  	anEvent hand newKeyboardFocus: label label.
  	^label!



More information about the etoys-dev mailing list