*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Mon, 22 Mar 2004 12:35:39 +0100
changeset 2680 0e335115a3eb
parent 2679 302ab06d7110
child 2681 2d928e2d12af
*** empty log message ***
ImageEditView.st
--- a/ImageEditView.st	Sat Mar 20 14:18:27 2004 +0100
+++ b/ImageEditView.st	Mon Mar 22 12:35:39 2004 +0100
@@ -1228,11 +1228,11 @@
 !
 
 performSpecialOperationOn:imageBox withColor:clr
-    |operation x0 y0 x1 y1 grey pixelAction requiredColors missingColors answer|
+    |operation x0 y0 x1 y1 pixelAction requiredColors missingColors answer|
 
     operation := Dialog 
-           choose:'Which Operation:' 
-           fromList:#(
+           choose:(resources string:'Which Operation:')
+           fromList:(resources array:#(
                        'slightly brightened'
                        'slightly darkened'
                        'brightened'
@@ -1242,7 +1242,7 @@
                        'grey pattern'
                        '-'
                        'reversed'
-                     ) 
+                     )) 
            values:#(slightlyBrightened slightlyDarkened brightened darkened nil greyed greyPattern nil reversed) 
            lines:6
            cancel:nil.
@@ -1298,10 +1298,14 @@
                     default:3.
         answer isNil ifTrue:[^ false].
         answer == #add ifTrue:[
-            self halt:'this function is not yet implemented'.
+            missingColors size + image colorMap size > (2 raisedTo:image depth) ifTrue:[
+                self warn:'Missing colors cannot be added to images colormap.'.
+                ^ false
+            ].
             missingColors do:[:eachColor |
+                image colorMap add:eachColor
             ].
-            ^ false.
+            answer := #nearest.
         ].
     ].
 
@@ -2246,7 +2250,7 @@
 !ImageEditView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.193 2004-02-16 14:24:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.194 2004-03-22 11:35:39 cg Exp $'
 ! !
 
 ImageEditView initialize!