StringHolderView subclass: #DisplayBox instanceVariableNames: 'aspect realmodel ' classVariableNames: '' poolDictionaries: '' category: 'Squeak-UI'! !DisplayBox methodsFor: 'model access' stamp: 'MJG 8/7/97 10:48'! aspect: anAspect aspect _ anAspect. self update: anAspect.! ! !DisplayBox methodsFor: 'model access' stamp: 'mjg 2/9/98 21:05'! model: aModel realmodel _ aModel. super model: (StringHolder new contents: '').! ! !DisplayBox methodsFor: 'model access' stamp: 'mjg 2/9/98 21:29'! update: anAspect (anAspect = aspect) ifTrue: [super model: (StringHolder new contents: (realmodel perform: aspect) printString)]. superView isNil ifFalse: [super update: anAspect.]. ! ! Object subclass: #LayoutFrame instanceVariableNames: 'originFractions cornerFractions ' classVariableNames: '' poolDictionaries: '' category: 'Squeak-UI'! !LayoutFrame methodsFor: 'accessing' stamp: 'JRB 8/30/97 11:39'! cornerFractions ^cornerFractions.! ! !LayoutFrame methodsFor: 'accessing' stamp: 'JRB 8/30/97 11:40'! cornerFractions: corner cornerFractions _ corner.! ! !LayoutFrame methodsFor: 'accessing' stamp: 'JRB 8/30/97 11:39'! originFractions ^originFractions.! ! !LayoutFrame methodsFor: 'accessing' stamp: 'JRB 8/30/97 11:39'! originFractions: origin originFractions _ origin.! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! LayoutFrame class instanceVariableNames: ''! !LayoutFrame class methodsFor: 'instance creation' stamp: 'JRB 8/30/97 11:40'! originFractions: origin cornerFractions: corner ^self new originFractions: origin; cornerFractions: corner.! ! StandardSystemView subclass: #ModelValueViewContainer instanceVariableNames: 'windowSize windowLabel ' classVariableNames: '' poolDictionaries: '' category: 'Squeak-UI'! !ModelValueViewContainer methodsFor: 'private' stamp: 'JRB 8/30/97 11:52'! constraintFrame: originConstraints corner: cornerConstraints ^LayoutFrame originFractions: originConstraints cornerFractions: cornerConstraints.! ! !ModelValueViewContainer methodsFor: 'window opening' stamp: 'JRB 7/31/97 07:07'! openOn: aModel self openOn: aModel label: self windowLabel.! ! !ModelValueViewContainer methodsFor: 'window opening' stamp: 'mjg 2/9/98 21:41'! openOn: aModel label: aLabel self model: aModel. self label: aLabel. self minimumSize: (self windowSize). "self borderWidth: 1." self buildViewOn: aModel. self controller open.! ! !ModelValueViewContainer methodsFor: 'window opening' stamp: 'JRB 8/30/97 13:21'! windowLabel ^windowLabel.! ! !ModelValueViewContainer methodsFor: 'window opening' stamp: 'JRB 8/30/97 11:44'! windowLabel: label windowLabel _ label.! ! !ModelValueViewContainer methodsFor: 'window opening' stamp: 'JRB 8/30/97 11:43'! windowSize ^windowSize.! ! !ModelValueViewContainer methodsFor: 'window opening' stamp: 'JRB 8/30/97 11:43'! windowSize: size windowSize _ size.! ! !ModelValueViewContainer methodsFor: 'view layout' stamp: 'JRB 8/30/97 11:42'! addView: view in: area | x1 y1 x2 y2 | x1 _ self windowSize x * (area originFractions) x. y1 _ self windowSize y * (area originFractions) y. x2 _ self windowSize x * (area cornerFractions) x. y2 _ self windowSize y * (area cornerFractions) y. self addSubView: view viewport: (x1@y1 corner: x2@y2).! ! !ModelValueViewContainer methodsFor: 'view creation' stamp: 'JRB 8/30/97 12:50'! makeButton: buttonLabel on: aModel for: action | aButton | aButton _ Button newOff onAction: [aModel perform: action.]. ^SwitchView new label: buttonLabel asParagraph; insideColor: Color gray; model: aButton. ! ! !ModelValueViewContainer methodsFor: 'view creation' stamp: 'mjg 2/9/98 21:29'! makeDisplayBoxOn: aModel for: aspect | displayView | displayView _ DisplayBox new. displayView model: aModel. displayView aspect: aspect. aModel addDependent: displayView. ^displayView.! ! !ModelValueViewContainer methodsFor: 'initialize-release' stamp: 'JRB 8/30/97 13:21'! initialize super initialize. self windowSize: 100@100. self windowLabel: 'Model View'. self window: (0@0 extent: self windowSize) viewport: (0@0 extent: 100@100).! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! ModelValueViewContainer class instanceVariableNames: ''! !ModelValueViewContainer class methodsFor: 'examples' stamp: 'JRB 8/6/97 08:16'! displayView | topView textView count | count _ IntegerCount new. textView _ DisplayTextView new model: count value printString; controller: NoController new; borderWidth: 1; insideColor: Color white; centered. topView _ StandardSystemView new label: 'Count display'; borderWidth: 1. topView addSubView: textView. topView controller open.! ! !ModelValueViewContainer class methodsFor: 'examples' stamp: 'JRB 7/31/97 07:29'! twoButtons | count | count _ IntegerCount new. ModelValueViewContainer new openOn: count. ! !