|
Class: DisplayObject
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
generic superclass for Display Objects held in ObjectViews
see DrawObject/LogicObject/DeskTopObject and subclasses for example uses.
copyrightCOPYRIGHT (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.
behavior
-
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).
-
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
-
new
-
(comment from inherited method)
return an instance of myself without indexed variables
queries
-
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)
-
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.
ST-80 drawing
-
displayOn: aDisplayMedium at: aPoint
-
for ST-80 compatibility; not used in ST/X
-
displayOn: aDisplayMedium at: aPoint clippingBox: clipRectangle
-
for ST-80 compatibility; not used in ST/X
-
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
-
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
-
bottom
-
-
bottomCenter
-
-
bottomLeft
-
-
bottomRight
-
-
bounds
-
ST80 component compatibility
-
corner
-
return the frame corner
-
corner: corner
-
object must calculate its dimension from outline
** This method must be redefined in concrete classes (subclassResponsibility) **
-
extent
-
return the extent of the frame
-
frame
-
object must return a frame boundary rectangle
-
height
-
return the height of the frame
-
heightOn: aGC
-
return the height of the frame if drawon on aCG
-
helpKey
-
The helpKey (symbol) or nil.
For now, components cannot have their own help
-
left
-
-
leftCenter
-
-
origin
-
return the frame origin
-
origin: origin
-
object must calculate its dimension from outline
** This method must be redefined in concrete classes (subclassResponsibility) **
-
origin: origin corner: corner
-
object must calculate its dimension from outline
-
right
-
-
rightCenter
-
-
top
-
-
topCenter
-
-
topLeft
-
-
topRight
-
-
width
-
return the width of the frame
-
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) **
-
widthOn: aGC
-
return the width of the frame if drawn on aCG
component protocol
-
container: aComponent
-
ignored here - added to allow images to be used like
VisualComponents (later, Image should inherit from it)
-
containerChangedSize
-
ignored here - added to allow images to be used like
VisualComponents (later, Image should inherit from it)
-
destroy
-
SimpleView>>destroySubviews wants to destroy us (if we are a view's component).
Do nothing here
-
middleButtonMenu: ignoredHere
-
intentionally left blank
-
realize
-
ignored here - added to allow images to be used like
VisualComponents (later, Image should inherit from it)
converting
-
asDisplayObject
-
drawing
-
drawDashedOutlineIn: aGC offset: anOffset
-
draw the receiver's outline at its origin offset by anOffset, aPoint
-
drawDragIn: aView
-
draw the receiver for dragging at its origin
-
drawDragIn: aView at: drawOrigin
-
draw the receiver for dragging at some point
-
drawDragIn: aView offset: drawOrigin
-
draw the receiver for dragging offset by some amount
-
drawIn: aView
-
draw the receiver at its origin
-
drawIn: aView at: drawOrigin
-
draw the receiver at drawOrigin, aPoint
-
drawIn: aView offset: anOffset
-
draw the receiver at its origin offset by anOffset, aPoint
** This method must be redefined in concrete classes (subclassResponsibility) **
-
drawOutlineIn: aView
-
draw the receiver's outline at its origin
-
drawOutlineIn: aView at: drawOrigin
-
draw the receiver's outline at drawOrigin, aPoint
-
drawOutlineIn: aView offset: anOffset
-
draw the receiver's outline at its origin offset by anOffset, aPoint
-
drawSelectedIn: aView
-
draw the receiver highlighted at its position
-
drawSelectedIn: aView offset: anOffset
-
draw the receiver highlighted - this is usually redefined
dummy event handling
-
buttonMotion: buttNr x: x y: y
-
-
buttonPress: buttNr x: x y: y
-
-
buttonRelease: buttNr x: x y: y
-
-
keyPress: key x: x y: y
-
-
keyRelease: key x: x y: y
-
initialization
-
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) **
-
computeBoundingBoxFor: aDevice
-
compute my boundingBox into the local variable 'frame'.
The box is to be computed for aDevice.
-
initialize
-
queries
-
canBeMoved
-
return true, if the receiver can be moved around (in an ObjectView)
-
canBeSelected
-
return true, if the receiver can be selected (in an ObjectView)
-
containsPoint: aPoint
-
-
frameIsHitBy: aPoint withDelta: delta
-
return true, if my frame is hit by aPoint
-
handlesKeyboardInput
-
return true, if the receiver handles keyboard input
-
hasFixedSize
-
return true, if the receiver has fixed size i.e. cannot be
resized
- by default, we do not allow resizing
-
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)
-
hasRectangularBounds
-
can be redefined, but then it should also provide handles
-
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)
-
intersects: aRectangle
-
object must decide, if it's intersecting a rectangle
-
isContainedIn: aRectangle
-
object must decide, if it's within a rectangle
-
isDisplayObject
-
-
isHitBy: aPoint
-
object must decide, if hit by a click at aPoint
-
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)
-
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
-
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
-
keyInput: akey
-
user actions-move
-
moveBy: delta
-
move the receiver - extent is unchanged
-
moveTo: aPoint
-
object must move to new origin
- default is to stay; ought to be redefined in subclass
|