#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Fri, 20 Jan 2017 18:16:35 +0100
changeset 3376 c508738114fa
parent 3375 d2a64b772792
child 3377 6177e2e703fb
#UI_ENHANCEMENT by cg class: ImageEditor comment/format in: #imageEditView #openLoadingImageWith:modal: changed: #cropDialogSpec #helpSpec tooltips
ImageEditor.st
--- a/ImageEditor.st	Fri Jan 20 17:00:03 2017 +0100
+++ b/ImageEditor.st	Fri Jan 20 18:16:35 2017 +0100
@@ -62,7 +62,8 @@
 !ImageEditor class methodsFor:'instance creation'!
 
 openLoadingImageWith:aBlock modal:modalBoolean
-    "opens an Image Editor on anImage"
+    "opens an Image Editor on anImage.
+     returns the editor (to access its attributes)"
 
     |editor|
 
@@ -445,6 +446,18 @@
 #fileSaveMethodAs
 'Save the image as resource method in a class'
 
+#gropBottom
+'Cut off the specified number of pixels at the bottom'
+
+#gropLeft
+'Cut off the specified number of pixels at the left'
+
+#gropRight
+'Cut off the specified number of pixels at the right'
+
+#gropTop
+'Cut off the specified number of pixels at the top'
+
 #magnificationNumber
 'Shows the current magnification'
 
@@ -1587,161 +1600,185 @@
     <resource: #canvas>
 
     ^ 
