[Pkg] The Trunk: Exceptions-cmm.34.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jun 15 16:14:02 UTC 2011
Chris Muller uploaded a new version of Exceptions to project The Trunk:
http://source.squeak.org/trunk/Exceptions-cmm.34.mcz
==================== Summary ====================
Name: Exceptions-cmm.34
Author: cmm
Time: 15 June 2011, 11:13:51.392 am
UUID: f0144460-f227-7b43-bee2-019786f35a4e
Ancestors: Exceptions-nice.33
First step toward preferredProgressBarPosition preference.
=============== Diff against Exceptions-nice.33 ===============
Item was changed:
Exception subclass: #ProgressInitiationException
instanceVariableNames: 'workBlock maxVal minVal aPoint progressTitle'
+ classVariableNames: 'PreferredProgressBarPosition'
- classVariableNames: ''
poolDictionaries: ''
category: 'Exceptions-Kernel'!
!ProgressInitiationException commentStamp: '<historical>' prior: 0!
I provide a way to alter the behavior of the old-style progress notifier in String. See examples in:
ProgressInitiationException testWithout.
ProgressInitiationException testWith.
!
Item was changed:
----- Method: ProgressInitiationException class>>display:at:from:to:during: (in category 'signalling') -----
+ display: aString at: aPoint from: minVal to: maxVal during: workBlock
- display: aString at: aPoint from: minVal to: maxVal during: workBlock
-
^ self new
+ display: aString
+ at: (aPoint ifNil: [ self preferredProgressBarPoint ])
+ from: minVal
+ to: maxVal
+ during: workBlock!
- display: aString at: aPoint from: minVal to: maxVal during: workBlock!
Item was added:
+ ----- Method: ProgressInitiationException class>>display:from:to:during: (in category 'signalling') -----
+ display: aString from: minVal to: maxVal during: workBlock
+ ^ self
+ display: aString
+ at: nil
+ from: minVal
+ to: maxVal
+ during: workBlock!
Item was added:
+ ----- Method: ProgressInitiationException class>>preferredProgressBarPoint (in category 'accessing') -----
+ preferredProgressBarPoint
+ ^ self preferredProgressBarPosition = #cursorPoint
+ ifTrue: [ Sensor cursorPoint ]
+ ifFalse: [ UIManager default screen perform: self preferredProgressBarPosition ]!
Item was added:
+ ----- Method: ProgressInitiationException class>>preferredProgressBarPosition (in category 'accessing') -----
+ preferredProgressBarPosition
+ ^ PreferredProgressBarPosition ifNil: [ #center ]!
Item was added:
+ ----- Method: ProgressInitiationException class>>preferredProgressBarPosition: (in category 'accessing') -----
+ preferredProgressBarPosition: aSymbol
+ "Specify any of: #center, #topCenter, #bottomCenter, #leftCenter, #rightCenter, #topLeft, #topRight, #bottomLeft or #bottomRight or #cursorPoint."
+ ^ PreferredProgressBarPosition!
Item was changed:
----- Method: ProgressInitiationException class>>testInnermost (in category 'examples and tests') -----
testInnermost
"test the progress code WITHOUT special handling"
^'Now here''s some Real Progress'
+ displayProgressFrom: 0
- displayProgressAt: Sensor cursorPoint
- from: 0
to: 10
during: [ :bar |
1 to: 10 do: [ :x |
bar value: x. (Delay forMilliseconds: 500) wait.
x = 5 ifTrue: [1/0]. "just to make life interesting"
].
'done'
].
!
More information about the Packages
mailing list