code cleanup
authorClaus Gittinger <cg@exept.de>
Tue, 13 Jul 1999 17:37:41 +0200
changeset 1188 4805027d9d33
parent 1187 e413149dabe6
child 1189 0e7e286f864c
code cleanup
UIPainter.st
--- a/UIPainter.st	Tue Jul 13 17:36:27 1999 +0200
+++ b/UIPainter.st	Tue Jul 13 17:37:41 1999 +0200
@@ -2149,8 +2149,8 @@
      widget has changed"
 
     self isModified ifFalse:[
-	self layoutTool update.
-	self modifiedChannel value:false
+        self layoutTool update.
+        self clearModifiedFlag
     ]
 !
 
@@ -2161,15 +2161,15 @@
     |property spec|
 
     (property := treeView propertySelected) notNil ifTrue:[
-	spec := property spec copy.
-	self specTool specification:spec.
-	self setViewInLayoutTool:(property view) spec:spec.
-	self modifiedChannel value:false
+        spec := property spec copy.
+        self specTool specification:spec.
+        self setViewInLayoutTool:(property view) spec:spec.
+        self clearModifiedFlag
     ] ifFalse:[
-	self layoutTool layoutView notNil ifTrue:[
-	    self modifiedChannel value:false.
-	    self treeSelection
-	]
+        self layoutTool layoutView notNil ifTrue:[
+            self clearModifiedFlag.
+            self treeSelection
+        ]
     ]
 !
 
@@ -2503,11 +2503,11 @@
     "sets the specClass and updates the Help Tool"
 
     specClass := aClass isBehavior ifTrue:[aClass name]
-				   ifFalse:[aClass].
+                                   ifFalse:[aClass].
 
     self helpTool buildFromClass:specClass.    
     self helpTool updateList.
-    self modifiedChannel value: false. 
+    self clearModifiedFlag. 
 
 ! !
 
