DisplayTextView 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: 'JRB 8/14/97 07:17'! model: aModel realmodel _ aModel. ! ! !DisplayBox methodsFor: 'model access' stamp: 'JRB 8/14/97 07:28'! update: anAspect (anAspect = aspect) ifTrue: [super model: (realmodel perform: aspect) printString]. self displayView. ! ! 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: 'JRB 11/10/97 03:20'! openOn: aModel label: aLabel self model: aModel. self label: aLabel. self borderWidth: 1. self buildViewOn: aModel. [self controller open] fork.! ! !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: 'JRB 8/14/97 07:28'! makeDisplayBoxOn: aModel for: aspect | displayView | displayView _ DisplayBox new model: aModel; aspect: aspect; controller: NoController new; borderWidth: 1; insideColor: Color white; centered. 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. ! ! ModelValueViewContainer subclass: #CountViewContainer instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Squeak-UI'! !CountViewContainer methodsFor: 'view opening' stamp: 'JRB 8/7/97 01:47'! buildViewOn: aCount self addDisplayBoxOn: aCount. self addIncrementButtonOn: aCount. self addDecrementButtonOn: aCount. self addResetButtonOn: aCount.! ! !CountViewContainer methodsFor: 'view creation' stamp: 'JRB 8/30/97 11:48'! addDecrementButtonOn: aCount | button buttonArea | button _ self makeButton: 'decrement' on: aCount for: #decrement. buttonArea _ self constraintFrame: 1/3 @ 0 corner: 2/3 @ (1/3). self addView: button in: buttonArea.! ! !CountViewContainer methodsFor: 'view creation' stamp: 'JRB 8/30/97 11:50'! addDisplayBoxOn: aCount | itemView itemArea | itemView _ self makeDisplayBoxOn: aCount for: #value. itemArea _ self constraintFrame: 1/3 @ (1/2) corner: 2/3 @ 1. self addView: itemView in: itemArea.! ! !CountViewContainer methodsFor: 'view creation' stamp: 'JRB 8/30/97 11:50'! addIncrementButtonOn: aCount | button buttonArea | button _ self makeButton: 'increment' on: aCount for: #increment. buttonArea _ self constraintFrame: 0 @ 0 corner: 1/3 @ (1/3). self addView: button in: buttonArea.! ! !CountViewContainer methodsFor: 'view creation' stamp: 'JRB 8/30/97 11:51'! addResetButtonOn: aCount | button buttonArea | button _ self makeButton: 'reset' on: aCount for: #reset. buttonArea _ self constraintFrame: 2/3 @ 0 corner: 1 @ (1/3). self addView: button in: buttonArea.! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! CountViewContainer class instanceVariableNames: ''! !CountViewContainer class methodsFor: 'examples' stamp: 'JRB 8/7/97 01:54'! integerCountView | count | count _ IntegerCount new. CountViewContainer new openOn: count. ! !