UIObjectView.st
changeset 360 1a4ec4aa2c67
parent 353 6687441ccd4d
child 374 421f8a3723f1
--- a/UIObjectView.st	Wed Oct 29 17:07:57 1997 +0100
+++ b/UIObjectView.st	Wed Oct 29 17:43:19 1997 +0100
@@ -15,7 +15,7 @@
 ObjectView subclass:#UIObjectView
 	instanceVariableNames:'saveSelection inputView enableChannel undoHistory copiedExtent
 		copiedLayout resizeData clipChildren selectionHiddenLevel
-		setOfSuperViewsSizeChanged'
+		gridParameters setOfSuperViewsSizeChanged'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-UIPainter'
@@ -328,8 +328,34 @@
 
      if littleStepH/V are nil, only bigSteps are drawn.
     "
-
-    ^ #(10 10 nil nil 10 10 false)
+    gridParameters isNil ifTrue:[
+        gridParameters := #(10 10 nil nil 10 10 false)
+    ].
+    ^ gridParameters
+
+
+!
+
+gridParameters:newGridParameters
+    "used by defineGrid, and in a separate method for
+     easier redefinition in subclasses. 
+     Returns the grid parameters in an array of 7 elements,
+     which control the appearance of the grid-pattern.
+     the elements are:
+
+        bigStepH        number of pixels horizontally between 2 major steps
+        bigStepV        number of pixels vertically between 2 major steps
+        littleStepH     number of pixels horizontally between 2 minor steps
+        littleStepV     number of pixels vertically between 2 minor steps
+        gridAlignH      number of pixels for horizontal grid align (pointer snap)
+        gridAlignV      number of pixels for vertical grid align (pointer snap)
+        docBounds       true, if document boundary should be shown
+
+     if littleStepH/V are nil, only bigSteps are drawn.
+    "
+    newGridParameters size == 7 ifTrue:[
+        gridParameters := newGridParameters
+    ].
 
 
 !
@@ -463,14 +489,15 @@
 keyPress:key x:x y:y
     "any key pressed
     "
-    <resource: #keyboard ( #Delete #BackSpace #Cut #Copy #Paste ) >
+    <resource: #keyboard ( #Delete #BackSpace #Cut #Copy #Paste #Cmdu ) >
 
     (key == #Cut or:[key == #Delete or:[key == #BackSpace]]) ifTrue: [
         ^ self deleteSelection
     ].
-
     key == #Copy  ifTrue:[ ^ self copySelection].
     key == #Paste ifTrue:[ ^ self pasteBuffer].
+    key == #Cmdu  ifTrue:[ ^ self undoLast ].           "/ #Undo
+
 !
 
 processEvent:anEvent