<div dir="ltr">I'm getting a failed update:<div><br></div><div><div>This package depends on the following classes:</div><div> NewBalloonMorph</div><div>You must resolve these dependencies before you will be able to load these definitions: </div><div> NewBalloonMorph>>isBalloonHelp</div></div><div><br></div><div>latest update: #14275<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 31, 2015 at 2:38 AM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Marcel Taeumel uploaded a new version of Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Morphic-mt.794.mcz" target="_blank">http://source.squeak.org/trunk/Morphic-mt.794.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-mt.794<br>
Author: mt<br>
Time: 31 March 2015, 11:38:42.253 am<br>
UUID: 765a2201-af4c-0948-b90d-72414d335160<br>
Ancestors: Morphic-mt.793<br>
<br>
New-style balloon morph added and used. Can be switched back to old-style balloon morphs via preferences.<br>
<br>
New-style balloon morphs support:<br>
- text (not only strings)<br>
- layouting via text paragraph (not hard-cutted via: #noLineLongerThan:)<br>
- positioning at current hand position (if not supplied with other reference point)<br>
<br>
In general, new-style balloon morphs have an improved readability.<br>
<br>
=============== Diff against Morphic-mt.793 ===============<br>
<br>
Item was changed:<br>
----- Method: BalloonMorph class>>string:for:corner: (in category 'instance creation') -----<br>
string: str for: morph corner: cornerName<br>
"Make up and return a balloon for morph. Find the quadrant that<br>
clips the text the least, using cornerName as a tie-breaker. tk 9/12/97"<br>
| tm vertices |<br>
+ tm := self<br>
+ getTextMorph: (str asString withNoLineLongerThan: Preferences maxBalloonHelpLineLength)<br>
+ for: morph.<br>
- tm := self getTextMorph: str for: morph.<br>
vertices := self getVertices: tm bounds.<br>
vertices := self<br>
getBestLocation: vertices<br>
for: morph<br>
corner: cornerName.<br>
^ self new color: morph balloonColor;<br>
setVertices: vertices;<br>
addMorph: tm;<br>
setTarget: morph!<br>
<br>
Item was changed:<br>
----- Method: MenuMorph>>showKeyboardHelp (in category 'keystroke helpers') -----<br>
showKeyboardHelp<br>
<br>
| help |<br>
+ help := self balloonMorphClass<br>
+ string: 'Enter text to narrow selection\down to matching items ' withCRs<br>
- help := BalloonMorph<br>
- string: 'Enter text to\narrow selection down\to matching items ' withCRs<br>
for: self<br>
corner: #topLeft.<br>
+ help popUpAt: self topCenter forHand: self activeHand!<br>
- help popUpForHand: self activeHand!<br>
<br>
Item was added:<br>
+ ----- Method: Morph>>balloonMorphClass (in category 'halos and balloon help') -----<br>
+ balloonMorphClass<br>
+<br>
+ ^ NewBalloonMorph useNewBalloonMorph<br>
+ ifTrue: [NewBalloonMorph]<br>
+ ifFalse: [BalloonMorph]!<br>
<br>
Item was changed:<br>
----- Method: Morph>>showBalloon:hand: (in category 'halos and balloon help') -----<br>
showBalloon: msgString hand: aHand<br>
"Pop up a balloon containing the given string,<br>
first removing any existing BalloonMorphs in the world."<br>
<br>
| w balloon h |<br>
(w := self world) ifNil: [^ self].<br>
h := aHand.<br>
h ifNil:[<br>
h := w activeHand].<br>
+ balloon := self balloonMorphClass<br>
+ string: msgString<br>
- balloon := BalloonMorph<br>
- string: (msgString asString withNoLineLongerThan: Preferences maxBalloonHelpLineLength)<br>
for: self balloonHelpAligner.<br>
balloon popUpFor: self hand: h.!<br>
<br>
Item was added:<br>
+ Morph subclass: #NewBalloonMorph<br>
+ instanceVariableNames: 'balloonOwner textMorph maximumWidth orientation hasTail'<br>
+ classVariableNames: 'UseNewBalloonMorph'<br>
+ poolDictionaries: ''<br>
+ category: 'Morphic-Widgets'!<br>
+<br>
+ !NewBalloonMorph commentStamp: 'mt 3/31/2015 10:15' prior: 0!<br>
+ A balloon is a bubble with an optional tail. It contains rich text, which describes something about its balloon-owner.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph class>>string:for: (in category 'instance creation') -----<br>
+ string: str for: morph<br>
+<br>
+ ^ self string: str for: morph corner: #bottomLeft!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph class>>string:for:corner: (in category 'instance creation') -----<br>
+ string: message for: morph corner: symbol<br>
+<br>
+ ^ self new<br>
+ balloonOwner: morph;<br>
+ setText: message;<br>
+ orientation: symbol;<br>
+ yourself!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph class>>useNewBalloonMorph (in category 'preferences') -----<br>
+ useNewBalloonMorph<br>
+<br>
+ <preference: 'Use new-style balloon morphs'<br>
+ category: #Morphic<br>
+ description: 'The new-style balloon morphs are improved for better reading quality and support rich text.'<br>
+ type: #Boolean><br>
+ ^ UseNewBalloonMorph ifNil: [true]!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph class>>useNewBalloonMorph: (in category 'preferences') -----<br>
+ useNewBalloonMorph: aBoolean<br>
+<br>
+ UseNewBalloonMorph := aBoolean.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>balloonOwner (in category 'accessing') -----<br>
+ balloonOwner<br>
+<br>
+ ^ balloonOwner!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>balloonOwner: (in category 'accessing') -----<br>
+ balloonOwner: aMorph<br>
+<br>
+ balloonOwner := aMorph.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>bubbleBounds (in category 'geometry') -----<br>
+ bubbleBounds<br>
+<br>
+ ^ self bounds insetBy: (0 @ self tailHeight corner: 0 @ self tailHeight)!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>bubbleInset (in category 'geometry') -----<br>
+ bubbleInset<br>
+<br>
+ ^ 5@2!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>defaultBorderColor (in category 'initialization') -----<br>
+ defaultBorderColor<br>
+<br>
+ ^ self defaultColor muchDarker"Color black"!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>defaultBorderWidth (in category 'initialization') -----<br>
+ defaultBorderWidth<br>
+<br>
+ ^ 1!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>defaultColor (in category 'initialization') -----<br>
+ defaultColor<br>
+<br>
+ ^ BalloonMorph balloonColor!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>drawDropShadowOn: (in category 'drawing') -----<br>
+ drawDropShadowOn: aCanvas<br>
+<br>
+ aCanvas<br>
+ translateBy: self shadowOffset<br>
+ during: [ :shadowCanvas |<br>
+ (shadowCanvas isVisible: self bubbleBounds) ifTrue: [<br>
+ self wantsRoundedCorners<br>
+ ifTrue: [shadowCanvas fillRoundRect: self bubbleBounds radius: self class preferredCornerRadius fillStyle: self shadowColor]<br>
+ ifFalse: [shadowCanvas fillRectangle: self bubbleBounds fillStyle: self shadowColor]].<br>
+<br>
+ self hasTail ifTrue: [<br>
+ shadowCanvas<br>
+ drawPolygon: self verticesForTail<br>
+ fillStyle: self shadowColor]].<br>
+<br>
+ !<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>drawOn: (in category 'drawing') -----<br>
+ drawOn: aCanvas<br>
+<br>
+ "Bubble."<br>
+ self wantsRoundedCorners<br>
+ ifTrue: [aCanvas<br>
+ frameAndFillRoundRect: self bubbleBounds<br>
+ radius: self class preferredCornerRadius fillStyle: self fillStyle borderWidth: self borderStyle width borderColor: self borderStyle color]<br>
+ ifFalse: [aCanvas<br>
+ fillRectangle: self bubbleBounds<br>
+ fillStyle: self fillStyle borderStyle: self borderStyle].<br>
+<br>
+ "Tail."<br>
+ self hasTail ifTrue: [<br>
+ self verticesForTail in: [:points |<br>
+ | pixelOffset |<br>
+ pixelOffset := points first y < points second y<br>
+ ifFalse: [points first x < points second x<br>
+ ifTrue: [self borderStyle width negated @ self borderStyle width] "bottomLeft"<br>
+ ifFalse: [self borderStyle width @ self borderStyle width]] "bottomRight"<br>
+ ifTrue: [points first x < points second x<br>
+ ifTrue: [self borderStyle width negated @ self borderStyle width negated] "topLeft"<br>
+ ifFalse: [self borderStyle width @ self borderStyle width negated]]. "topRight"<br>
+<br>
+ aCanvas<br>
+ drawPolygon: points<br>
+ fillStyle: self fillStyle.<br>
+ aCanvas<br>
+ line: points first<br>
+ to: points second + pixelOffset<br>
+ width: self borderStyle width<br>
+ color: self borderStyle color.<br>
+ aCanvas<br>
+ line: points first<br>
+ to: points third + pixelOffset<br>
+ width: self borderStyle width<br>
+ color: self borderStyle color]]!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>hasTail (in category 'accessing') -----<br>
+ hasTail<br>
+<br>
+ ^ hasTail ifNil: [true]!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>hasTail: (in category 'accessing') -----<br>
+ hasTail: aBoolean<br>
+<br>
+ hasTail := aBoolean.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>initialize (in category 'initialization') -----<br>
+ initialize<br>
+<br>
+ super initialize.<br>
+<br>
+ self<br>
+ borderWidth: self defaultBorderWidth;<br>
+ borderColor: self defaultBorderColor;<br>
+ color: (self defaultColor alpha: 1.0); "no alpha due to drop shadow"<br>
+ hasDropShadow: true;<br>
+ shadowOffset: 1@1;<br>
+ shadowColor: (self color muchDarker muchDarker alpha: 0.333);<br>
+ orientation: #bottomLeft.<br>
+<br>
+ MenuMorph roundedMenuCorners<br>
+ ifTrue: [self cornerStyle: #rounded].<br>
+<br>
+ textMorph := TextMorph new<br>
+ wrapFlag: false;<br>
+ lock;<br>
+ yourself.<br>
+<br>
+ self addMorph: textMorph.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>maximumWidth (in category 'accessing') -----<br>
+ maximumWidth<br>
+<br>
+ ^ maximumWidth ifNil: [<br>
+ maximumWidth := (self balloonOwner balloonFont widthOf: $m) * Preferences maxBalloonHelpLineLength]!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>maximumWidth: (in category 'accessing') -----<br>
+ maximumWidth: anInteger<br>
+<br>
+ maximumWidth := anInteger.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>morphicLayerNumber (in category 'WiW support') -----<br>
+ morphicLayerNumber<br>
+<br>
+ "helpful for insuring some morphs always appear in front of or behind others.<br>
+ smaller numbers are in front"<br>
+<br>
+ ^5 "Balloons are very front-like things"!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>move: (in category 'geometry') -----<br>
+ move: targetPoint<br>
+<br>
+ self perform: (self orientation, #:) asSymbol with: targetPoint.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>orientation (in category 'accessing') -----<br>
+ orientation<br>
+ "Encodes the position of the tail. #topLeft, #topRight, #bottomLeft, #bottomRight"<br>
+<br>
+ ^ orientation!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>orientation: (in category 'accessing') -----<br>
+ orientation: aSymbol<br>
+<br>
+ orientation := aSymbol.<br>
+ self changed.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>popUpAt:forHand: (in category 'initialization') -----<br>
+ popUpAt: point forHand: aHand<br>
+ "Pop up the receiver as balloon help for the given hand"<br>
+<br>
+ #(bottomLeft bottomRight topLeft topRight) detect: [:nextOrientation |<br>
+ self orientation: nextOrientation.<br>
+ self move: point.<br>
+ self bounds: (self bounds translatedToBeWithin: aHand world bounds).<br>
+ (self bounds perform: self orientation) = point] ifNone: ["Keep last try."].<br>
+<br>
+ aHand world addMorphFront: self.<br>
+ aHand balloonHelp: self.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>popUpFor:hand: (in category 'initialization') -----<br>
+ popUpFor: aMorph hand: aHand<br>
+ "Pop up the receiver as balloon help for the given hand"<br>
+<br>
+ self balloonOwner: aMorph.<br>
+ self popUpForHand: aHand.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>popUpForHand: (in category 'initialization') -----<br>
+ popUpForHand: aHand<br>
+<br>
+ self popUpAt: aHand position forHand: aHand.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>setText: (in category 'initialization') -----<br>
+ setText: stringOrText<br>
+<br>
+ | text |<br>
+ text := stringOrText asText.<br>
+ text addAttribute: (TextFontReference toFont: (self balloonOwner ifNil: [BalloonMorph]) balloonFont).<br>
+<br>
+ self textMorph wrapFlag: false.<br>
+ self textMorph newContents: text.<br>
+ self textMorph fullBounds.<br>
+<br>
+ (self maximumWidth > 0 and: [self textMorph width > self maximumWidth])<br>
+ ifTrue: [<br>
+ self textMorph<br>
+ wrapFlag: true;<br>
+ width: self maximumWidth].<br>
+<br>
+ self updateLayout.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>tailHeight (in category 'geometry') -----<br>
+ tailHeight<br>
+<br>
+ ^ 8!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>tailPosition (in category 'geometry') -----<br>
+ tailPosition<br>
+<br>
+ ^ self innerBounds perform: self orientation!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>tailWidth (in category 'geometry') -----<br>
+ tailWidth<br>
+<br>
+ ^ 15!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>textMorph (in category 'accessing - ui') -----<br>
+ textMorph<br>
+<br>
+ ^ textMorph!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>updateLayout (in category 'layout') -----<br>
+ updateLayout<br>
+<br>
+ self textMorph fullBounds.<br>
+ self extent: self textMorph extent + (2* self bubbleInset) + (0 @ (2*self tailHeight)).<br>
+ self textMorph center: self center.!<br>
<br>
Item was added:<br>
+ ----- Method: NewBalloonMorph>>verticesForTail (in category 'drawing') -----<br>
+ verticesForTail<br>
+<br>
+ | offset factorX factorY tpos bpos |<br>
+ offset := 5 + (self wantsRoundedCorners<br>
+ ifTrue: [self class preferredCornerRadius]<br>
+ ifFalse: [0]).<br>
+ tpos := self tailPosition.<br>
+ factorX := tpos x < self center x ifTrue: [1] ifFalse: [-1].<br>
+ factorY := tpos y > self center y ifTrue: [1] ifFalse: [-1].<br>
+ bpos := self bubbleBounds perform: self orientation.<br>
+<br>
+ ^ {<br>
+ tpos.<br>
+ bpos + (((offset + self tailWidth) * factorX) @ (self borderStyle width negated * factorY)).<br>
+ bpos + ((offset * factorX) @ (self borderStyle width negated * factorY)).}!<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div>