changed: #doRotateImage expecco_2_2_0 expecco_2_2_5
authorClaus Gittinger <cg@exept.de>
Sun, 18 Mar 2012 14:43:52 +0100
changeset 2884b24f5e13e650
parent 2883 bee1a24df6e4
child 2885 b0e2db45664a
changed: #doRotateImage
ImageEditor.st
     1.1 --- a/ImageEditor.st	Thu Mar 01 10:52:33 2012 +0100
     1.2 +++ b/ImageEditor.st	Sun Mar 18 14:43:52 2012 +0100
     1.3 @@ -6176,21 +6176,29 @@
     1.4  doRotateImage
     1.5      "rotates current image"
     1.6  
     1.7 -    |box rotation|
     1.8 -
     1.9 -    box := EnterBox new.
    1.10 -    box title:(resources string:'Rotate by (degrees, clockwise):').
    1.11 -    box okText:(resources string:'OK').
    1.12 -    box abortText:(resources string:'Cancel').
    1.13 -    box initialText: '0'.
    1.14 -    box showAtPointer.
    1.15 -    (box accepted and: [(rotation := Number readFromString: box contents onError:nil) notNil])
    1.16 -    ifTrue:[
    1.17 -        imageEditView rotateImageBy:rotation.
    1.18 -        self updateInfoLabel.
    1.19 -    ].
    1.20 -
    1.21 -    "Modified: / 11-11-2007 / 13:21:11 / cg"
    1.22 +    |rotationString box rotation|
    1.23 +
    1.24 +    rotationString := Dialog 
    1.25 +                        request:(resources string:'Rotate by (degrees, clockwise):')
    1.26 +                        list:#( '-90' '90' '180' '45' '-45'  '135' '-135' ) 
    1.27 +                        initialAnswer:90.
    1.28 +    rotationString isEmptyOrNil ifTrue:[^ self].    "/ cancelled
    1.29 +    rotation := Number readFrom:rotationString onError:[nil].
    1.30 +    rotation isNil ifTrue:[^ self].   
    1.31 +
    1.32 +"/    box := EnterBox new.
    1.33 +"/    box title:(resources string:'Rotate by (degrees, clockwise):').
    1.34 +"/    box okText:(resources string:'OK').
    1.35 +"/    box abortText:(resources string:'Cancel').
    1.36 +"/    box initialText: '0'.
    1.37 +"/    box showAtPointer.
    1.38 +"/    (box accepted and: [(rotation := Number readFromString: box contents onError:nil) notNil])
    1.39 +"/    ifFalse:[ ^ self ].
    1.40 +
    1.41 +    imageEditView rotateImageBy:rotation.
    1.42 +    self updateInfoLabel.
    1.43 +
    1.44 +    "Modified: / 18-03-2012 / 14:41:14 / cg"
    1.45  !
    1.46  
    1.47  doShiftManual