'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 9 March 2010 at 8:58:47 am'!
CelesteComposition subclass: #FancyCelesteComposition
instanceVariableNames: 'theLinkToInclude to subject textFields'
classVariableNames: ''
poolDictionaries: ''
category: 'Network-Mail Reader'!
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 7/7/2000 17:51'!
borderAndButtonColor
^Color r: 0.729 g: 0.365 b: 0.729! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'ar 11/9/2000 21:14'!
buttonWithAction: aSymbol label: labelString help: helpString
^self newColumn
wrapCentering: #center; cellPositioning: #topCenter;
addMorph: (
SimpleButtonMorph new
color: self borderAndButtonColor;
target: self;
actionSelector: aSymbol;
label: labelString;
setBalloonText: helpString
)
! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 5/19/2000 18:55'!
celeste: aCeleste to: argTo subject: argSubject initialText: aText theLinkToInclude: linkText
celeste _ aCeleste.
to _ argTo.
subject _ argSubject.
messageText _ aText.
theLinkToInclude _ linkText.
textFields _ #().
! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'ads 2/16/2004 11:37'!
completeTheMessage
| newText strm |
textFields do: [ :each | each hasUnacceptedEdits ifTrue: [ each accept ] ].
newText _ String new: 200.
strm _ WriteStream on: newText.
strm
nextPutAll: 'Content-Type: text/html'; cr;
nextPutAll: 'From: ', celeste account userName; cr;
nextPutAll: 'To: ',to; cr;
nextPutAll: 'Subject: ',subject; cr;
cr;
nextPutAll: '
';
nextPutAll: messageText asString asHtml;
nextPutAll: '
',theLinkToInclude,'
'.
^strm contents
! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 7/7/2000 17:35'!
forgetIt
morphicWindow ifNotNil: [ morphicWindow delete ].
mvcWindow ifNotNil: [ mvcWindow controller close ].
! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 7/7/2000 17:42'!
newColumn
^AlignmentMorph newColumn color: self staticBackgroundColor! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 7/7/2000 17:41'!
newRow
^AlignmentMorph newRow color: self staticBackgroundColor! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'ar 11/10/2000 15:46'!
openInMorphic
"open an interface for sending a mail message with the given initial
text "
| buttonsList container toField subjectField |
buttonsList _ self newRow.
buttonsList wrapCentering: #center; cellPositioning: #leftCenter.
buttonsList
addMorphBack: (
(self
buttonWithAction: #submit
label: 'send later'
help: 'add this to the queue of messages to be sent')
);
addMorphBack: (
(self
buttonWithAction: #sendNow
label: 'send now'
help: 'send this message immediately')
);
addMorphBack: (
(self
buttonWithAction: #forgetIt
label: 'forget it'
help: 'forget about sending this message')
).
morphicWindow _ container _ AlignmentMorphBob1 new
borderWidth: 8;
borderColor: self borderAndButtonColor;
color: Color white.
container
addMorphBack: (buttonsList vResizing: #shrinkWrap; minHeight: 25; yourself);
addMorphBack: ((self simpleString: 'To:') vResizing: #shrinkWrap; minHeight: 18; yourself);
addMorphBack: ((toField _ PluggableTextMorph
on: self
text: #to
accept: #to:) hResizing: #spaceFill; vResizing: #rigid; height: 50; yourself
);
addMorphBack: ((self simpleString: 'Subject:') vResizing: #shrinkWrap; minHeight: 18; yourself);
addMorphBack: ((subjectField _ PluggableTextMorph
on: self
text: #subject
accept: #subject:) hResizing: #spaceFill; vResizing: #rigid; height: 50; yourself
);
addMorphBack: ((self simpleString: 'Message:') vResizing: #shrinkWrap; minHeight: 18; yourself);
addMorphBack: ((textEditor _ PluggableTextMorph
on: self
text: #messageText
accept: #messageText:) hResizing: #spaceFill; vResizing: #spaceFill; yourself
).
textFields _ {toField. subjectField. textEditor}.
container
extent: 300@400;
openInWorld.! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 5/19/2000 12:53'!
sendNow
self submit: true
! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'ar 11/9/2000 20:39'!
simpleString: aString
^self newRow
layoutInset: 2;
addMorphBack: (StringMorph contents: aString) lock! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 7/7/2000 17:38'!
staticBackgroundColor
^Color veryLightGray! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 5/19/2000 18:48'!
subject
^subject
! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 5/19/2000 19:02'!
subject: x
subject _ x.
self changed: #subject.
^true! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 5/19/2000 12:53'!
submit
self submit: false! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'mdr 3/15/2001 14:21'!
submit: sendNow
| newMessageNumber personalCeleste windows |
personalCeleste _ false.
celeste ifNil: [
personalCeleste _ true.
celeste _ Celeste open.
].
newMessageNumber _ celeste queueMessageWithText: (
self breakLines: self completeTheMessage atWidth: 999
).
sendNow ifTrue: [celeste sendMail: {newMessageNumber}].
personalCeleste ifTrue: [
windows _ SystemWindow
windowsIn: self currentWorld
satisfying: [ :each | each model == celeste].
celeste close.
windows do: [ :each | each delete].
].
self forgetIt.
! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 5/19/2000 18:47'!
to
^to! !
!FancyCelesteComposition methodsFor: 'as yet unclassified' stamp: 'RAA 5/19/2000 19:02'!
to: x
to _ x.
self changed: #to.
^true
! !