"Filed out from Dolphin Smalltalk X6"!

Shell subclass: #BMIChecker
	instanceVariableNames: 'heightPresenter weightPresenter bmiPresenter'
	classVariableNames: ''
	poolDictionaries: ''
	classInstanceVariableNames: ''!
BMIChecker guid: (GUID fromString: '{EAE85CEF-3C2E-4A3A-83A9-0FEFBA67ED98}')!
BMIChecker comment: ''!
!BMIChecker categoriesForClass!Unclassified! !
!BMIChecker methodsFor!

bmiChanged
	| bmiValue fieldColor |
	bmiValue := weightPresenter value / (heightPresenter value ** 2).
	bmiPresenter value: bmiValue.
	fieldColor :=
		bmiValue < 18.5 ifTrue: [Color white] ifFalse: [
		bmiValue < 20 ifTrue: [Color yellow] ifFalse: [
		bmiValue < 30
			ifTrue: [Color red: 255 green: 153 blue: 0]
			ifFalse: [Color red]]].
	bmiPresenter view backcolor: fieldColor!

createComponents
	super createComponents.
	heightPresenter := self add: NumberPresenter new name: 'height'.
	weightPresenter := self add: NumberPresenter new name: 'weight'.
	bmiPresenter := self add: NumberPresenter new name: 'bmi'!

createSchematicWiring
	super createSchematicWiring.
	heightPresenter when: #valueChanged send: #bmiChanged to: self.
	weightPresenter when: #valueChanged send: #bmiChanged to: self! !
!BMIChecker categoriesFor: #bmiChanged!public! !
!BMIChecker categoriesFor: #createComponents!initializing!public! !
!BMIChecker categoriesFor: #createSchematicWiring!initializing!public! !

!BMIChecker class methodsFor!

resource_Default_view
	"Answer the literal data from which the 'Default view' resource can be reconstituted.
	DO NOT EDIT OR RECATEGORIZE THIS METHOD.

	If you wish to modify this resource evaluate:
	ViewComposer openOn: (ResourceIdentifier class: self selector: #resource_Default_view)
	"

	^#(#'!!STL' 3 788558 10 ##(Smalltalk.STBViewProxy)  8 ##(Smalltalk.ShellView)  98 27 0 0 98 2 26607617 131073 416 0 524550 ##(Smalltalk.ColorRef)  8 4278190080 0 39 0 0 0 416 0 234 256 98 6 410 8 ##(Smalltalk.TextEdit)  98 16 0 416 98 2 8 1140916224 1025 560 0 482 8 4278190080 0 7 0 0 0 560 0 8 4294902931 787206 ##(Smalltalk.NumberToText)  0 8 '' 0 1 983302 ##(Smalltalk.MessageSequence)  202 208 98 3 721670 ##(Smalltalk.MessageSend)  8 #createAt:extent: 98 2 328198 ##(Smalltalk.Point)  171 169 866 281 41 560 802 8 #selectionRange: 98 1 525062 ##(Smalltalk.Interval)  3 1 3 560 802 8 #isTextModified: 98 1 32 560 983302 ##(Smalltalk.WINDOWPLACEMENT)  8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 85 0 0 0 84 0 0 0 225 0 0 0 104 0 0 0] 98 0 866 193 193 0 27 8 'bmi' 410 576 98 16 0 416 98 2 8 1140916224 1025 1136 0 482 656 0 7 0 0 0 1136 0 8 4294902931 690 0 720 0 1 738 202 208 98 3 802 832 98 2 866 171 109 866 281 41 1136 802 928 98 1 962 3 1 3 1136 802 1008 98 1 32 1136 1042 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 85 0 0 0 54 0 0 0 225 0 0 0 74 0 0 0] 98 0 1104 0 27 8 'weight' 410 576 98 16 0 416 98 2 8 1140916224 1025 1504 0 482 656 0 7 0 0 0 1504 0 8 4294902931 690 0 720 0 1 738 202 208 98 3 802 832 98 2 866 171 49 866 281 41 1504 802 928 98 1 962 3 1 3 1504 802 1008 98 1 32 1504 1042 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 85 0 0 0 24 0 0 0 225 0 0 0 44 0 0 0] 98 0 1104 0 27 8 'height' 0 0 0 0 0 1 0 0 0 0 1 0 0 738 202 208 98 3 802 832 98 2 866 1599 21 866 561 321 416 802 8 #text: 98 1 8 'BMI checker' 416 802 8 #updateMenuBar 98 0 416 1042 8 #[44 0 0 0 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 31 3 0 0 10 0 0 0 55 4 0 0 170 0 0 0] 98 8 410 8 ##(Smalltalk.StaticText)  98 16 0 416 98 2 8 1140850944 1 2144 0 0 0 7 0 0 0 2144 0 8 4294904841 852486 ##(Smalltalk.NullConverter)  0 0 0 738 202 208 98 2 802 832 98 2 866 41 51 866 121 39 2144 802 2000 98 1 8 'Height:' 2144 1042 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 20 0 0 0 25 0 0 0 80 0 0 0 44 0 0 0] 98 0 1104 0 27 410 2160 98 16 0 416 98 2 8 1140850944 1 2480 0 0 0 7 0 0 0 2480 0 8 4294904841 2242 0 0 0 738 202 208 98 2 802 832 98 2 866 41 111 866 121 39 2480 802 2000 98 1 8 'Weight:' 2480 1042 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 20 0 0 0 55 0 0 0 80 0 0 0 74 0 0 0] 98 0 1104 0 27 410 2160 98 16 0 416 98 2 8 1140850944 1 2784 0 0 0 7 0 0 0 2784 0 8 4294904841 2242 0 0 0 738 202 208 98 2 802 832 98 2 866 41 171 866 121 39 2784 802 2000 98 1 8 'BMI:' 2784 1042 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 20 0 0 0 85 0 0 0 80 0 0 0 104 0 0 0] 98 0 1104 0 27 1504 1136 560 410 2160 98 16 0 416 98 2 8 1140850944 1 3088 0 0 0 7 0 0 0 3088 0 8 4294904841 2242 0 0 0 738 202 208 98 2 802 832 98 2 866 471 51 866 61 41 3088 802 2000 98 1 8 'm' 3088 1042 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 235 0 0 0 25 0 0 0 9 1 0 0 45 0 0 0] 98 0 1104 0 27 410 2160 98 16 0 416 98 2 8 1140850944 1 3392 0 0 0 7 0 0 0 3392 0 8 4294904841 2242 0 0 0 738 202 208 98 2 802 832 98 2 866 471 111 866 61 41 3392 802 2000 98 1 8 'kg' 3392 1042 8 #[44 0 0 0 0 0 0 0 1 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 235 0 0 0 55 0 0 0 9 1 0 0 75 0 0 0] 98 0 1104 0 27 1104 0 27 )! !
!BMIChecker class categoriesFor: #resource_Default_view!public!resources-views! !

