eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'DisplayObject':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DisplayObject


Inheritance:

   Object
   |
   +--DisplayObject
      |
      +--BarChart3DWidget::Bar
      |
      +--BarChart3DWidget::Label
      |
      +--VisualComponent

Package:
stx:libview2
Category:
Compatibility-ST80-Graphics-Display Objects
Version:
rev: 1.51 date: 2023/09/07 20:42:16
user: stefan
file: DisplayObject.st directory: libview2
module: stx stc-classLibrary: libview2

Description:


generic superclass for Display Objects held in ObjectViews
see DrawObject/LogicObject/DeskTopObject and subclasses for example uses.

copyright

COPYRIGHT (c) 1989 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

behavior
o  dragDashedOutline
if true, outline dragging is done by drawing the line dashed.
if false, the outline is drawn solid.
Can be redefined in subclasses (for solid outline).

o  dragOutline
if true, dragging is done by drawing outline only;
if false, dragging is done by full draw (fast servers only).
Can be redefined in subclasses (for full dragging)

instance creation
o  new
(comment from inherited method)
return an instance of myself without indexed variables

queries
o  hasOwnScrollbars
a hack for codeView2, which behaves like a TextView, but has its own
scrollbars embedded - sigh (an extra load one).
This allows for the UIBuilder to avoid creating an extra set around such
a view (as is the case with TextSpec with scrollbars when using CodeView2)

o  isAbstract
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.


Instance protocol:

ST-80 drawing
o  displayOn: aDisplayMedium at: aPoint
for ST-80 compatibility; not used in ST/X

o  displayOn: aDisplayMedium at: aPoint clippingBox: clipRectangle
for ST-80 compatibility; not used in ST/X

o  displayOn: aDisplayMedium at: aPoint clippingBox: clip rule: rule mask: aForm
for ST-80 compatibility; not used in ST/X.
in ST-80 programs, this is redefined

o  displayOn: aDisplayMedium x: x y: y
(comment from inherited method)
display the receiver in a graphicsContext - this method allows
for any object to be displayed in a ListView (or any view) - for example.

accessing
o  bottom

o  bottomCenter

o  bottomLeft

o  bottomRight

o  bounds
ST80 component compatibility

o  corner
return the frame corner

o  corner: corner
object must calculate its dimension from outline

** This method must be redefined in concrete classes (subclassResponsibility) **

o  extent
return the extent of the frame

o  frame
object must return a frame boundary rectangle

o  height
return the height of the frame

o  heightOn: aGC
return the height of the frame if drawon on aCG

o  helpKey
The helpKey (symbol) or nil.
For now, components cannot have their own help

o  left

o  leftCenter

o  origin
return the frame origin

o  origin: origin
object must calculate its dimension from outline

** This method must be redefined in concrete classes (subclassResponsibility) **

o  origin: origin corner: corner
object must calculate its dimension from outline

o  right

o  rightCenter

o  top

o  topCenter

o  topLeft

o  topRight

o  width
return the width of the frame

o  widthFrom: startIndex to: endIndex on: aGC
return the width of part of myself if drawn on aCG

** This method must be redefined in concrete classes (subclassResponsibility) **

o  widthOn: aGC
return the width of the frame if drawn on aCG

component protocol
o  container: aComponent
ignored here - added to allow images to be used like
VisualComponents (later, Image should inherit from it)

o  containerChangedSize
ignored here - added to allow images to be used like
VisualComponents (later, Image should inherit from it)

