checkin from browser
authortz
Fri, 07 Aug 1998 16:44:19 +0200
changeset 942 4b47d3d652ad
parent 941 6d75430a8120
child 943 b9ba76358fbd
checkin from browser
ImageEditor.st
--- a/ImageEditor.st	Wed Aug 05 01:28:08 1998 +0200
+++ b/ImageEditor.st	Fri Aug 07 16:44:19 1998 +0200
@@ -461,11 +461,11 @@
           #window: 
            #(#WindowSpec
               #name: 'Image Editor'
-              #layout: #(#LayoutFrame 216 0 173 0 715 0 518 0)
+              #layout: #(#LayoutFrame 362 0 221 0 861 0 566 0)
               #label: 'Image Editor'
               #min: #(#Point 400 320)
               #max: #(#Point 1152 900)
-              #bounds: #(#Rectangle 216 173 716 519)
+              #bounds: #(#Rectangle 362 221 862 567)
               #menu: #menu
               #usePreferredExtent: false
           )
@@ -534,19 +534,31 @@
                                                                #(#DataSetColumnSpec
                                                                   #label: 'R'
                                                                   #labelAlignment: #left
+                                                                  #columnAlignment: #right
+                                                                  #editorType: #InputField
+                                                                  #type: #number
                                                                   #model: #redFromColor:
+                                                                  #writeSelector: #redAtColor:put:
                                                                   #canSelect: false
                                                               )
                                                                #(#DataSetColumnSpec
                                                                   #label: 'G'
                                                                   #labelAlignment: #left
+                                                                  #columnAlignment: #right
+                                                                  #editorType: #InputField
+                                                                  #type: #number
                                                                   #model: #greenFromColor:
+                                                                  #writeSelector: #greenAtColor:put:
                                                                   #canSelect: false
                                                               )
                                                                #(#DataSetColumnSpec
                                                                   #label: 'B'
                                                                   #labelAlignment: #left
+                                                                  #columnAlignment: #right
+                                                                  #editorType: #InputField
+                                                                  #type: #number
                                                                   #model: #blueFromColor:
+                                                                  #writeSelector: #blueAtColor:put:
                                                                   #canSelect: false
                                                               )
                                                             )
@@ -642,8 +654,6 @@
               )
           )
       )
-
-    "Modified: / 29.7.1998 / 18:31:38 / cg"
 ! !
 
 !ImageEditor class methodsFor:'menu specs'!
@@ -1209,6 +1219,7 @@
     |holder|
     (holder := builder bindingAt:#listOfColors) isNil ifTrue:[
         builder aspectAt:#listOfColors put:(holder :=  List new).
+        holder addDependent:self.
     ].
     ^ holder
 !
@@ -1264,6 +1275,11 @@
     self selectionOfColor value: (self listOfColors indexOf: imageEditView selectedColor).
 !
 
+update:something with:aParameter from:changedObject
+    super update:something with:aParameter from:changedObject
+
+!
+
 updateForNoneImage
     "updates channels and view, if image is loaded"
 
@@ -1297,6 +1313,16 @@
 
 !ImageEditor methodsFor:'data access'!
 
+blueAtColor:aColor put:newBlue
+    "helper used to return a new row element, when blue is changed"
+
+    |byte|
+
+    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
+    byte := newBlue clampBetween:0 and:255.
+    ^ Color redByte:(aColor redByte) greenByte:(aColor greenByte) blueByte:byte
+!
+
 blueFromColor:aColor
     "helper used to access a color as a row in the dataSet view"
 
@@ -1307,6 +1333,16 @@
     "Modified: / 31.7.1998 / 01:11:18 / cg"
 !
 
+greenAtColor:aColor put:newGreen
+    "helper used to return a new row element, when green is changed"
+
+    |byte|
+
+    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
+    byte := newGreen clampBetween:0 and:255.
+    ^ Color redByte:(aColor redByte) greenByte:byte blueByte:(aColor blueByte)
+!
+
 greenFromColor:aColor
     "helper used to access a color as a row in the dataSet view"
 
@@ -1317,6 +1353,16 @@
     "Modified: / 31.7.1998 / 01:11:31 / cg"
 !
 
+redAtColor:aColor put:newRed
+    "helper used to return a new row element, when red is changed"
+
+    |byte|
+
+    aColor isNil ifTrue:[^ aColor].  "/ mask cannot be changed
+    byte := newRed clampBetween:0 and:255.
+    ^ Color redByte:byte greenByte:(aColor greenByte) blueByte:(aColor blueByte)
+!
+
 redFromColor:aColor
     "helper used to access a color as a row in the dataSet view"