UIPainter.st
changeset 1063 9e710dbc7c92
parent 1059 ecb59576e1e6
child 1068 dcb2cba5787f
--- a/UIPainter.st	Fri Mar 19 13:24:33 1999 +0100
+++ b/UIPainter.st	Fri Mar 19 15:12:25 1999 +0100
@@ -1865,37 +1865,37 @@
 noteBookView
     "returns the notebook view; initialize the tools embedded in the notebook"
 
-    |noteBook channel helpTool layoutTool specTool|
+    |noteBook modifiedChannel acceptChannel helpTool layoutTool specTool|
 
     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
-	noteBook   := View new.
-	layoutTool := UILayoutTool new.
-	helpTool   := UIHelpTool   new.
-	helpTool buildFromClass:specClass.
-	specTool   := UISpecificationTool new.
-	channel    := self modifiedChannel.
-
-	layoutTool masterApplication:self.
-	specTool   masterApplication:self.
-	helpTool   masterApplication:self.
-
-	layoutCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
-	helpCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
-	specCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
-
-	layoutCanvas client:layoutTool.
-	helpCanvas   client:helpTool.
-	specTool builder:(specCanvas client:specTool).
-
-	layoutTool masterApplication:self.
-	specTool   masterApplication:self.
-	helpTool   masterApplication:self.
-
-	layoutTool modifiedHolder:channel.
-	helpTool   modifiedHolder:channel.
-	specTool   modifiedHolder:channel.
-
-	builder aspectAt:#noteBookView put:noteBook.
+        noteBook   := View new.
+        layoutTool := UILayoutTool new.
+        helpTool   := UIHelpTool   new.
+        helpTool buildFromClass:specClass.
+        specTool   := UISpecificationTool new.
+        modifiedChannel    := self modifiedChannel.
+
+        layoutTool masterApplication:self.
+        specTool   masterApplication:self.
+        helpTool   masterApplication:self.
+
+        layoutCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
+        helpCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
+        specCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
+
+        layoutCanvas client:layoutTool.
+        helpCanvas   client:helpTool.
+        specTool builder:(specCanvas client:specTool).
+
+        layoutTool masterApplication:self.
+        specTool   masterApplication:self.
+        helpTool   masterApplication:self.
+
+        layoutTool modifiedHolder:modifiedChannel.
+        helpTool   modifiedHolder:modifiedChannel.
+        specTool   modifiedHolder:modifiedChannel.
+
+        builder aspectAt:#noteBookView put:noteBook.
     ].
     ^ noteBook
 !
@@ -2220,18 +2220,18 @@
     treeView notNil
     ifTrue:
     [
-	treeSelection := treeView selection.
-	"/ the top-node cannot be cut, copied or pasted.
-	canCutOrCopy := treeSelection size >= 1 and:[treeSelection first ~~ 1].
-	clipboard := self getSelection.
-
-	clipboard isCollection ifTrue:[clipboard notEmpty ifTrue:[sel := clipboard first]]
-			      ifFalse:[sel := clipboard].
-
-	canPaste := (sel isKindOf:UISpecification) and: 
-		    [treeSelection size  = 1 
-		    and:[treeSelection first == 1 
-		    or: [self canPasteInto: treeView selectedNode contents view]]]
+        treeSelection := treeView selection.
+        "/ the top-node cannot be cut, copied or pasted.
+        canCutOrCopy := treeSelection size >= 1 and:[treeSelection first ~~ 1].
+        clipboard := self getSelection.
+
+        clipboard isCollection ifTrue:[clipboard notEmpty ifTrue:[sel := clipboard first]]
+                              ifFalse:[sel := clipboard].
+
+        canPaste := (sel isKindOf:UISpecification) and: 
+                    [treeSelection size  = 1 
+                    and:[treeSelection first == 1 
+                    or: [self canPasteInto: treeView selectedNode contents view]]]
     ].
 
     self valueOfCanCut value: canCutOrCopy.
@@ -2239,6 +2239,8 @@
     self valueOfCanPaste value: canPaste.            
     self valueOfCanPasteWithKeepingLayout value: (canPaste "&  self canKeepLayoutInSelection").
 
+"/    self modifiedChannel value: false.
+
     "Modified: / 16.7.1998 / 19:13:30 / cg"
 ! !
 
@@ -2929,33 +2931,36 @@
 
     |painter layout spec prop key layoutTool|
 
+    self acceptChannel value:true.      "/ force editFields to accept
+    self acceptChannel value:false.
+
     self modifiedChannel value:false.
     modified := true.
 
     painter := self painter.
 
     self isLayoutToolSelected ifTrue:[
-	layoutTool := self layoutTool.
-
-	(layout := layoutTool layout) notNil ifTrue:[
-	    layoutTool layoutType == #Extent ifTrue:[
-		layoutTool layoutView == painter topView ifTrue:[
-		    layoutTool layoutView extent:layout
-		] ifFalse:[
-		    painter setExtent:layout
-		]
-	    ] ifFalse:[
-		painter setLayout:layout
-	    ]
-	]
+        layoutTool := self layoutTool.
+
+        (layout := layoutTool layout) notNil ifTrue:[
+            layoutTool layoutType == #Extent ifTrue:[
+                layoutTool layoutView == painter topView ifTrue:[
+                    layoutTool layoutView extent:layout
+                ] ifFalse:[
+                    painter setExtent:layout
+                ]
+            ] ifFalse:[
+                painter setLayout:layout
+            ]
+        ]
     ] ifFalse:[
-	spec := self specTool specification.
-
-	self isHelpToolSelected ifTrue:[
-	    self helpTool accept.      
-	    spec activeHelpKey:self helpTool helpKey.
-	].      
-	painter updateFromSpec:spec
+        spec := self specTool specification.
+
+        self isHelpToolSelected ifTrue:[
+            self helpTool accept.      
+            spec activeHelpKey:self helpTool helpKey.
+        ].      
+        painter updateFromSpec:spec
     ]