@@ -2630,64 +2630,64 @@
     |view list spec slices size property tabComponent|
 
     self isModified ifTrue:[
-	(self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[
-	    self accept
-	]
+        (self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[
+            self accept
+        ]
     ].
 
     treeView isCanvasSelected ifTrue:[
-	spec := treeView canvasSpec.
-	view := self painter topView.
+        spec := treeView canvasSpec.
+        view := self painter topView.
     ] ifFalse:[
-	(property := treeView propertySelected) notNil ifTrue:[
-	    treeView canResizeSelectedWidget ifTrue:[
-		view := property view.
-	    ].
-	    spec := property spec copy.
-	]
+        (property := treeView propertySelected) notNil ifTrue:[
+            treeView canResizeSelectedWidget ifTrue:[
+                view := property view.
+            ].
+            spec := property spec copy.
+        ]
     ].
     tabComponent := builder componentAt:#noteBook.
     self setViewInLayoutTool:view spec:spec.
     self specTool specification:spec.
 
     spec notNil ifTrue:[
-	self helpTool helpKey:(spec activeHelpKey).
-	slices := spec class slices.
-	size   := slices size.
-
-	view notNil ifTrue:[
-	    self treeView isCanvasSelected 
-	    ifFalse:
-	    [
-		list := Array new:(size + 2).
-		list at:(size + 2) put:(UILayoutTool label).
-	    ]
-	    ifTrue:
-	    [
-		list := Array new:(size + 1).
-		list at:(size + 1) put:(UILayoutTool label).
-	    ].
-	] ifFalse:[
-	    list := Array new:(size + 1).
-	].
-
-	1 to:size do:[:i| list at:i put:((slices at:i) first asString)].
-	self treeView isCanvasSelected ifFalse: [list at:(size + 1) put:(UIHelpTool label)].
-
-	self tabList value:list.
-	self showHelp:spec class name for:self.
-	tabComponent enabled:true.
-
-	(tabSelection := tabComponent selection) isNil ifTrue:[
-	    tabComponent setSelection:(tabSelection := list first)
-	].
-	self raiseTabView
+        self helpTool helpKey:(spec activeHelpKey).
+        slices := spec class slices.
+        size   := slices size.
+
+        view notNil ifTrue:[
+            self treeView isCanvasSelected 
+            ifFalse:
+            [
+                list := Array new:(size + 2).
+                list at:(size + 2) put:(UILayoutTool label).
+            ]
+            ifTrue:
+            [
+                list := Array new:(size + 1).
+                list at:(size + 1) put:(UILayoutTool label).
+            ].
+        ] ifFalse:[
+            list := Array new:(size + 1).
+        ].
+
+        1 to:size do:[:i| list at:i put:((slices at:i) first asString)].
+        self treeView isCanvasSelected ifFalse: [list at:(size + 1) put:(UIHelpTool label)].
+
+        self tabList value:list.
+        self showHelp:spec class name for:self.
+        tabComponent enabled:true.
+
+        (tabSelection := tabComponent selection) isNil ifTrue:[
+            tabComponent setSelection:(tabSelection := list first)
+        ].
+        self raiseTabView
     ] ifFalse:[
-	self helpTool helpKey:nil.
-	tabComponent enabled:false.
-	self defaultInfoLabel.
+        self helpTool helpKey:nil.
+        tabComponent enabled:false.
+        self defaultInfoLabel.
     ].
-    self modifiedChannel value:false.
+    self clearModifiedFlag.
 
     self updateChannels
 ! !
@@ -2940,44 +2940,44 @@
     |painter layout spec layoutTool layoutView t|
 
     self acceptChannel value:true; value:false.  "/ force editFields to accept
-    self modifiedChannel value:false.
+    self clearModifiedFlag.
 
     painter := self painter.
     spec := self specTool specification.
 
     self isLayoutToolSelected ifTrue:[
-	layoutTool := self layoutTool.
-
-	(layout := layoutTool layout) notNil ifTrue:[
-	    layoutTool layoutType == #Extent ifTrue:[
-		layoutView := layoutTool layoutView.
-
-		layoutView == painter topView ifTrue:[
-		    layoutView extent:layout
-		] ifFalse:[
-		    spec useDefaultExtent:(layoutTool aspectFor:#useDefaultExtent) value.
-		    spec useDefaultExtent ifTrue:[
-			"/ temporarily unfreeze the widgets size
-			"/ (but remember, the old setting, which is actually
-			"/ controlled by the resizeForLabel attribute)
-			t := layoutView sizeFixed.
-			layoutView sizeFixed:false.
-			layout := layoutView preferredExtent.    
-			layoutView sizeFixed:t.
-		    ].
-		    painter setExtent:layout.
-		    painter updateFromSpec:spec.
-		]
-	    ] ifFalse:[
-		painter setLayout:layout
-	    ]
-	]
+        layoutTool := self layoutTool.
+
+        (layout := layoutTool layout) notNil ifTrue:[
+            layoutTool layoutType == #Extent ifTrue:[
+                layoutView := layoutTool layoutView.
+
+                layoutView == painter topView ifTrue:[
+                    layoutView extent:layout
+                ] ifFalse:[
+                    spec useDefaultExtent:(layoutTool aspectFor:#useDefaultExtent) value.
+                    spec useDefaultExtent ifTrue:[
+                        "/ temporarily unfreeze the widgets size
+                        "/ (but remember, the old setting, which is actually
+                        "/ controlled by the resizeForLabel attribute)
+                        t := layoutView sizeFixed.
+                        layoutView sizeFixed:false.
+                        layout := layoutView preferredExtent.    
+                        layoutView sizeFixed:t.
+                    ].
+                    painter setExtent:layout.
+                    painter updateFromSpec:spec.
+                ]
+            ] ifFalse:[
+                painter setLayout:layout
+            ]
+        ]
     ] ifFalse:[
-	self isHelpToolSelected ifTrue:[
-	    self helpTool accept.      
-	    spec activeHelpKey:self helpTool helpKey.
-	].      
-	painter updateFromSpec:spec
+        self isHelpToolSelected ifTrue:[
+            self helpTool accept.      
+            spec activeHelpKey:self helpTool helpKey.
+        ].      
+        painter updateFromSpec:spec
     ].
 
     modified := false.
@@ -3022,25 +3022,25 @@
     |spec key view|
 
     self isModified ifTrue:[
-	(spec := self painter specForSelection) notNil ifTrue:[
-	    key := spec activeHelpKey.
-	].
-	self helpTool helpKey:key.
-
-	treeView isCanvasSelected ifTrue: [
-	    spec := treeView canvasSpec.
-	].
-	self specTool specification:spec.
-	view := self layoutTool layoutView.
-
-	self setViewInLayoutTool:view spec:spec.
-	spec class == DataSetSpec ifTrue:[
-	    view notNil ifTrue:[
-		view columnDescriptors:(spec columns)
-	    ]
-	].        
-	self modifiedChannel value:false.
-	modified := false
+        (spec := self painter specForSelection) notNil ifTrue:[
+            key := spec activeHelpKey.
+        ].
+        self helpTool helpKey:key.
+
+        treeView isCanvasSelected ifTrue: [
+            spec := treeView canvasSpec.
+        ].
+        self specTool specification:spec.
+        view := self layoutTool layoutView.
+
+        self setViewInLayoutTool:view spec:spec.
+        spec class == DataSetSpec ifTrue:[
+            view notNil ifTrue:[
+                view columnDescriptors:(spec columns)
+            ]
+        ].        
+        self clearModifiedFlag.
+        modified := false
     ]
 !
 
@@ -3078,39 +3078,39 @@
     |again tmp helpDict helpKey helpTool|
 
     [
-	again := false.
-
-	(tmp := specClass) isNil ifTrue:[tmp := 'NewApplication'].
-	aspects at:#classNameChannel put:tmp asValue.
-
-	(tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec'].
-	aspects at:#methodNameChannel put:tmp asValue.
-
-	(tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel'].
-	aspects at:#superclassNameChannel put:tmp asValue.
-
-	(self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[
-
-	    specClass    := (self aspectFor:#classNameChannel) value.
-	    specSelector := (self aspectFor:#methodNameChannel) value.
-	    specSelector notNil ifTrue:[specSelector := specSelector asSymbol].
-	    specSuperclass := (self aspectFor:#superclassNameChannel) value.
-
-	    (again := self checkClassAndSelector not) ifFalse:[
-		self painter className:specClass
-			superclassName:specSuperclass
-			      selector:specSelector.
-	    ]
-	]
-	ifFalse:
-	[
-	    ^nil
-	]
+        again := false.
+
+        (tmp := specClass) isNil ifTrue:[tmp := 'NewApplication'].
+        aspects at:#classNameChannel put:tmp asValue.
+
+        (tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec'].
+        aspects at:#methodNameChannel put:tmp asValue.
+
+        (tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel'].
+        aspects at:#superclassNameChannel put:tmp asValue.
+
+        (self openDialogInterface:#dialogSpecForDefiningClassAndSelector) ifTrue:[
+
+            specClass    := (self aspectFor:#classNameChannel) value.
+            specSelector := (self aspectFor:#methodNameChannel) value.
+            specSelector notNil ifTrue:[specSelector := specSelector asSymbol].
+            specSuperclass := (self aspectFor:#superclassNameChannel) value.
+
+            (again := self checkClassAndSelector not) ifFalse:[
+                self painter className:specClass
+                        superclassName:specSuperclass
+                              selector:specSelector.
+            ]
+        ]
+        ifFalse:
+        [
+            ^nil
+        ]
 
     ] doWhile:[again].
 
     specClass := specClass isBehavior ifTrue:[specClass name]
-				      ifFalse:[specClass].
+                                      ifFalse:[specClass].
 
     helpTool := self helpTool.
     helpDict := helpTool dictionary.
@@ -3119,7 +3119,7 @@
     helpTool dictionary declareAllFrom: helpDict.
     helpTool updateList.
     helpTool helpKey: helpKey.
-    self modifiedChannel value: false.
+    self clearModifiedFlag.
     helpTool modified: true.
 
     self updateInfoLabel