'From Squeak3.7beta of ''1 April 2004'' [latest update: #5905] on 29 April 2004 at 7:28:52 am'! "Change Set: InspectElementFixv2 Date: 9 March 2004 Author: Yoshiki Ohshima When printString contains return characters, the menus that assume the resulted string fits one line fails. This fixes one problem I encounterd. Also, the short-cut in the WriteStream>>nextPutAll: short-cuts the limit check in LimitedWriteStream. This change fix it. "! !Inspector methodsFor: 'menu commands' stamp: 'yo 3/9/2004 11:04'! inspectElement | sel selSize countString count nameStrs | "Create and schedule an Inspector on an element of the receiver's model's currently selected collection." self selectionIndex = 0 ifTrue: [^ self changed: #flash]. ((sel _ self selection) isKindOf: SequenceableCollection) ifFalse: [(sel isKindOf: MorphExtension) ifTrue: [^ sel inspectElement]. ^ sel inspect]. (selSize _ sel size) == 1 ifTrue: [^ sel first inspect]. selSize <= 20 ifTrue: [nameStrs _ (1 to: selSize) asArray collect: [:ii | ii printString, ' ', (((sel at: ii) printStringLimitedTo: 25) replaceAll: Character cr with: Character space)]. count _ PopUpMenu withCaption: 'which element?' chooseFrom: nameStrs. count = 0 ifTrue: [^ self]. ^ (sel at: count) inspect]. countString _ FillInTheBlank request: 'Which element? (1 to ', selSize printString, ')' initialAnswer: '1'. countString isEmptyOrNil ifTrue: [^ self]. count _ Integer readFrom: (ReadStream on: countString). (count > 0 and: [count <= selSize]) ifTrue: [(sel at: count) inspect] ifFalse: [Beeper beep]! ! !LimitedWriteStream methodsFor: 'as yet unclassified' stamp: 'BG 3/13/2004 13:18'! nextPutAll: aCollection | newEnd | collection class == aCollection class ifFalse: [^ super nextPutAll: aCollection ]. newEnd _ position + aCollection size. newEnd > limit ifTrue: [ super nextPutAll: (aCollection copyFrom: 1 to: (limit - position max: 0)). ^ limitBlock value. ]. newEnd > writeLimit ifTrue: [ self growTo: newEnd + 10 ]. collection replaceFrom: position+1 to: newEnd with: aCollection startingAt: 1. position _ newEnd.! ! !LimitedWriteStream methodsFor: 'accessing' stamp: 'BG 3/13/2004 16:03'! nextPut: anObject "Ensure that the limit is not exceeded" position >= limit ifTrue: [limitBlock value] ifFalse: [super nextPut: anObject]. ! !