[ENH] Halo menu picks for manipulating TextMorph attributes

Robert M. Fuhrer rfuhrer at watson.ibm.com
Thu Sep 23 21:28:42 UTC 1999


Hi All,

This trivial file-in adds a few menu picks to TextMorph's halo menu to
manipulate text attributes, namely, the style, font, alignment, and
emphasis.  This way, you can drag a TextMorph from the "Supplies" flap,
and then manipulate its attributes.  I use these little guys as Squeak's
version of post-it notes...

Caveat: on my system (Win32 VM 2.5, with updates through 1447),
changing certain attributes seems to have no effect.  E.g., when
"ComicBold" is selected as the style, changing the font/size to
ComicBold24 has no visible effect.  At the moment, I don't know why.
Anyone?

============================================================

'From Squeak 2.5 of August 6, 1999 on 23 September 1999 at 5:23:04 pm'!

!TextMorph methodsFor: 'menu' stamp: 'RMF 9/23/1999 17:22'!
addCustomMenuItems: aCustomMenu hand: aHandMorph 
	| outer |
	super addCustomMenuItems: aCustomMenu hand: aHandMorph.
	aCustomMenu add: 'add predecessor' action: #addPredecessor:.
	aCustomMenu add: 'add successor' action: #addSuccessor:.
	aCustomMenu add: 'choose style...' action: #chooseStyle.
	aCustomMenu add: 'choose font...' action: #chooseFont.
	aCustomMenu add: 'choose alignment...' action: #chooseAlignment.
	aCustomMenu add: 'choose emphasis...' action: #chooseEmphasis.
	outer _ self meOrMyDropShadow owner.
	((outer isKindOf: PolygonMorph)
		and: [outer isOpen])
		ifTrue: [container == nil
				ifTrue: [aCustomMenu add: 'follow owner''s curve' action: #followCurve]
				ifFalse: 
					[aCustomMenu add: 'reverse direction' action: #reverseCurveDirection.
					aCustomMenu add: 'set baseline' action: #setCurveBaseline:]]
		ifFalse: 
			[(container == nil or: [container fillsOwner not])
				ifTrue: [aCustomMenu add: 'fill owner''s shape' action: #fillingOnOff]
				ifFalse: [aCustomMenu add: 'rectangluar bounds' action: #fillingOnOff].
			(container == nil or: [container avoidsOcclusions not])
				ifTrue: [aCustomMenu add: 'avoid occlusions' action: #occlusionsOnOff]
				ifFalse: [aCustomMenu add: 'ignore occlusions' action:
#occlusionsOnOff]]! !


--------------------------------
Robert M. Fuhrer                                       34-231  (914) 945-3830
IBM T. J. Watson Research Center                       rfuhrer at watson.ibm.com
Yorktown Heights, NY 10598                PGP Public Key available on request





More information about the Squeak-dev mailing list