code beautification; reasonable methodNames;
authorClaus Gittinger <cg@exept.de>
Fri, 25 Jan 2008 19:32:34 +0100
changeset 2256 2bd9e855e6ac
parent 2255 4cca07c42e74
child 2257 badd429a2a2a
code beautification; reasonable methodNames; fixed (I hope) replace widget code
UIPainter.st
--- a/UIPainter.st	Fri Jan 25 19:31:38 2008 +0100
+++ b/UIPainter.st	Fri Jan 25 19:32:34 2008 +0100
@@ -20,7 +20,7 @@
 !
 
 SelectionInTreeView subclass:#TreeView
-	instanceVariableNames:'lastDrawnMaster cvsEventsDisabled windowSpec windowSpecClass'
+	instanceVariableNames:'lastDrawnMaster canvasEventsDisabled windowSpec windowSpecClass'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:UIPainter
@@ -4848,7 +4848,7 @@
 !
 
 replaceWidgetByClass:aSpecOrWidgetClass
-    |specClass oldSpec newSpec sel painter|
+    |specClass oldSpec newSpec painter|
 
     (aSpecOrWidgetClass isSubclassOf:UISpecification) ifTrue:[
         specClass := aSpecOrWidgetClass.
@@ -4870,9 +4870,7 @@
     newSpec := specClass cloneFrom:oldSpec.
 
     painter := self painter.
-    painter deleteSelectionBuffered:false.
-    sel := painter pasteSpecifications:(Array with:newSpec) keepLayout:false.
-    painter select:sel.
+    painter replaceSelectionBy:newSpec.
 !
 
 useSketch
@@ -5155,7 +5153,7 @@
 
 !UIPainter::TreeView methodsFor:'canvas selection'!
 
-cvsSelection:aSelection
+canvasSelection:aSelection
     "canvas changed its selection
     "
     |sel list size|
@@ -5175,14 +5173,10 @@
         ].
         sel := list collect:[:anItem| self indexOfNode:anItem ].
     ].
-    self cvsEventsDisabledDo:[ self selection:sel ].            
-
-
-
-
-!
-
-cvsSelectionAdd:aView
+    self canvasEventsDisabledDo:[ self selection:sel ].            
+!
+
+canvasSelectionAdd:aView
     "canvas adds a view to current selection
     "
     |item index oldSel|
@@ -5198,12 +5192,9 @@
             self selectionChangedFrom:oldSel
         ]        
     ]            
-
-
-
-!
-
-cvsSelectionRemove:aView
+!
+
+canvasSelectionRemove:aView
     "canvas removes a view from current selection
     "
     |item index oldSel|
@@ -5216,8 +5207,6 @@
         self removeFromSelection:index.
         self selectionChangedFrom:oldSel.
     ].
-
-
 ! !
 
 !UIPainter::TreeView methodsFor:'change & update'!
@@ -5366,18 +5355,15 @@
 
 !UIPainter::TreeView methodsFor:'event handling'!
 
-cvsEventsDisabledDo:aBlock
-    "evaluates the block without raising selection changed notifications
-     to canvas"
-
-    |restoreCvsEvents|
-
-    restoreCvsEvents  := cvsEventsDisabled.
-    cvsEventsDisabled := true.
+canvasEventsDisabledDo:aBlock
+    "evaluates the block without raising selection changed notifications to canvas"
+
+    |restoreCanvasEvents|
+
+    restoreCanvasEvents  := canvasEventsDisabled.
+    canvasEventsDisabled := true.
     aBlock value.
-    cvsEventsDisabled := restoreCvsEvents.
-
-
+    canvasEventsDisabled := restoreCanvasEvents.
 !
 
 doubleClicked
@@ -5415,7 +5401,7 @@
     super initialize.
 
     self multipleSelectOk:true.
-    cvsEventsDisabled := false.
+    canvasEventsDisabled := false.
     self showDirectoryIndicator: true.
     self showDirectoryIndicatorForRoot: false.
 
@@ -5461,7 +5447,7 @@
     super selectionChangedFrom:oldSelection.
     size := selection size.
 
-    cvsEventsDisabled ifFalse:[
+    canvasEventsDisabled ifFalse:[
         (size ~~ 0 and:[size ~~ 1 or:[selection first ~~ 1]]) ifTrue:[
             sel := OrderedCollection new.