Spec
Spec copied to clipboard
newNumberInput raises an error when we enter not a number but a string
initializePresenters
yearNumber := self newNumberInput
rangeMinimum: 1900 maximum: Year current year;
yourself
enter a dddd in the field and press the little arrows.
expected: aString
| errorString |
errorString := aString , ' expected'.
requestor
ifNotNil: [ requestor notify: errorString at: sourceStream position + 1 in: sourceStream ].
failBlock ifNotNil: [ ^ failBlock cull: errorString cull: sourceStream position + 1 ].
self error: 'Reading a number failed: ' , errorString
NumberParser(Object)>>error:
NumberParser>>expected:
NumberParser>>readNamedFloatOrFail
NumberParser>>nextNumber
Number class>>readFrom:
Number class(Object)>>readFromString:
ByteString(String)>>asNumber
Text>>asNumber
[ :text | text asNumber + self model climbRate ] in SpMorphicNumberInputFieldAdapter>>increasedValueFrom: in Block: [ :text | text asNumber + self model climbRate ]
FullBlockClosure(BlockClosure)>>cull:
Text(Collection)>>ifEmpty:ifNotEmpty:
SpMorphicNumberInputFieldAdapter>>increasedValueFrom:
SpMorphicNumberInputFieldAdapter>>increaseValueOf:
[target perform: actionSelector withArguments: arguments] in IconicButtonMorph(SimpleButtonMorph)>>doButtonAction in Block: [target perform: actionSelector withArguments:[..]
FullBlockClosure(BlockClosure)>>ensure:
CursorWithMask(Cursor)>>showWhile:
IconicButtonMorph(SimpleButtonMorph)>>doButtonAction
IconicButtonMorph(SimpleButtonMorph)>>mouseUp:
IconicButtonMorph(Morph)>>handleMouseUp:
MouseButtonEvent>>sentTo:
IconicButtonMorph(Morph)>>handleEvent:
IconicButtonMorph(Morph)>>handleFocusEvent:
[
result := focusHolder handleFocusEvent: transformedEvent.
] in HandMorph>>sendFocusEvent:to:clear: in Block: [...
FullBlockClosure(BlockClosure)>>on:do:
WorldMorph>>becomeActiveDuring:
HandMorph>>sendFocusEvent:to:clear:
HandMorph>>sendEvent:focus:clear:
HandMorph>>sendMouseEvent:
HandMorph>>handleEvent:
[
(morphicWorld activeHand isNotNil and: [ anEvent hand isNotNil ]) ifTrue: [
morphicWorld activeHand handleEvent: anEvent
]
] in OSWindowMorphicEventHandler>>dispatchMorphicEvent: in Block: [...
I could reproduce it but I don't know what should happen instead