[squeak-dev] The Trunk: Exceptions-kb.32.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Apr 18 15:34:05 UTC 2011
Balázs Kósi uploaded a new version of Exceptions to project The Trunk:
http://source.squeak.org/trunk/Exceptions-kb.32.mcz
==================== Summary ====================
Name: Exceptions-kb.32
Author: kb
Time: 18 April 2011, 5:16:35.771 pm
UUID: 8e0d8b4d-aab1-dd45-bb28-a285be10bf1b
Ancestors: Exceptions-ar.31
Remove Morphic/MVC dependencies from ProgressInitiationException.
=============== Diff against Exceptions-ar.31 ===============
Item was changed:
----- Method: ProgressInitiationException>>defaultAction (in category 'as yet unclassified') -----
defaultAction
+
+ | result |
+ result := UIManager default
+ displayProgress: progressTitle
+ at: aPoint
+ from: minVal
+ to: maxVal
+ during: workBlock.
+ self resume: result!
- Smalltalk isMorphic
- ifTrue: [self defaultMorphicAction]
- ifFalse: [self defaultMVCAction].
- !
Item was removed:
- ----- Method: ProgressInitiationException>>defaultMVCAction (in category 'as yet unclassified') -----
- defaultMVCAction
-
- | delta savedArea captionText textFrame barFrame outerFrame result range lastW |
- barFrame := aPoint - (75 at 10) corner: aPoint + (75 at 10).
- captionText := DisplayText text: progressTitle asText allBold.
- captionText
- foregroundColor: Color black
- backgroundColor: Color white.
- textFrame := captionText boundingBox insetBy: -4.
- textFrame := textFrame align: textFrame bottomCenter
- with: barFrame topCenter + (0 at 2).
- outerFrame := barFrame merge: textFrame.
- delta := outerFrame amountToTranslateWithin: Display boundingBox.
- barFrame := barFrame translateBy: delta.
- textFrame := textFrame translateBy: delta.
- outerFrame := outerFrame translateBy: delta.
- savedArea := Form fromDisplay: outerFrame.
- Display fillBlack: barFrame; fillWhite: (barFrame insetBy: 2).
- Display fillBlack: textFrame; fillWhite: (textFrame insetBy: 2).
- captionText displayOn: Display at: textFrame topLeft + (4 at 4).
- range := maxVal = minVal ifTrue: [1] ifFalse: [maxVal - minVal]. "Avoid div by 0"
- lastW := 0.
- [result := workBlock value: "Supply the bar-update block for evaluation in the work block"
- [:barVal |
- | w |
- w := ((barFrame width-4) asFloat * ((barVal-minVal) asFloat / range min: 1.0)) asInteger.
- w ~= lastW ifTrue: [
- Display fillGray: (barFrame topLeft + (2 at 2) extent: w at 16).
- lastW := w]]]
- ensure: [savedArea displayOn: Display at: outerFrame topLeft].
- self resume: result!
Item was removed:
- ----- Method: ProgressInitiationException>>defaultMorphicAction (in category 'as yet unclassified') -----
- defaultMorphicAction
- | result progress |
- progress := SystemProgressMorph label: progressTitle min: minVal max: maxVal.
- [
- [result := workBlock value: progress] on: ProgressNotification do:[:ex|
- ex extraParam isString ifTrue:[
- SystemProgressMorph uniqueInstance labelAt: progress put: ex extraParam.
- ].
- ex resume.
- ].
- ] ensure: [SystemProgressMorph close: progress].
- self resume: result!
More information about the Squeak-dev
mailing list
|