DeviceGraphicsContext.st
changeset 950 d4d907fc7d78
parent 927 c4bc2a7ff733
child 975 68f73e1ad6c9
equal deleted inserted replaced
949:3894d442e895 950:d4d907fc7d78
   241     ]
   241     ]
   242 
   242 
   243     "Modified: 12.5.1996 / 22:23:03 / cg"
   243     "Modified: 12.5.1996 / 22:23:03 / cg"
   244 !
   244 !
   245 
   245 
       
   246 clipByChildren
       
   247     "drawing shall be done into my view only (default)"
       
   248 
       
   249     ^ self clippedByChildren:true
       
   250 
       
   251     "Created: 17.7.1996 / 13:25:55 / cg"
       
   252 !
       
   253 
   246 clipRect
   254 clipRect
   247     "return the clipping rectangle for drawing. If there is currently no clipRect,
   255     "return the clipping rectangle for drawing. If there is currently no clipRect,
   248      a dummy is created."
   256      a dummy is created."
   249 
   257 
   250     |rect|
   258     |rect|
   257         ^ rect
   265         ^ rect
   258     ].
   266     ].
   259     ^ clipRect
   267     ^ clipRect
   260 
   268 
   261     "Modified: 10.4.1996 / 14:32:22 / cg"
   269     "Modified: 10.4.1996 / 14:32:22 / cg"
       
   270 !
       
   271 
       
   272 clippedByChildren:aBoolean
       
   273     "turn on/off drawing over children.
       
   274      If on, a superview may draw 'over' its children.
       
   275      If off (the default), drawing is 'under' its children.
       
   276      Only useful for the rootView, to draw over any visible views.
       
   277      (for example, when dragging a rubber-line)"
       
   278 
       
   279     gcId isNil ifTrue:[
       
   280         self initGC
       
   281     ].
       
   282     device setClipByChildren:aBoolean in:gcId
       
   283 
       
   284     "Created: 17.7.1996 / 13:25:16 / cg"
   262 !
   285 !
   263 
   286 
   264 clippingRectangle:aRectangleOrNil
   287 clippingRectangle:aRectangleOrNil
   265     "set the clipping rectangle for drawing (in logical coordinates);
   288     "set the clipping rectangle for drawing (in logical coordinates);
   266      a nil argument turn off clipping (i.e. whole view is drawable)"
   289      a nil argument turn off clipping (i.e. whole view is drawable)"
   481 		    device setPixmapMask:id in:gcId
   504 		    device setPixmapMask:id in:gcId
   482 		]
   505 		]
   483 	    ]
   506 	    ]
   484 	]
   507 	]
   485     ]
   508     ]
       
   509 !
       
   510 
       
   511 noClipByChildren
       
   512     "drawing shall also be done into subviews"
       
   513 
       
   514     ^ self clippedByChildren:false
       
   515 
       
   516     "Created: 17.7.1996 / 14:15:54 / cg"
   486 !
   517 !
   487 
   518 
   488 paint:aColor
   519 paint:aColor
   489     "set the drawing color, which may be a real color, a dithered one
   520     "set the drawing color, which may be a real color, a dithered one
   490      or even an image."
   521      or even an image."
  3181     "setup everything for later use; actual work is done in
  3212     "setup everything for later use; actual work is done in
  3182      initColors and initFont, which are usually redefined."
  3213      initColors and initFont, which are usually redefined."
  3183 
  3214 
  3184     "make certain Workstation is initialized - just a check - will vanish soon"
  3215     "make certain Workstation is initialized - just a check - will vanish soon"
  3185     Display isNil ifTrue:[
  3216     Display isNil ifTrue:[
  3186 	'DEVDRAW: Display not initialized when first DeviceGraphicsContext created' errorPrintNL.
  3217         'DEVDRAW: Display not initialized when first DeviceGraphicsContext created' errorPrintNL.
  3187 	Workstation initialize
  3218         Workstation initialize
  3188     ].
  3219     ].
  3189 
  3220 
  3190     super initialize.
  3221     super initialize.
  3191 
  3222 
  3192     foreground := Black.
  3223     foreground isNil ifTrue:[foreground := Black].
  3193     background := White.
  3224     background isNil ifTrue:[background := White].
       
  3225 
       
  3226     "Modified: 17.7.1996 / 12:59:47 / cg"
  3194 !
  3227 !
  3195 
  3228 
  3196 prepareForReinit
  3229 prepareForReinit
  3197     "kludge - clear drawableId and gcId 
  3230     "kludge - clear drawableId and gcId 
  3198      needed after snapin"
  3231      needed after snapin"
  3387 ! !
  3420 ! !
  3388 
  3421 
  3389 !DeviceGraphicsContext  class methodsFor:'documentation'!
  3422 !DeviceGraphicsContext  class methodsFor:'documentation'!
  3390 
  3423 
  3391 version
  3424 version
  3392     ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.12 1996-07-05 16:09:14 cg Exp $'
  3425     ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.13 1996-07-17 12:17:17 cg Exp $'
  3393 ! !
  3426 ! !
  3394 DeviceGraphicsContext initialize!
  3427 DeviceGraphicsContext initialize!