color master selection in red + grid background colored
authortz
Mon, 30 Mar 1998 14:45:46 +0200
changeset 754 04e802a6a920
parent 753 45be0e91a172
child 755 cfbbec0a33c6
color master selection in red + grid background colored
UIPainterView.st
--- a/UIPainterView.st	Mon Mar 30 14:43:22 1998 +0200
+++ b/UIPainterView.st	Mon Mar 30 14:45:46 1998 +0200
@@ -171,6 +171,7 @@
 !UIPainterView methodsFor:'change & update'!
 
 layoutChanged
+
     treeView layoutChanged
 ! !
 
@@ -453,6 +454,13 @@
     self keyRelease:key x:x y:y
 
     "Modified: / 31.10.1997 / 20:27:32 / cg"
+!
+
+sizeChanged:how
+
+    super sizeChanged:how. 
+
+    self layoutChanged
 ! !
 
 !UIPainterView methodsFor:'generating output'!
@@ -888,6 +896,37 @@
     "Modified: 24.6.1997 / 19:12:44 / cg"
 ! !
 
+!UIPainterView methodsFor:'grid manipulation'!
+
+newGrid
+    "define a new grid - this is a private helper which has to be
+     called after any change in the grid. It (re)creates the gridPixmap,
+     clears the view and redraws all visible objects."
+
+    |defaultViewBackground|
+
+    gridPixmap := nil.
+    defaultViewBackground := self class defaultViewBackgroundColor.
+
+    shown ifTrue:[
+        self viewBackground: (defaultViewBackground isColor
+            ifTrue: [defaultViewBackground]
+            ifFalse:[Black]).
+        self clear.
+    ].
+
+    gridShown ifTrue:[
+        self defineGrid.
+        gridPixmap colorMap: (defaultViewBackground isColor
+            ifTrue: [Array with:defaultViewBackground with:Color darkGray]
+            ifFalse:[Array with:White with:Black]).
+        self viewBackground:gridPixmap.
+    ].
+
+    self invalidate
+
+! !
+
 !UIPainterView methodsFor:'initialization'!
 
 initialize
@@ -950,7 +989,7 @@
     "show the middle button menu; this returns nil
     "
     self enabled ifTrue:[
-        (MenuPanel fromSpec:(UIPainter menuEdit) receiver:self) startUp
+        (MenuPanel fromSpec:(UIPainter menuEdit) receiver:self superView application) startUp
     ].
   ^ nil
 
@@ -958,6 +997,36 @@
 
 ! !
 
+!UIPainterView methodsFor:'private handles'!
+
+showSelected:aComponent
+    "show object selected
+    "
+    |wasClipped|
+
+    selectionHiddenLevel == 0 ifTrue:[
+        (treeView selection size > 1 and: 
+        [(treeView model list at: treeView selection first) contents view == aComponent])
+            ifTrue: [self paint: Color red]
+            ifFalse:[self paint: Black].
+
+        (wasClipped := clipChildren) ifTrue:[
+            self clippedByChildren:(clipChildren := false). 
+        ].
+
+        self handlesOf:aComponent do:[:rectangle :what|
+            what == #view ifTrue:[self displayRectangle:rectangle]
+                         ifFalse:[self fillRectangle:rectangle]
+        ].
+
+        wasClipped ifTrue:[
+            self clippedByChildren:(clipChildren := true).
+        ]
+    ]
+
+
+! !
+
 !UIPainterView methodsFor:'queries'!
 
 resolveName:aName