-     #(FullSpec
-        name: cropDialogSpec
-        window: 
-       (WindowSpec
-          label: 'Crop Border(s)'
-          name: 'Crop Border(s)'
-          min: (Point 10 10)
-          bounds: (Rectangle 14 46 259 229)
-        )
-        component: 
-       (SpecCollection
-          collection: (
-           (LabelSpec
-              label: 'Left:'
-              name: 'GropLeftLabel'
-              layout: (LayoutFrame 14 0 21 0 90 0 43 0)
-              translateLabel: true
-              adjust: right
-            )
-           (InputFieldSpec
-              name: 'GropLeftEntryField'
-              layout: (LayoutFrame 95 0 21 0 132 0 43 0)
-              tabable: true
-              model: left
-              type: number
-              acceptChannel: acceptChannel
-              acceptOnPointerLeave: false
-            )
-           (ActionButtonSpec
-              label: 'Now'
-              name: 'GropLeftNowButton'
-              layout: (LayoutFrame 148 0 21 0 221 0 43 0)
-              translateLabel: true
-              tabable: true
-              model: gropLeftNow
-              autoRepeat: true
-            )
-           (LabelSpec
-              label: 'Right:'
-              name: 'GropRightLabel'
-              layout: (LayoutFrame 14 0 51 0 90 0 73 0)
-              translateLabel: true
-              adjust: right
-            )
-           (InputFieldSpec
-              name: 'GropRightEntryField'
-              layout: (LayoutFrame 95 0 51 0 132 0 73 0)
-              tabable: true
-              model: right
-              type: number
-              acceptChannel: acceptChannel
-              acceptOnPointerLeave: false
-            )
-           (ActionButtonSpec
-              label: 'Now'
-              name: 'GropRightButton'
-              layout: (LayoutFrame 148 0 51 0 221 0 73 0)
-              translateLabel: true
-              tabable: true
-              model: gropRightNow
-              autoRepeat: true
-            )
-           (LabelSpec
-              label: 'Top:'
-              name: 'GropTopLabel'
-              layout: (LayoutFrame 14 0 81 0 90 0 103 0)
-              translateLabel: true
-              adjust: right
-            )
-           (InputFieldSpec
-              name: 'GropTopEntryField'
-              layout: (LayoutFrame 95 0 81 0 132 0 103 0)
-              tabable: true
-              model: top
-              type: number
-              acceptChannel: acceptChannel
-              acceptOnPointerLeave: false
-            )
-           (ActionButtonSpec
-              label: 'Now'
-              name: 'GropTopButton'
-              layout: (LayoutFrame 148 0 81 0 221 0 103 0)
-              translateLabel: true
-              tabable: true
-              model: gropTopNow
-              autoRepeat: true
-            )
-           (LabelSpec
-              label: 'Bottom:'
-              name: 'GropBottomLabel'
-              layout: (LayoutFrame 14 0 111 0 90 0 133 0)
-              translateLabel: true
-              adjust: right
-            )
-           (InputFieldSpec
-              name: 'GropBottomEntryField'
-              layout: (LayoutFrame 95 0 111 0 132 0 133 0)
-              tabable: true
-              model: bottom
-              type: number
-              acceptChannel: acceptChannel
-              acceptOnPointerLeave: false
-            )
-           (ActionButtonSpec
-              label: 'Now'
-              name: 'GropBottomButton'
-              layout: (LayoutFrame 148 0 111 0 221 0 133 0)
-              translateLabel: true
-              tabable: true
-              model: gropBottomNow
-              autoRepeat: true
-            )
-           (HorizontalPanelViewSpec
-              name: 'HorizontalPanel1'
-              layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1)
-              horizontalLayout: fitSpace
-              verticalLayout: center
-              horizontalSpace: 3
-              verticalSpace: 3
-              reverseOrderIfOKAtLeft: true
-              component: 
-             (SpecCollection
-                collection: (
-                 (ActionButtonSpec
-                    label: 'Cancel'
-                    name: 'Button1'
-                    translateLabel: true
-                    tabable: true
-                    model: cancel
-                    extent: (Point 77 22)
-                  )
-                 (ActionButtonSpec
-                    label: 'Apply'
-                    name: 'Button3'
-                    translateLabel: true
-                    tabable: true
-                    model: applyAction
-                    extent: (Point 78 22)
-                  )
-                 (ActionButtonSpec
-                    label: 'OK'
-                    name: 'Button2'
-                    translateLabel: true
-                    tabable: true
-                    model: accept
-                    extent: (Point 78 22)
-                  )
+    #(FullSpec
+       name: cropDialogSpec
+       window: 
+      (WindowSpec
+         label: 'Crop Border(s)'
+         name: 'Crop Border(s)'
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 290 199)
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (LabelSpec
+             label: 'Left:'
+             name: 'GropLeftLabel'
+             layout: (LayoutFrame 14 0 24 0 90 0 46 0)
+             activeHelpKey: gropLeft
+             translateLabel: true
+             adjust: right
+           )
+          (InputFieldSpec
+             name: 'GropLeftEntryField'
+             layout: (LayoutFrame 95 0 24 0 132 0 46 0)
+             activeHelpKey: gropLeft
+             tabable: true
+             model: left
+             type: number
+             acceptChannel: acceptChannel
+             acceptOnPointerLeave: false
+           )
+          (ActionButtonSpec
+             label: 'Now'
+             name: 'GropLeftNowButton'
+             layout: (LayoutFrame 148 0 21 0 221 0 50 0)
+             activeHelpKey: gropLeft
+             translateLabel: true
+             resizeForLabel: true
+             tabable: true
+             model: gropLeftNow
+             autoRepeat: true
+             usePreferredWidth: true
+           )
+          (LabelSpec
+             label: 'Right:'
+             name: 'GropRightLabel'
+             layout: (LayoutFrame 14 0 55 0 90 0 77 0)
+             activeHelpKey: gropRight
+             translateLabel: true
+             adjust: right
+           )
+          (InputFieldSpec
+             name: 'GropRightEntryField'
+             layout: (LayoutFrame 95 0 55 0 132 0 77 0)
+             activeHelpKey: gropRight
+             tabable: true
+             model: right
+             type: number
+             acceptChannel: acceptChannel
+             acceptOnPointerLeave: false
+           )
+          (ActionButtonSpec
+             label: 'Now'
+             name: 'GropRightButton'
+             layout: (LayoutFrame 148 0 51 0 221 0 80 0)
+             activeHelpKey: gropRight
+             translateLabel: true
+             resizeForLabel: true
+             tabable: true
+             model: gropRightNow
+             autoRepeat: true
+             usePreferredWidth: true
+           )
+          (LabelSpec
+             label: 'Top:'
+             name: 'GropTopLabel'
+             layout: (LayoutFrame 14 0 85 0 90 0 107 0)
+             activeHelpKey: gropTop
+             translateLabel: true
+             adjust: right
+           )
+          (InputFieldSpec
+             name: 'GropTopEntryField'
+             layout: (LayoutFrame 95 0 85 0 132 0 107 0)
+             activeHelpKey: gropTop
+             tabable: true
+             model: top
+             type: number
+             acceptChannel: acceptChannel
+             acceptOnPointerLeave: false
+           )
+          (ActionButtonSpec
+             label: 'Now'
+             name: 'GropTopButton'
+             layout: (LayoutFrame 148 0 81 0 221 0 110 0)
+             activeHelpKey: gropTop
+             translateLabel: true
+             resizeForLabel: true
+             tabable: true
+             model: gropTopNow
+             autoRepeat: true
+             usePreferredWidth: true
+           )
+          (LabelSpec
+             label: 'Bottom:'
+             name: 'GropBottomLabel'
+             layout: (LayoutFrame 14 0 115 0 90 0 137 0)
+             activeHelpKey: gropBottom
+             translateLabel: true
+             adjust: right
+           )
+          (InputFieldSpec
+             name: 'GropBottomEntryField'
+             layout: (LayoutFrame 95 0 115 0 132 0 137 0)
+             activeHelpKey: gropBottom
+             tabable: true
+             model: bottom
+             type: number
+             acceptChannel: acceptChannel
+             acceptOnPointerLeave: false
+           )
+          (ActionButtonSpec
+             label: 'Now'
+             name: 'GropBottomButton'
+             layout: (LayoutFrame 148 0 111 0 221 0 140 0)
+             activeHelpKey: gropBottom
+             translateLabel: true
+             resizeForLabel: true
+             tabable: true
+             model: gropBottomNow
+             autoRepeat: true
+             usePreferredWidth: true
+           )
+          (HorizontalPanelViewSpec
+             name: 'HorizontalPanel1'
+             layout: (LayoutFrame 0 0.0 -30 1 0 1.0 0 1)
+             horizontalLayout: fitSpace
+             verticalLayout: center
+             horizontalSpace: 3
+             verticalSpace: 3
+             reverseOrderIfOKAtLeft: true
+             component: 
+            (SpecCollection
+               collection: (
+                (ActionButtonSpec
+                   label: 'Cancel'
+                   name: 'Button1'
+                   translateLabel: true
+                   resizeForLabel: true
+                   tabable: true
+                   model: cancel
+                   extent: (Point 91 22)
                  )
-               
-              )
-            )
+                (ActionButtonSpec
+                   label: 'Apply'
+                   name: 'Button3'
+                   translateLabel: true
+                   resizeForLabel: true
+                   tabable: true
+                   model: applyAction
+                   extent: (Point 91 22)
+                 )
+                (ActionButtonSpec
+                   label: 'OK'
+                   name: 'Button2'
+                   translateLabel: true
+                   resizeForLabel: true
+                   tabable: true
+                   model: accept
+                   extent: (Point 92 22)
+                 )
+                )
+              
+             )
+             keepSpaceForOSXResizeHandleH: true
            )
-         
-        )
-      )
+          )
+        
+       )
+     )
 !
 
 dialogSpecForNewImage
@@ -3934,7 +3971,7 @@
 !
 
 imageEditView
-    "returns the view of the image"
+    "returns the editor view of the image"
 
     imageEditView isNil ifTrue:[
         imageEditView := (self componentAt: #imageEditView) scrolledView.