[squeak-dev] The Trunk: Exceptions-cmm.34.mcz

Chris Muller asqueaker at gmail.com
Wed Jun 15 16:54:21 UTC 2011


If, by "the progress bar" you mean SystemProgressMorph, I disagree,
since that would create a dependency on Morphic.
ProgressInitiationException allows domain-level code to signal that
something worth indicating progress is occurring, and different UI
frameworks can capture that notification (or not) and render it each
in their own way.

 - Chris


On Wed, Jun 15, 2011 at 11:48 AM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> Hi Chris,
>     just because ProgressInitiationException is an exception doesn't imply
> it belongs in exceptions.  Surely it belongs in the same package as the
> progress bar.
> best
> Eliot
>
> On Wed, Jun 15, 2011 at 9:13 AM, <commits at source.squeak.org> wrote:
>>
>> 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 Squeak-dev mailing list