'From Squeak3.1alpha of 7 February 2001 [latest update: #3654] on 19 February 2001 at 11:03:20 am'! "Change Set: emphasis-sw Date: 19 February 2001 Author: Scott Wallace Provides a critical missing method and removes a workaround that had to be made because of its absence."! !Preferences class methodsFor: 'pref buttons' stamp: 'sw 2/19/2001 11:01'! buttonRepresenting: prefSymbol wording: aString color: aColor inPanel: aPreferencesPanel "Return a button that controls the setting of prefSymbol. It will keep up to date even if the preference value is changed in a different place" | outerButton aButton str aHelp miniWrapper | ((FlagDictionary includesKey: prefSymbol) or: [self flagsHeldByProjects includesKey: prefSymbol]) ifFalse: [self error: 'Unknown preference: ', prefSymbol printString]. outerButton _ AlignmentMorph newRow height: 24. outerButton color: (aColor ifNil: [Color r: 0.645 g: 1.0 b: 1.0]). outerButton hResizing: (aPreferencesPanel ifNil: [#shrinkWrap] ifNotNil: [#spaceFill]). outerButton vResizing: #shrinkWrap. outerButton addMorph: (aButton _ UpdatingThreePhaseButtonMorph checkBox). aButton target: self; actionSelector: #togglePreference:; arguments: (Array with: prefSymbol); target: Preferences; getSelector: prefSymbol. outerButton addTransparentSpacerOfSize: (2 @ 0). str _ StringMorph contents: aString font: (StrikeFont familyName: 'NewYork' size: 12). (self isProjectPreference: prefSymbol) ifTrue: [str emphasis: 1]. miniWrapper _ AlignmentMorph newRow hResizing: #shrinkWrap; vResizing: #shrinkWrap. miniWrapper beTransparent addMorphBack: str lock. aPreferencesPanel ifNotNil: [miniWrapper on: #mouseDown send: #prefMenu:rcvr:pref: to: aPreferencesPanel withValue: prefSymbol]. outerButton addMorphBack: miniWrapper. aButton setBalloonText: (aHelp _ Preferences helpMessageForPreference: prefSymbol). miniWrapper setBalloonText: aHelp; setProperty: #balloonTarget toValue: aButton. ^ outerButton "self currentHand attachMorph: (Preferences buttonRepresenting: #balloonHelpEnabled wording: 'Balloon Help' color: Color red muchLighter inPanel: nil) " ! ! !StringMorph methodsFor: 'font' stamp: 'sw 2/19/2001 11:03'! emphasis: aNumber "Set the receiver's emphasis as indicated" "0 -> plain. 1 -> bold. 2 -> italic. 3 -> bold italic. 4 -> underlined 5 -> bold underlined. 6 -> italic underlined. 7 -> bold italic underlined 8 -> narrow. 9 -> bold narrow.10 -> italic narrow. 11 -> bold italic narrow. 12 -> underlined narrow. 13 -> bold underlined narrow. 14 -> italic underlined narrow. 15 -> bold underlined italic narrow. 16 -> struckOut. 17 -> bold struckOut. 18 -> italic struckOut etc...." self font: (TextStyle defaultFont emphasized: aNumber) " 1 bold 2 italic 4 underlined 8 narrow 16 struckOut"! !