UIPainterView.st
changeset 754 04e802a6a920
parent 744 20cbba6d7e96
child 758 1370f99f4c09
equal deleted inserted replaced
753:45be0e91a172 754:04e802a6a920
   169 ! !
   169 ! !
   170 
   170 
   171 !UIPainterView methodsFor:'change & update'!
   171 !UIPainterView methodsFor:'change & update'!
   172 
   172 
   173 layoutChanged
   173 layoutChanged
       
   174 
   174     treeView layoutChanged
   175     treeView layoutChanged
   175 ! !
   176 ! !
   176 
   177 
   177 !UIPainterView methodsFor:'copy & cut & paste'!
   178 !UIPainterView methodsFor:'copy & cut & paste'!
   178 
   179 
   451     "a delegated keyEvent from aView"
   452     "a delegated keyEvent from aView"
   452 
   453 
   453     self keyRelease:key x:x y:y
   454     self keyRelease:key x:x y:y
   454 
   455 
   455     "Modified: / 31.10.1997 / 20:27:32 / cg"
   456     "Modified: / 31.10.1997 / 20:27:32 / cg"
       
   457 !
       
   458 
       
   459 sizeChanged:how
       
   460 
       
   461     super sizeChanged:how. 
       
   462 
       
   463     self layoutChanged
   456 ! !
   464 ! !
   457 
   465 
   458 !UIPainterView methodsFor:'generating output'!
   466 !UIPainterView methodsFor:'generating output'!
   459 
   467 
   460 aspectMethods
   468 aspectMethods
   886 
   894 
   887     "Modified: 5.9.1995 / 21:01:35 / claus"
   895     "Modified: 5.9.1995 / 21:01:35 / claus"
   888     "Modified: 24.6.1997 / 19:12:44 / cg"
   896     "Modified: 24.6.1997 / 19:12:44 / cg"
   889 ! !
   897 ! !
   890 
   898 
       
   899 !UIPainterView methodsFor:'grid manipulation'!
       
   900 
       
   901 newGrid
       
   902     "define a new grid - this is a private helper which has to be
       
   903      called after any change in the grid. It (re)creates the gridPixmap,
       
   904      clears the view and redraws all visible objects."
       
   905 
       
   906     |defaultViewBackground|
       
   907 
       
   908     gridPixmap := nil.
       
   909     defaultViewBackground := self class defaultViewBackgroundColor.
       
   910 
       
   911     shown ifTrue:[
       
   912         self viewBackground: (defaultViewBackground isColor
       
   913             ifTrue: [defaultViewBackground]
       
   914             ifFalse:[Black]).
       
   915         self clear.
       
   916     ].
       
   917 
       
   918     gridShown ifTrue:[
       
   919         self defineGrid.
       
   920         gridPixmap colorMap: (defaultViewBackground isColor
       
   921             ifTrue: [Array with:defaultViewBackground with:Color darkGray]
       
   922             ifFalse:[Array with:White with:Black]).
       
   923         self viewBackground:gridPixmap.
       
   924     ].
       
   925 
       
   926     self invalidate
       
   927 
       
   928 ! !
       
   929 
   891 !UIPainterView methodsFor:'initialization'!
   930 !UIPainterView methodsFor:'initialization'!
   892 
   931 
   893 initialize
   932 initialize
   894     "setup attributes
   933     "setup attributes
   895     "
   934     "
   948 
   987 
   949 showMiddleButtonMenu
   988 showMiddleButtonMenu
   950     "show the middle button menu; this returns nil
   989     "show the middle button menu; this returns nil
   951     "
   990     "
   952     self enabled ifTrue:[
   991     self enabled ifTrue:[
   953         (MenuPanel fromSpec:(UIPainter menuEdit) receiver:self) startUp
   992         (MenuPanel fromSpec:(UIPainter menuEdit) receiver:self superView application) startUp
   954     ].
   993     ].
   955   ^ nil
   994   ^ nil
   956 
   995 
       
   996 
       
   997 
       
   998 ! !
       
   999 
       
  1000 !UIPainterView methodsFor:'private handles'!
       
  1001 
       
  1002 showSelected:aComponent
       
  1003     "show object selected
       
  1004     "
       
  1005     |wasClipped|
       
  1006 
       
  1007     selectionHiddenLevel == 0 ifTrue:[
       
  1008         (treeView selection size > 1 and: 
       
  1009         [(treeView model list at: treeView selection first) contents view == aComponent])
       
  1010             ifTrue: [self paint: Color red]
       
  1011             ifFalse:[self paint: Black].
       
  1012 
       
  1013         (wasClipped := clipChildren) ifTrue:[
       
  1014             self clippedByChildren:(clipChildren := false). 
       
  1015         ].
       
  1016 
       
  1017         self handlesOf:aComponent do:[:rectangle :what|
       
  1018             what == #view ifTrue:[self displayRectangle:rectangle]
       
  1019                          ifFalse:[self fillRectangle:rectangle]
       
  1020         ].
       
  1021 
       
  1022         wasClipped ifTrue:[
       
  1023             self clippedByChildren:(clipChildren := true).
       
  1024         ]
       
  1025     ]
   957 
  1026 
   958 
  1027 
   959 ! !
  1028 ! !
   960 
  1029 
   961 !UIPainterView methodsFor:'queries'!
  1030 !UIPainterView methodsFor:'queries'!