'From Cuis 6.0 [latest update: #5069] on 21 February 2022 at 5:03:04 pm'!

!Morph methodsFor: 'halos and balloon help' stamp: 'jmv 2/21/2022 16:59:52'!
balloonTextWordWrap
	"Set to true for default line with.
	Set to a number for a specific line width."

	^ self valueOfProperty: #balloonTextWordWrap ifAbsent: [ false ]! !


!SmalltalkEditor methodsFor: 'quick action (shift+click)' stamp: 'jmv 2/21/2022 16:48:20'!
quickPrintOfNodeUnder: aMousePosition

	| mousePositionInText |
	
	mousePositionInText := morph positionInTextOf: aMousePosition.

	self 
		withMethodNodeAndClassDo: [ :methodNode :class | 
			methodNode 
				withParseNodeIncluding: mousePositionInText 
				do: [ :aNodeUnderCursor | morph showBalloon: (self hoverHelpToShowEvaluating: aNodeUnderCursor)]
				ifAbsent: [  morph flash  ]]
		ifErrorsParsing: [ :anError | morph showBalloon: anError messageText ]! !


!Morph methodsFor: 'halos and balloon help' stamp: 'jmv 2/21/2022 16:49:01'!
showBalloon: msgString
	"Pop up a balloon containing the given string,
	first removing any existing BalloonMorphs in the world."

	self showBalloon: msgString hand: nil! !

!Morph methodsFor: 'halos and balloon help' stamp: 'jmv 2/21/2022 17:02:17'!
showBalloon: msgString hand: aHand
	"Pop up a balloon containing the given string,
	first removing any existing BalloonMorphs in the world."

	| w balloon h ww |
	w _ self world ifNil: [^ self].
	h _ aHand ifNil: [ w activeHand ].
	ww _ self balloonTextWordWrap.
	balloon _ ww == false
		ifTrue: [ HoverHelpMorph contents: msgString ]
		ifFalse: [
			ww isNumber
				ifTrue: [ HoverHelpMorph contents: msgString wrappedTo: ww ]
				ifFalse: [ HoverHelpMorph contentsWrapped: msgString ]].
	
	"Do it in a while. In some cases, processing the event that might have triggered us might also remove any Help Balloon."
	UISupervisor whenUIinSafeState: [
		balloon popUpForHand: h ]! !

!methodRemoval: InnerTextMorph #showHoverHelpWith: stamp: 'jmv 2/21/2022 16:48:29'!
InnerTextMorph removeSelector: #showHoverHelpWith:!
