'From Pharo1.4a of ''16 June 2011'' [Latest update: #14139] on 15 September 2011 at 9:14:14 am'! Morph subclass: #AdorementMorph instanceVariableNames: 'model' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Pluggable Widgets'! ScrollPane subclass: #PluggableTextMorph instanceVariableNames: 'textMorph getTextSelector setTextSelector getSelectionSelector hasUnacceptedEdits askBeforeDiscardingEdits selectionInterval hasEditingConflicts acceptAction getColorSelector unstyledAcceptText styler autoAccept enabled getEnabledSelector highlights acceptOnFocusChange selectionColor alwaysAccept changedAction adorementCorner ' classVariableNames: 'ShowTextEditingState StylingClass ' poolDictionaries: '' category: 'Morphic-Pluggable Widgets'! !AdorementMorph methodsFor: 'drawing' stamp: 'IgorStasenko 2/17/2011 16:13'! drawOn: aCanvas "Indicate edit status for the given morph." | size fillStyle aColor| aColor := self color. size := 25. fillStyle := (GradientFillStyle ramp: { 0.0->(Color white alpha: 0.01). 0.8->aColor. 1.0->aColor}) origin: bounds topRight - (size@0); direction: (size @ size negated) // 4; radial: false. aCanvas drawPolygon: {bounds topRight. bounds topRight + (0@size). bounds topRight - (size@0)} fillStyle: fillStyle ! ! !AdorementMorph methodsFor: 'event handling' stamp: 'IgorStasenko 2/17/2011 16:22'! handlesMouseOver: anEvent ^ true ! ! !AdorementMorph methodsFor: 'event handling' stamp: 'IgorStasenko 2/17/2011 17:00'! mouseEnter: evt evt hand showTemporaryCursor: Cursor webLink! ! !AdorementMorph methodsFor: 'event handling' stamp: 'IgorStasenko 2/17/2011 16:24'! mouseLeave: evt evt hand showTemporaryCursor: Cursor normal! ! !AdorementMorph methodsFor: 'accessing' stamp: 'IgorStasenko 2/17/2011 16:38'! model ^ owner! ! !AdorementMorph methodsFor: 'accessing' stamp: 'IgorStasenko 2/17/2011 16:43'! model: anObject anObject addMorph: self fullFrame: (LayoutFrame fractions: (1 @ 0 corner: 1 @ 0) offsets: (-20 @ 0 corner: 0@20)). self visible: false.! ! !AdorementMorph methodsFor: 'updating' stamp: 'IgorStasenko 2/17/2011 17:36'! update: aSymbol self model hasUnacceptedEdits ifTrue: [ self visible: true. self color: Color orange ] ifFalse: [ self model hasEditingConflicts ifTrue:[ self visible: true. self color: Color red]. self visible: false. self color: Color blue ]! ! !AdorementMorph class methodsFor: 'as yet unclassified' stamp: 'IgorStasenko 2/17/2011 16:27'! on: aModel ^ self new model: aModel! ! !PluggableTextMorph methodsFor: 'initialization' stamp: 'BenjaminVanRyseghem 9/15/2011 09:12'! initialize "initialize the state of the receiver" super initialize. adorementCorner := AdorementMorph on: self. self changeProportionalLayout. self addDependent: adorementCorner. hasUnacceptedEdits := false. hasEditingConflicts := false. askBeforeDiscardingEdits := true. enabled := true. highlights := OrderedCollection new! ! !PluggableTextMorph methodsFor: 'unaccepted edits' stamp: 'BenjaminVanRyseghem 9/15/2011 09:13'! hasUnacceptedEdits: aBoolean "Set the hasUnacceptedEdits flag to the given value. " aBoolean == hasUnacceptedEdits ifFalse: [hasUnacceptedEdits := aBoolean. self changed. self changed: #hasUnacceptedEdits]. aBoolean ifFalse: [hasEditingConflicts := false]. self okToStyle ifTrue: [ self styler styleInBackgroundProcess: textMorph contents]! ! ScrollPane subclass: #PluggableTextMorph instanceVariableNames: 'textMorph getTextSelector setTextSelector getSelectionSelector hasUnacceptedEdits askBeforeDiscardingEdits selectionInterval hasEditingConflicts acceptAction getColorSelector unstyledAcceptText styler autoAccept enabled getEnabledSelector highlights acceptOnFocusChange selectionColor alwaysAccept changedAction adorementCorner' classVariableNames: 'ShowTextEditingState StylingClass' poolDictionaries: '' category: 'Morphic-Pluggable Widgets'!