changed: expecco_2_0_0 expecco_2_0_0_0
authorClaus Gittinger <cg@exept.de>
Mon, 04 Apr 2011 14:05:56 +0200
changeset 28415f247fa01174
parent 2840 3fc46b951a0f
child 2842 ed699545a9e7
changed:
#colorMapMenu
#processEvent:
ImageEditor.st
     1.1 --- a/ImageEditor.st	Fri Apr 01 18:12:37 2011 +0200
     1.2 +++ b/ImageEditor.st	Mon Apr 04 14:05:56 2011 +0200
     1.3 @@ -1741,6 +1741,7 @@
     1.4              label: 'Copy Color'
     1.5              itemValue: copyColorFromColormap
     1.6              translateLabel: true
     1.7 +            shortcutKey: Copy
     1.8            )
     1.9           (MenuItem
    1.10              enabled: hasColormapAndColorSelected
    1.11 @@ -1752,6 +1753,7 @@
    1.12              label: 'Paste Color'
    1.13              itemValue: pasteColorIntoColormap
    1.14              translateLabel: true
    1.15 +            shortcutKey: Paste
    1.16            )
    1.17           (MenuItem
    1.18              label: '-'
    1.19 @@ -1784,10 +1786,10 @@
    1.20              label: '-'
    1.21            )
    1.22           (MenuItem
    1.23 +            enabled: hasColorSelectedHolder
    1.24              label: 'Inspect Color'
    1.25              itemValue: inspectColor
    1.26              translateLabel: true
    1.27 -            enabled: hasColorSelectedHolder
    1.28            )
    1.29           (MenuItem
    1.30              enabled: hasColormapHolder
    1.31 @@ -1799,8 +1801,6 @@
    1.32          nil
    1.33          nil
    1.34        )
    1.35 -
    1.36 -    "Modified: / 04-07-2010 / 10:13:57 / cg"
    1.37  !
    1.38  
    1.39  menu
    1.40 @@ -4018,20 +4018,39 @@
    1.41  processEvent:anEvent
    1.42      "Return true, if I have eaten the event"
    1.43  
    1.44 -    |p|
    1.45 -
    1.46 -    anEvent view == self imagePreView ifTrue:[
    1.47 -        ((anEvent isButtonPressEvent and:[ anEvent button == 1 ])
    1.48 -        or:[ anEvent isButtonMotionEvent and:[ anEvent hasButton1 ]])  ifTrue:[
    1.49 -            p := anEvent x @ anEvent y.
    1.50 -            anEvent view transformation notNil ifTrue:[
    1.51 -                p := anEvent view transformation applyInverseTo:p.
    1.52 +    |view focusView p transformation|
    1.53 +
    1.54 +    view := anEvent view.
    1.55 +    view notNil ifTrue:[
    1.56 +        view == self imagePreView ifTrue:[
    1.57 +            ((anEvent isButtonPressEvent and:[ anEvent button == 1 ])
    1.58 +            or:[ anEvent isButtonMotionEvent and:[ anEvent hasButton1 ]])  ifTrue:[
    1.59 +                p := anEvent x @ anEvent y.
    1.60 +                (transformation := view transformation) notNil ifTrue:[
    1.61 +                    p := transformation applyInverseTo:p.
    1.62 +                ].
    1.63 +                self imageEditView scrollToMakeVisible:p.    
    1.64 +                ^ true.
    1.65              ].
    1.66 -            self imageEditView scrollToMakeVisible:p.    
    1.67 -            ^ true.
    1.68 +        ].
    1.69 +
    1.70 +        anEvent isKeyPressEvent ifTrue:[
    1.71 +            focusView := view windowGroup focusView ? view.
    1.72 +            (focusView isComponentOf:(builder componentAt:#colorDataSetView)) ifTrue:[
    1.73 +                anEvent key == #Paste ifTrue:[
    1.74 +                    self pasteColorIntoColormap.
    1.75 +                    ^ true.
    1.76 +                ].
    1.77 +                anEvent key == #Copy ifTrue:[
    1.78 +                    self copyColorFromColormap.
    1.79 +                    ^ true.
    1.80 +                ].
    1.81 +            ].
    1.82          ].
    1.83      ].
    1.84      ^ false.
    1.85 +
    1.86 +    "Modified: / 04-04-2011 / 13:50:09 / cg"
    1.87  ! !
    1.88  
    1.89  !ImageEditor methodsFor:'help'!