#FEATURE by cg draft
authorClaus Gittinger <cg@exept.de>
Thu, 16 Feb 2017 01:46:35 +0100
changeset 3404 cd90f4aece50
parent 3403 5725611d7f35
child 3405 02c67d9a5e65
#FEATURE by cg class: ImageEditor added: #canDrawCirclesHolder #canDrawPointsHolder #canDrawRectsHolder #canFillRectsHolder #canFloodFillHolder #canSprayHolder changed: #cropDialogSpec #doCropManual #toolsMenuToolbar #windowSpec
ImageEditor.st
--- a/ImageEditor.st	Mon Feb 13 20:46:11 2017 +0100
+++ b/ImageEditor.st	Thu Feb 16 01:46:35 2017 +0100
@@ -1607,7 +1607,7 @@
          label: 'Crop Border(s)'
          name: 'Crop Border(s)'
          min: (Point 10 10)
-         bounds: (Rectangle 0 0 332 224)
+         bounds: (Rectangle 0 0 343 225)
        )
        component: 
       (SpecCollection
@@ -1618,11 +1618,11 @@
              layout: (LayoutFrame 14 0 24 0 90 0 46 0)
              activeHelpKey: gropLeft
              translateLabel: true
-             adjust: right
+             adjust: left
            )
           (InputFieldSpec
              name: 'GropLeftEntryField'
-             layout: (LayoutFrame 95 0 24 0 132 0 46 0)
+             layout: (LayoutFrame 95 0 24 0 125 0 46 0)
              activeHelpKey: gropLeft
              tabable: true
              model: gropLeftAmount
@@ -1633,7 +1633,7 @@
           (ActionButtonSpec
              label: 'Now'
              name: 'GropLeftNowButton'
-             layout: (LayoutFrame 148 0 21 0 202 0 50 0)
+             layout: (LayoutFrame 133 0 21 0 187 0 50 0)
              activeHelpKey: gropLeft
              translateLabel: true
              resizeForLabel: true
@@ -1648,11 +1648,11 @@
              layout: (LayoutFrame 14 0 55 0 90 0 77 0)
              activeHelpKey: gropRight
              translateLabel: true
-             adjust: right
+             adjust: left
            )
           (InputFieldSpec
              name: 'GropRightEntryField'
-             layout: (LayoutFrame 95 0 55 0 132 0 77 0)
+             layout: (LayoutFrame 95 0 55 0 125 0 77 0)
              activeHelpKey: gropRight
              tabable: true
              model: gropRightAmount
@@ -1663,7 +1663,7 @@
           (ActionButtonSpec
              label: 'Now'
              name: 'GropRightButton'
-             layout: (LayoutFrame 148 0 51 0 202 0 80 0)
+             layout: (LayoutFrame 133 0 51 0 187 0 80 0)
              activeHelpKey: gropRight
              translateLabel: true
              resizeForLabel: true
@@ -1678,11 +1678,11 @@
              layout: (LayoutFrame 14 0 85 0 90 0 107 0)
              activeHelpKey: gropTop
              translateLabel: true
-             adjust: right
+             adjust: left
            )
           (InputFieldSpec
              name: 'GropTopEntryField'
-             layout: (LayoutFrame 95 0 85 0 132 0 107 0)
+             layout: (LayoutFrame 95 0 85 0 125 0 107 0)
              activeHelpKey: gropTop
              tabable: true
              model: gropTopAmount
@@ -1693,7 +1693,7 @@
           (ActionButtonSpec
              label: 'Now'
              name: 'GropTopButton'
-             layout: (LayoutFrame 148 0 81 0 202 0 110 0)
+             layout: (LayoutFrame 133 0 81 0 187 0 110 0)
              activeHelpKey: gropTop
              translateLabel: true
              resizeForLabel: true
@@ -1708,11 +1708,11 @@
              layout: (LayoutFrame 14 0 115 0 90 0 137 0)
              activeHelpKey: gropBottom
              translateLabel: true
-             adjust: right
+             adjust: left
            )
           (InputFieldSpec
              name: 'GropBottomEntryField'
-             layout: (LayoutFrame 95 0 115 0 132 0 137 0)
+             layout: (LayoutFrame 95 0 115 0 125 0 137 0)
              activeHelpKey: gropBottom
              tabable: true
              model: gropBottomAmount
@@ -1723,7 +1723,7 @@
           (ActionButtonSpec
              label: 'Now'
              name: 'GropBottomButton'
-             layout: (LayoutFrame 148 0 111 0 202 0 140 0)
+             layout: (LayoutFrame 133 0 111 0 187 0 140 0)
              activeHelpKey: gropBottom
              translateLabel: true
              resizeForLabel: true
@@ -1752,7 +1752,7 @@
                    resizeForLabel: true
                    tabable: true
                    model: cancel
-                   extent: (Point 100 28)
+                   extent: (Point 103 28)
                  )
                 (ActionButtonSpec
                    label: 'Apply'
@@ -1761,7 +1761,7 @@
                    resizeForLabel: true
                    tabable: true
                    model: applyAction
-                   extent: (Point 100 28)
+                   extent: (Point 104 28)
                  )
                 (ActionButtonSpec
                    label: 'OK'
@@ -1771,7 +1771,7 @@
                    resizeForLabel: true
                    tabable: true
                    model: accept
-                   extent: (Point 100 28)
+                   extent: (Point 104 28)
                  )
                 )
               
@@ -1782,8 +1782,6 @@
         
        )
      )
-
-    "Modified: / 13-02-2017 / 14:52:25 / cg"
 !
 
 dialogSpecForNewImage
@@ -2184,7 +2182,7 @@
                         (SpecCollection
                            collection: (
                             (ViewSpec
-                               name: 'ColorBox'
+                               name: 'ColorAnCropBox'
                                component: 
                               (SpecCollection
                                  collection: (
@@ -3764,7 +3762,7 @@
         (
          (MenuItem
             activeHelpKey: drawModePoint
-            enabled: imageIsLoadedAndNotReadonlyHolder
+            enabled: canDrawPointsHolder
             label: 'Point'
             translateLabel: true
             isButton: true
@@ -3774,7 +3772,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeSpray
-            enabled: imageIsLoadedAndNotReadonlyHolder
+            enabled: canSprayHolder
             label: 'Spray'
             translateLabel: true
             isButton: true
@@ -3784,7 +3782,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeBox
-            enabled: imageIsLoadedAndNotReadonlyHolder
+            enabled: canDrawRectsHolder
             label: 'Rect'
             translateLabel: true
             isButton: true
@@ -3794,7 +3792,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeFilledBox
-            enabled: imageIsLoadedAndNotReadonlyHolder
+            enabled: canFillRectsHolder
             label: 'FillRect'
             translateLabel: true
             isButton: true
@@ -3804,7 +3802,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeCircle
-            enabled: imageIsLoadedAndNotReadonlyHolder
+            enabled: canDrawCirclesHolder
             label: 'Circle'
             translateLabel: true
             isButton: true
@@ -3814,7 +3812,7 @@
           )
          (MenuItem
             activeHelpKey: drawModeFill
-            enabled: imageIsLoadedAndNotReadonlyHolder
+            enabled: canFloodFillHolder
             label: 'Fill'
             translateLabel: true
             isButton: true
@@ -3876,6 +3874,8 @@
         nil
         nil
       )
+
+    "Modified: / 16-02-2017 / 01:45:04 / cg"
 ! !
 
 !ImageEditor class methodsFor:'tableColumns specs'!
@@ -4978,6 +4978,44 @@
     "Modified: / 16.3.1999 / 21:45:07 / cg"
 ! !
 
+!ImageEditor methodsFor:'menu aspects'!
+
+canDrawCirclesHolder
+    ^ self imageIsLoadedAndNotReadonlyHolder
+
+    "Created: / 16-02-2017 / 01:41:31 / cg"
+!
+
+canDrawPointsHolder
+    ^ self imageIsLoadedAndNotReadonlyHolder
+
+    "Created: / 16-02-2017 / 01:39:37 / cg"
+!
+
+canDrawRectsHolder
+    ^ self imageIsLoadedAndNotReadonlyHolder
+
+    "Created: / 16-02-2017 / 01:40:17 / cg"
+!
+
+canFillRectsHolder
+    ^ self imageIsLoadedAndNotReadonlyHolder
+
+    "Created: / 16-02-2017 / 01:40:21 / cg"
+!
+
+canFloodFillHolder
+    ^ self imageIsLoadedAndNotReadonlyHolder
+
+    "Created: / 16-02-2017 / 01:41:33 / cg"
+!
+
+canSprayHolder
+    ^ self imageIsLoadedAndNotReadonlyHolder
+
+    "Created: / 16-02-2017 / 01:44:47 / cg"
+! !
+
 !ImageEditor methodsFor:'menu item visibility'!
 
 isNotStandAloneAndMethodSaveAndLoadMenuItemsVisible
@@ -6847,7 +6885,7 @@
     bindings := IdentityDictionary new.
     bindings at:#gropLeftAmount put:(left := 1 asValue).
     bindings at:#gropRightAmount put:(right := 1 asValue).
-    bindings at:#gropTop put:(top := 1 asValue).
+    bindings at:#gropTopAmount put:(top := 1 asValue).
     bindings at:#gropBottomAmount put:(bottom := 1 asValue).
     bindings at:#acceptChannel put:acceptChannel.
 
@@ -6867,7 +6905,7 @@
     ].
 
     "Created: / 07-09-1998 / 18:16:07 / cg"
-    "Modified: / 13-02-2017 / 14:51:10 / cg"
+    "Modified: / 16-02-2017 / 01:33:36 / cg"
 !
 
 doCropRight