#FEATURE by cg draft
authorClaus Gittinger <cg@exept.de>
Fri, 20 Jan 2017 18:54:52 +0100
changeset 3377 6177e2e703fb
parent 3376 c508738114fa
child 3378 7225434f9d46
#FEATURE by cg class: ImageEditor readOnly handling (for subclasses) added: #imageIsLoadedAndNotReadonlyHolder #readOnly changed: #toolsMenuToolbar #windowSpec
ImageEditor.st
--- a/ImageEditor.st	Fri Jan 20 18:16:35 2017 +0100
+++ b/ImageEditor.st	Fri Jan 20 18:54:52 2017 +0100
@@ -2313,7 +2313,7 @@
                 )
               
              )
-             handles: (Any 0.28888900000000006 1.0)
+             handles: (Any 0.28999999999999998 1.0)
            )
           (UISubSpecification
              name: 'infoBarSubSpec'
@@ -3739,7 +3739,7 @@
         (
          (MenuItem
             activeHelpKey: drawModePoint
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Point'
             translateLabel: true
             isButton: true
@@ -3749,7 +3749,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeSpray
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Spray'
             translateLabel: true
             isButton: true
@@ -3759,7 +3759,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeBox
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Rect'
             translateLabel: true
             isButton: true
@@ -3769,7 +3769,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeFilledBox
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'FillRect'
             translateLabel: true
             isButton: true
@@ -3779,7 +3779,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeCircle
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Circle'
             translateLabel: true
             isButton: true
@@ -3789,7 +3789,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeFill
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Fill'
             translateLabel: true
             isButton: true
@@ -3809,7 +3809,7 @@
           )
          (MenuItem
             activeHelpKey: drawModePasteWithMask
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Paste With Mask'
             translateLabel: true
             isButton: true
@@ -3819,7 +3819,7 @@
           )
          (MenuItem
             activeHelpKey: drawModePaste
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Paste'
             translateLabel: true
             isButton: true
@@ -3829,7 +3829,7 @@
           )
          (MenuItem
             activeHelpKey: drawModePasteUnder
-            enabled: imageIsLoadedHolder
+            enabled: imageIsLoadedAndNotReadonlyHolder
             label: 'Paste Under'
             translateLabel: true
             isButton: true
@@ -4155,6 +4155,17 @@
     "Modified: / 04-07-2010 / 10:15:48 / cg"
 !
 
+imageIsLoadedAndNotReadonlyHolder
+    "returns whether an image is loaded and editable as value holder"
+
+    ^ [ 
+        self imageIsLoadedHolder value
+        and:[ self readOnly not  ] 
+      ]
+
+    "Modified: / 04-07-2010 / 10:15:43 / cg"
+!
+
 imageIsLoadedHolder
     "returns whether an image is loaded as value holder"
 
@@ -4215,6 +4226,10 @@
     "Created: / 04-07-2010 / 10:19:34 / cg"
 !
 
+readOnly
+    ^ false
+!
+
 selectedColors
     "returns a valueHolder for the current set of selected colors."