o  destroy
SimpleView>>destroySubviews wants to destroy us (if we are a view's component).
Do nothing here

o  middleButtonMenu: ignoredHere
intentionally left blank

o  realize
ignored here - added to allow images to be used like
VisualComponents (later, Image should inherit from it)

converting
o  asDisplayObject

drawing
o  drawDashedOutlineIn: aGC offset: anOffset
draw the receiver's outline at its origin offset by anOffset, aPoint

o  drawDragIn: aView
draw the receiver for dragging at its origin

o  drawDragIn: aView at: drawOrigin
draw the receiver for dragging at some point

o  drawDragIn: aView offset: drawOrigin
draw the receiver for dragging offset by some amount

o  drawIn: aView
draw the receiver at its origin

o  drawIn: aView at: drawOrigin
draw the receiver at drawOrigin, aPoint

o  drawIn: aView offset: anOffset
draw the receiver at its origin offset by anOffset, aPoint

** This method must be redefined in concrete classes (subclassResponsibility) **

o  drawOutlineIn: aView
draw the receiver's outline at its origin

o  drawOutlineIn: aView at: drawOrigin
draw the receiver's outline at drawOrigin, aPoint

o  drawOutlineIn: aView offset: anOffset
draw the receiver's outline at its origin offset by anOffset, aPoint

o  drawSelectedIn: aView
draw the receiver highlighted at its position

o  drawSelectedIn: aView offset: anOffset
draw the receiver highlighted - this is usually redefined

dummy event handling
o  buttonMotion: buttNr x: x y: y

o  buttonPress: buttNr x: x y: y

o  buttonRelease: buttNr x: x y: y

o  keyPress: key x: x y: y

o  keyRelease: key x: x y: y

initialization
o  computeBoundingBox
compute my boundingBox into the local variable 'frame'.
The box should be computed for Display.

** This method must be redefined in concrete classes (subclassResponsibility) **

o  computeBoundingBoxFor: aDevice
compute my boundingBox into the local variable 'frame'.
The box is to be computed for aDevice.

o  initialize

queries
o  canBeMoved
return true, if the receiver can be moved around (in an ObjectView)

o  canBeSelected
return true, if the receiver can be selected (in an ObjectView)

o  containsPoint: aPoint

o  frameIsHitBy: aPoint withDelta: delta
return true, if my frame is hit by aPoint

o  handlesKeyboardInput
return true, if the receiver handles keyboard input

o  hasFixedSize
return true, if the receiver has fixed size i.e. cannot be
resized
- by default, we do not allow resizing

o  hasOwnScrollbars
a hack for codeView2, which behaves like a TextView, but has its own
scrollbars embedded - sigh (an extra load one).
This allows for the UIBuilder to avoid creating an extra set around such
a view (as is the case with TextSpec with scrollbars when using CodeView2)

o  hasRectangularBounds
can be redefined, but then it should also provide handles

o  heightOfContentsDependsOnWidth
a very special query which is used by the scrollableView,
to check if it should NOT automatically hide scrollbars, when the
pointer leaves the view.
Currently, there are only a small number of views which return true here,
one being the HTML view, which rearranges its text depending on the width,
and therefore, it is a bad idea to hide/show scrollbars dynamically
(as this might lead to annoying flicker if the hiding of the scrollbar
rearranges the contents)

o  intersects: aRectangle
object must decide, if it's intersecting a rectangle

o  isContainedIn: aRectangle
object must decide, if it's within a rectangle

o  isDisplayObject

o  isHitBy: aPoint
object must decide, if hit by a click at aPoint

o  isHitBy: aPoint withDelta: delta
object must decide, if hit by a click at aPoint;
usually this method is redefined in subclasses for a more complete
check (i.e. if objects boundary is not rectangular)

o  isOpaque
return true, if the object fully covers its frame (i.e. is rectangular
and has no 'holes'. Since we don't know, return false here

o  widthOfContentsDependsOnHeight
a very special query which is only used by the scrollableView,
to check if it should NOT automatically hide scrollbars, when the
pointer leaves the view.
Currently, there is no view, which returns true
(maybe if we ever support chinese writing top to bottom...

user actions
o  keyInput: akey

user actions-move
o  moveBy: delta
move the receiver - extent is unchanged

o  moveTo: aPoint
object must move to new origin
- default is to stay; ought to be redefined in subclass



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 10 Dec 2024 08:12:39 GMT