help spec.
authorClaus Gittinger <cg@exept.de>
Thu, 30 Jul 1998 11:20:11 +0200
changeset 929 7be532d91b87
parent 928 89bd2304da33
child 930 4cf126b710b3
help spec. added grab-from-screen (not yet complete)
ImageEditor.st
--- a/ImageEditor.st	Wed Jul 29 19:36:07 1998 +0200
+++ b/ImageEditor.st	Thu Jul 30 11:20:11 1998 +0200
@@ -11,10 +11,10 @@
 "
 
 ToolApplicationModel subclass:#ImageEditor
-        instanceVariableNames:'imageEditView colorMapMode selectedColorIndex postOpenAction'
-        classVariableNames:''
-        poolDictionaries:''
-        category:'Interface-UIPainter'
+	instanceVariableNames:'imageEditView colorMapMode selectedColorIndex postOpenAction'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-UIPainter'
 !
 
 !ImageEditor class methodsFor:'documentation'!
@@ -181,7 +181,34 @@
     ^super helpSpec addPairsFrom:#(
 
 #colorMap
-'Increases or reduces size of color map of the image.'
+'ColorMap functions.'
+
+#colorMap1
+'Convert to depth-1 image.'
+
+#colorMap2
+'Convert to depth-2 image.'
+
+#colorMap4
+'Convert to depth-4 image.'
+
+#colorMap8
+'Convert to depth-8 image.'
+
+#colorMap1M
+'Convert to depth-1 image plus mask.'
+
+#colorMap2M
+'Convert to depth-2 image plus mask.'
+
+#colorMap4M
+'Convert to depth-4 image plus mask.'
+
+#colorMap8M
+'Convert to depth-8 image plus mask.'
+
+#compressColormap
+'Remove unneeded entries from the colorMap.'
 
 #colorMapTable
 'Shows a list of used colors of the image.'
@@ -225,11 +252,14 @@
 #editRotate
 'Rotate the image.'
 
+#fileGrabImage
+'Pick an image from the screen.'
+
 #fileLoadFromClass
-'Selecting and load an image from a resource method.'
+'Select and load an image from a resource method.'
 
 #fileLoadFromFile
-'Selecting and load an image from a file.'
+'Select and load an image from a file.'
 
 #fileNewImage
 'Create a new image'
@@ -272,7 +302,7 @@
 
 )
 
-    "Modified: / 29.7.1998 / 18:42:52 / cg"
+    "Modified: / 29.7.1998 / 22:27:36 / cg"
 ! !
 
 !ImageEditor class methodsFor:'image specs'!
@@ -670,6 +700,12 @@
                           #activeHelpKey: #fileLoadFromFile
                       )
                        #(#MenuItem
+                          #label: 'Grab From Screen'
+                          #translateLabel: true
+                          #value: #grabScreenImage
+                          #activeHelpKey: #fileGrabImage
+                      )
+                       #(#MenuItem
                           #label: '-'
                       )
                        #(#MenuItem
@@ -804,28 +840,28 @@
                        #(#MenuItem
                           #label: '8-Plane'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap8
                           #argument: '8-plane'
                           #indication: #colorMapMode:value:
                       )
                        #(#MenuItem
                           #label: '4-Plane'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap4
                           #argument: '4-plane'
                           #indication: #colorMapMode:value:
                       )
                        #(#MenuItem
                           #label: '2-Plane'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap2
                           #argument: '2-plane'
                           #indication: #colorMapMode:value:
                       )
                        #(#MenuItem
                           #label: '1-Plane'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap1
                           #argument: '1-plane'
                           #indication: #colorMapMode:value:
                       )
@@ -835,28 +871,28 @@
                        #(#MenuItem
                           #label: '8-Plane + Mask'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap8M
                           #argument: '8-plane + mask'
                           #indication: #colorMapMode:value:
                       )
                        #(#MenuItem
                           #label: '4-Plane + Mask'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap4M
                           #argument: '4-plane + mask'
                           #indication: #colorMapMode:value:
                       )
                        #(#MenuItem
                           #label: '2-Plane + Mask'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap2M
                           #argument: '2-plane + mask'
                           #indication: #colorMapMode:value:
                       )
                        #(#MenuItem
                           #label: '1-Plane + Mask'
                           #translateLabel: true
-                          #activeHelpKey: #colorMap
+                          #activeHelpKey: #colorMap1M
                           #argument: '1-plane + mask'
                           #indication: #colorMapMode:value:
                       )
@@ -866,6 +902,7 @@
                        #(#MenuItem
                           #label: 'Compress colormap'
                           #translateLabel: true
+                          #activeHelpKey: #compressColormap
                           #value: #compressColorMap
                       )
                     ) nil
@@ -914,7 +951,7 @@
           nil
       )
 
-    "Modified: / 28.7.1998 / 20:03:52 / cg"
+    "Modified: / 29.7.1998 / 22:26:55 / cg"
 !
 
 menuMouseButtonColors
@@ -1901,6 +1938,27 @@
             self updateLabelsAndHistory
         ]
     ]
+!
+
+grabScreenImage
+    "let user choose an area and grab that are for editing"
+
+    |image img|
+
+    image := Image fromUser.
+
+    image depth > 8 ifTrue:[
+        image := Depth8Image fromImage:image.
+    ].
+    (imageEditView image: image) notNil
+    ifTrue:
+    [
+        self listOfColors contents:(image colorMap).
+        self findColorMapMode.
+        self updateLabelsAndHistory
+    ]
+
+    "Created: / 29.7.1998 / 21:24:42 / cg"
 ! !
 
 !ImageEditor methodsFor:'user actions - saving'!