Morphic

AbstractHierarchicalList
Contributed by Bob Arning as part of the ObjectExplorer package.
genericMenu:
getCurrentSelection
noteNewSelection:
perform:orSendTo:
Selector was just chosen from a menu by a user. If can respond, then
perform it on myself. If not, send it to otherTarget, presumably the
editPane from which the menu was invoked.
update:
Receive a change notice from an object of whom the receiver is a
dependent. The default behavior is to do nothing; a subclass might want
to change itself in some way.
AbstractResizerMorph
I am the superclass of a hierarchy of morph specialized in allowing the user to resize or rearrange windows and panes.
adoptPaneColor:
Just get the resizer fill style for the theme.
dotColor
handleColor
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesMouseOver:
Do I want to receive mouseEnter: and mouseLeave: when the button is up and the hand is empty? The default response is false, except if you have added sensitivity to mouseEnter: or mouseLeave:, using the on:send:to: mechanism.
initialize
initialize the state of the receiver
isCursorOverHandle
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseEnter:
Handle a mouseEnter event, meaning the mouse just entered my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseLeave:
Handle a mouseLeave event, meaning the mouse just left my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseUp:
Change the cursor back to normal if necessary.
resizeCursor
setDefaultColors
setInverseColors
shouldDraw
Answer whether the resizer should be drawn.
shouldInvalidateOnMouseTransition
Answer whether the resizer should be invalidated
when the mouse enters or leaves.
AcceptableCleanTextMorph
An AcceptableCleanTextMorph is xxxxxxxxx.
Instance Variables
accept
Overridden to allow accept of clean text
AlignmentMorph
Used for layout.
Since all morphs now support layoutPolicy the main use of this class is no longer needed.
Kept around for compability.
Supports a few methods not found elsewhere that can be convenient, eg. newRow
addAColumn:
addARow:
addARowCentered:
addARowCentered:cellInset:
canHaveFillStyles
Return true if the receiver can have general fill styles; not just colors.
This method is for gradually converting old morphs.
columnPrototype
convertOldAlignmentsNov2000:using:
major change - much of AlignmentMorph is now implemented more generally in Morph
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
fancyText:font:color:
inAColumn:
inARightColumn:
inARow:
initialize
initialize the state of the receiver
isAlignmentMorph
newColumn
newRow
newSpacer:
newVariableTransparentSpacer
openInWindowLabeled:inWorld:
Changed to include the inset margin in the bound calculation.
rowPrototype
wantsKeyboardFocusFor:
Answer whether a plain mouse click on aSubmorph, a text-edit-capable thing, should result in a text selection there
AlphaBlendingCanvas
An AlphaBlendingCanvas is xxxxxxxxx.
Instance Variables
alpha: <Object>
alpha
- xxxxx
alpha
alpha:
image:at:sourceRect:rule:
Draw the given form. For the 'paint' combination rule use stenciling otherwise simply fill the source rectangle.
Do a blendAlpha if the rule is blend to cope with translucent images being drawn (via translucentImage:...).
mapColor:
on:
BalloonCanvas
BalloonCanvas is a canvas using the BalloonEngine for drawing wherever possible. It has various methods which other canvases do not support due to the extra features of the balloon engine.
aaLevel
aaLevel:
Only allow changes to aaLevel if we're working on >= 8 bit forms
asBalloonCanvas
colorTransformBy:
copy
Make a copy the receiver on the same underlying Form but with its own grafPort.
deferred
deferred:
drawBezier3Shape:color:borderWidth:borderColor:
drawBezierShape:color:borderWidth:borderColor:
Draw a boundary shape that is defined by a list of vertices.
Each three subsequent vertices define a quadratic bezier segment.
For lines, the control point should be set to either the start or the end
of the bezier curve.
drawCompressedShape:
Draw a compressed shape
drawGeneralBezier3Shape:color:borderWidth:borderColor:
drawGeneralBezierShape:color:borderWidth:borderColor:
Draw a general boundary shape (e.g., possibly containing holes)
drawGeneralPolygon:color:borderWidth:borderColor:
Draw a general polygon (e.g., a polygon that can contain holes)
drawOval:color:borderWidth:borderColor:
Draw the oval defined by the given rectangle
drawPolygon:fillStyle:
Fill the given polygon.
drawPolygon:fillStyle:borderWidth:borderColor:
Draw a simple polygon defined by the list of vertices.
drawRectangle:color:borderWidth:borderColor:
Draw a rectangle
drawString:from:to:in:font:color:
drawString:from:to:in:font:color:underline:underlineColor:strikethrough:strikethroughColor:
ensuredEngine
fillColor:
Note: This always fills, even if the color is transparent.
fillOval:color:borderWidth:borderColor:
Draw a filled and outlined oval
fillOval:fillStyle:borderWidth:borderColor:
Fill the given rectangle.
fillRectangle:basicFillStyle:
Fill the given rectangle with the given, non-composite, fill style.
fillRectangle:color:
Fill the rectangle with the given color
fillRectangle:fillStyle:
Fill the given rectangle. Double-dispatched via the fill style.
flush
Force all pending primitives onscreen
frameAndFillRectangle:fillColor:borderWidth:borderColor:
Draw a filled and outlined rectangle
frameAndFillRectangle:fillColor:borderWidth:topLeftColor:bottomRightColor:
Draw a beveled or raised rectangle
ifNoTransformWithIn:
Return true if the current transformation does not affect the given bounding box
image:at:sourceRect:rule:
Draw the portion of the given Form defined by sourceRect at the given point using the given BitBlt combination rule.
initialize
Subclasses should redefine this method to perform initializations on instance creation
isBalloonCanvas
isVisible:
Optimization
line:to:brushForm:
Who's gonna use this?
line:to:width:color:
Draw a line from pt1 to: pt2
paragraph:bounds:color:
Draw the given paragraph
point:color:
Is there any use for this?
preserveStateDuring:
Preserve the full canvas state during the execution of aBlock
resetEngine
transformBy:
transformBy:during:
BalloonMorph
A balloon with text used for the display of explanatory information.
Balloon help is integrated into Morphic as follows:
If a Morph has the property #balloonText, then it will respond to #showBalloon by adding a text balloon to the world, and to #deleteBalloon by removing the balloon.
Moreover, if mouseOverEnabled is true (see class msg), then the Hand will arrange to cause display of the balloon after the mouse has lingered over the morph for a while, and removal of the balloon when the mouse leaves the bounds of that morph. In any case, the Hand will attempt to remove any such balloons before handling mouseDown events, or displaying other balloons.
Balloons should not be duplicated with veryDeepCopy unless their target is also duplicated at the same time.
adjustedCenter
Return the center of the original textMorph box within the balloon.
balloonColor
balloonFont
balloonOwner
chooseBalloonFont
defaultBorderColor
answer the default border color/fill style for the receiver
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
getBestLocation:for:corner:
getTextMorph:for:
getVertices:
initialize
initialize the state of the receiver
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
popUpFor:hand:
Pop up the receiver as balloon help for the given hand
popUpForHand:
Pop up the receiver as balloon help for the given hand
setBalloonColorTo:
setBalloonFontTo:
setTarget:
step
Move with target.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
string:for:
string:for:corner:
BalloonRectangleMorph
BalloonRectangleMorph is an example for drawing using the BalloonEngine.
canDrawBorder:
Return true if the receiver can be drawn with the given border style.
defaultBorderColor
answer the default border color/fill style for the receiver
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
doesBevels
To return true means that this object can show bevelled borders, and
therefore can accept, eg, #raised or #inset as valid borderColors.
Must be overridden by subclasses that do not support bevelled borders.
drawOn:
initialize
initialize the state of the receiver
newTransformationMorph
BorderStyle
See BorderedMorph
BorderedMorh new borderStyle: (BorderStyle inset width: 2); openInWorld.
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
baseColor
baseColor:
Ignored
borderStyleChoices
borderStyleForSymbol:
color
color:
Ignored
color:width:
colorsAtCorners
complexAltFramed
complexAltInset
complexAltRaised
complexFramed
complexInset
complexRaised
dashed
default
dotOfSize:forDirection:
drawLineFrom:to:on:
frameOval:on:
Frame the given rectangle on aCanvas
framePolygon:on:
Frame the given rectangle on aCanvas
framePolyline:on:
Frame the given rectangle on aCanvas
frameRectangle:on:
Frame the given rectangle on aCanvas
hasFillStyle
Answer false.
hash
hash is implemented because #= is implemented
inset
isBorderStyle
isComplex
Answer true if receiver is a Complex number. False by default.
isComposite
Answer false.
printOn:
Print a description of the
receiver on the given stream.
raised
releaseCachedState
Release any associated cached state
simple
storeOn:
Store a reconstructable representation of the
receiver on the given stream.
style
thinGray
trackColorFrom:
If necessary, update our color to reflect a change in aMorphs color
width
width:
Ignored
width:color:
widthForRounding
BorderedMorph
BorderedMorph introduce borders to morph. Borders have the instanceVariables borderWidth and borderColor.

BorderedMorph new borderColor: Color red; borderWidth: 10; openInWorld.
BorderedMorph also have a varaity of border styles: simple, inset, raised, complexAltFramed, complexAltInset, complexAltRaised, complexFramed, complexInset, complexRaised.
These styles are set using the classes BorderStyle, SimpleBorder, RaisedBorder, InsetBorder and ComplexBorder.
BorderedMorph new borderStyle: (SimpleBorder width: 1 color: Color white); openInWorld.
BorderedMorph new borderStyle: (BorderStyle inset width: 2); openInWorld.
acquireBorderWidth:
Gracefully acquire the new border width, keeping the interior area intact and not seeming to shift
addBorderStyleMenuItems:hand:
Add border-style menu items
addCornerGrips
addPaneHSplitterBetween:and:
addPaneSplitters
addPaneVSplitterBetween:and:
borderColor
borderColor:
Unfortunately, the argument to borderColor could be more than just a color.
It could also be a symbol, in which case it is to be interpreted as a style identifier.
But I might not be able to draw that kind of border, so it may have to be ignored.
Or it could be nil, in which case I should revert to the default border.
borderInitialize
initialize the receiver state related to border
borderInset
borderRaised
borderStyle
Work around the borderWidth/borderColor pair
borderStyle:
Work around the borderWidth/borderColor pair
borderWidth
borderWidth:
changeBorderColor:
changeBorderWidth:
closestPointTo:
account for round corners. Still has a couple of glitches at upper left and right corners
colorForInsets
Return the color to be used for shading inset borders.
defaultBorderColor
answer the default border color/fill style for the receiver
defaultBorderWidth
answer the default border width for the receiver
doesBevels
To return true means that this object can show bevelled borders, and
therefore can accept, eg, #raised or #inset as valid borderColors.
Must be overridden by subclasses that do not support bevelled borders.
gradientExample
hasTranslucentColor
Answer true if this any of this morph is translucent but not transparent.
initialize
initialize the state of the receiver
intersectionWithLineSegmentFromCenterTo:
account for round corners. Still has a couple of glitches at upper left and right corners
linkSubmorphsToSplitters
removeCornerGrips
removePaneSplitters
setBorderWidth:borderColor:
setColor:borderWidth:borderColor:
splitters
useRoundedCorners
useSquareCorners
BorderedSubpaneDividerMorph
A BorderedSubpaneDividerMorph is xxxxxxxxx.
Instance Variables
resizingEdge: <Object>
resizingEdge
- xxxxx
adoptPaneColor:
Match the color.
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
firstEnter:
The first time this divider is activated, find its window and redirect further interaction there.
forBottomEdge
forTopEdge
horizontal
initialize
initialize the state of the receiver
resizingEdge
resizingEdge:
styleWith:
vertical
BottomLeftGripMorph
I am the handle in the left bottom of windows used for resizing them.
apply:
containsPoint:
Answer true only if on edges.
drawOn:
Draw the grip on the given canvas.
gripLayoutFrame
ptName
resizeCursor
BottomRightGripMorph
I am the handle in the right bottom of windows used for resizing them.
apply:
containsPoint:
Answer true only if on edges.
drawOn:
Draw the grip on the given canvas.
gripLayoutFrame
ptName
resizeCursor
CachingMorph
This morph can be used to cache the picture of a morph that takes a long time to draw. It should be used with judgement, however, since heavy use of caching can consume large amounts of memory.
defaultColor
answer the default color/fill style for the receiver
drawOn:
fullDrawOn:
Draw the full Morphic structure on the given Canvas
imageForm
initialize
initialize the state of the receiver
invalidRect:from:
Record the given rectangle in the damage list.
releaseCachedState
Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.
updateCacheCanvas:
Update the cached image of the morphs being held by this hand.
Canvas
A canvas is a two-dimensional medium on which morphs are drawn in a device-independent manner. Canvases keep track of the origin and clipping rectangle, as well as the underlying drawing medium (such as a window, pixmap, or postscript script).
Subclasses must implement (at least) the following methods:
* Drawing:
#fillOval:color:borderWidth:borderColor:
#frameAndFillRectangle:fillColor:borderWidth:borderColor:
#drawPolygon:color:borderWidth:borderColor:
#image:at:sourceRect:rule:
#stencil:at:sourceRect:rule:
#line:to:width:color:
#paragraph:bounds:color:
#text:bounds:font:color:
* Support
#clipBy:during:
#translateBy:during:
#translateBy:clippingTo:during:
#transformBy:clippingTo:during:
asAlphaBlendingCanvas:
asShadowDrawingCanvas
asShadowDrawingCanvas:
cache:using:during:
Cache the execution of aBlock by the given cache.
Note: At some point we may want to actually *create* the cache here;
for now we're only using it.
clipBy:during:
Set a clipping rectangle active only during the execution of aBlock.
Note: In the future we may want to have more general clip shapes - not just rectangles
clipRect
Return the currently active clipping rectangle
contentsOfArea:
Return the contents of the given area
contentsOfArea:into:
Return the contents of the given area
copy
Answer another instance just like the receiver. Subclasses typically override postCopy; they typically do not override shallowCopy.
copyClipRect:
depth
doesRoundedCorners
draw:
drawImage:at:
Draw the given Form, which is assumed to be a Form or ColorForm
drawImage:at:sourceRect:
Draw the given form.
drawMorph:
Changed to improve performance. Have seen a 30% improvement.
drawPolygon:color:borderWidth:borderColor:
Draw the given polygon.
drawPolygon:fillStyle:
Fill the given polygon.
drawPolygon:fillStyle:borderWidth:borderColor:
Fill the given polygon.
Note: The default implementation does not recognize any enhanced fill styles
drawString:at:
drawString:at:font:color:
drawString:from:to:at:font:color:
drawString:from:to:at:font:color:underline:underlineColor:strikethrough:strikethroughColor:
drawString:from:to:in:font:color:
drawString:from:to:in:font:color:underline:underlineColor:strikethrough:strikethroughColor:
drawString:in:
drawString:in:font:color:
drawString:in:font:color:underline:underlineColor:strikethrough:strikethroughColor:
extent
Return the physical extent of the output device
fillColor:
Fill the receiver with the given color.
Note: This method should be named differently since it is intended to fill the background and thus fills even if the color is transparent
fillOval:color:
fillOval:color:borderWidth:borderColor:
Fill the given oval.
fillOval:fillStyle:
Fill the given oval.
fillOval:fillStyle:borderWidth:borderColor:
Fill the given oval.
Note: The default implementation does not recognize any enhanced fill styles
fillRectangle:basicFillStyle:
Fill the given rectangle with the given, non-composite, fill style
Note: The default implementation does not recognize any enhanced fill styles.
fillRectangle:color:
Fill the rectangle using the given color
fillRectangle:fillStyle:
Fill the given rectangle. Double-dispatched via the fill style.
fillRectangle:fillStyle:borderStyle:
Fill the given rectangle.
filterSelector
finish
If there are any pending operations on the receiver complete them. Do not return before all modifications have taken effect.
flush
flushDisplay
Dummy .
forceToScreen:
dummy
form
frameAndFillRectangle:fillColor:borderWidth:borderColor:
Draw the rectangle using the given attributes
frameAndFillRectangle:fillColor:borderWidth:topLeftColor:bottomRightColor:
Draw the rectangle using the given attributes.
Note: This is a *very* simple implementation
frameOval:color:
frameOval:width:color:
frameRectangle:color:
frameRectangle:width:color:
Draw a frame around the given rectangle
frameRectangle:width:colors:dashes:
Draw a rectangle with the given width, colors and dash lengths.
frameRectangle:width:colors:dashes:offset:
Draw a rectangle with the given width, colors and dash lengths.
The offset specifies how the coordinate system is translated from the screen origin
(infinite forms are 0@0 screen based).
fullDraw:
fullDrawMorph:
image:at:
Note: This protocol is deprecated. Use #paintImage: instead.
image:at:rule:
Note: This protocol is deprecated. Use one of the explicit image drawing messages (#paintImage, #drawImage) instead.
image:at:sourceRect:rule:
Note: The public use of this protocol is deprecated. It will become private. Nobody in the outside world must assume that a thing like a combination rule has any specific effect.
image:at:sourceRect:rule:alpha:
Privately used for blending forms w/ constant alpha. Fall back to simpler case by defaul.
imageWithOpaqueWhite:at:
Note: This protocol is deprecated. Use #drawImage: instead
isBalloonCanvas
isPostscriptCanvas
isShadowDrawing
isVisible:
Return true if the given rectangle is (partially) visible
line:to:brushForm:
Obsolete - will be removed in the future
line:to:color:
line:to:width:color:
Draw a line using the given width and color
line:to:width:color:dashLength:secondColor:secondDashLength:startingOffset:
Draw a line using the given width, colors and dash lengths.
Originally written by Stephan Rudlof; tweaked by Dan Ingalls
to use startingOffset for sliding offset as in 'ants' animations.
Returns the sum of the starting offset and the length of this line.
line:to:width:color:stepWidth:secondWidth:secondColor:secondStepWidth:
Draw a line using the given width, colors and steps; both steps can
have different stepWidths (firstStep, secondStep), draw widths and
colors.
line:to:width:colors:dashes:startingOffset:
Draw a line using the given width, colors and dash lengths.
Dash lengths are considered as multiples of width.
origin
Return the current origin for drawing operations
paintImage:at:
Draw the given Form, which is assumed to be a Form or ColorForm following the convention that zero is the transparent pixel value.
paintImage:at:sourceRect:
Draw the given Form, which is assumed to be a Form or ColorForm following the convention that zero is the transparent pixel value.
paragraph:bounds:color:
Draw the given paragraph
point:color:
Obsolete - will be removed in the future
preserveStateDuring:
Preserve the full canvas state during the execution of aBlock
render:
Do some 3D operations with the object if possible
reset
Reset the canvas.
roundCornersOf:during:
roundCornersOf:in:during:
seesNothingOutside:
Return true if this canvas will not touch anything outside aRectangle
shadowColor
Return the current override color or nil if no such color exists
shadowColor:
Set a shadow color. If set this color overrides any client-supplied color.
stencil:at:color:
Flood this canvas with aColor wherever stencilForm has non-zero pixels
stencil:at:sourceRect:color:
Flood this canvas with aColor wherever stencilForm has non-zero pixels
text:at:font:color:
OBSOLETE
text:bounds:font:color:
OBSOLETE
transform2By:clippingTo:during:smoothing:
an attempt to use #displayInterpolatedOn: instead of WarpBlt.
transformBy:clippingTo:during:
Transform the receiver by the given display transformation during the execution of aBlock. The given clip rectangle defines the *global* (e.g., outer) rectangle against which the receiver should clip (which would be equivalent to 'self clipRect: aClipRect; transformBy: aDisplayTransform').
transformBy:clippingTo:during:smoothing:
Transform the receiver by the given display transformation during the execution of aBlock. The given clip rectangle defines the *global* (e.g., outer) rectangle against which the receiver should clip (which would be equivalent to 'self clipRect: aClipRect; transformBy: aDisplayTransform').
translateBy:clippingTo:during:
translateBy:during:
Set a translation only during the execution of aBlock.
translateTo:clippingTo:during:
Set a new origin and clipping rectangle only during the execution of aBlock.
translucentImage:at:
Draw a translucent image using the best available way of representing translucency.
translucentImage:at:sourceRect:
Draw a translucent image using the best available way of representing translucency.
Note: This will be fixed in the future.
warpImage:transform:
Warp the given form using aTransform
warpImage:transform:at:
Warp the given form using aTransform.
TODO: Use transform to figure out appropriate cell size
warpImage:transform:at:sourceRect:cellSize:
Warp the given using the appropriate transform and offset.
CircleMorph
I am a specialization of EllipseMorph that knows enough to remain circular.
addFlexShellIfNecessary
When scaling or rotating from a halo, I can do this without a flex shell
bounds:
extent:
heading:
Set the receiver's heading (in eToy terms).
Note that circles never use flex shells.
initialize
initialize the state of the receiver
initializeToStandAlone
Set up the receiver, created by a #basicNew and now ready to be initialized, as a fully-formed morph suitable for providing a graphic for a parts bin surrogate, and, when such a parts-bin surrogate is clicked on, for attaching to the hand as a viable stand-alone morph. Because of historical precedent, #initialize has been expected to handle this burden, though a great number of morphs actually cannot stand alone. In any case, by default we call the historical #initialize, though unhappily, so that all existing morphs will work no worse than before when using this protocol.
privateMoveBy:
Private! Use 'position:' instead.
referencePosition
Return the current reference position of the receiver
rotationCenter
Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationCenter:
Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationDegrees
Default implementation.
rotationDegrees:
setRotationCenterFrom:
Called by halo rotation code.
Circles store their referencePosition.
transformedBy:
ClippingCanvas
A modified canvas which clips all drawing commands.
apply:
apply the given block to the inner canvas with clipRect as the clipping rectangle
canvas:clipRect:
clipRect
Return the currently active clipping rectangle
contentsOfArea:into:
Return the contents of the given area
form
isBalloonCanvas
isShadowDrawing
shadowColor
Return the current override color or nil if no such color exists
CollapsedMorph
A CollapsedMorph is xxxxxxxxx.
Instance Variables
uncollapsedMorph: <Object>
uncollapsedMorph
- xxxxx
beReplacementFor:
buildWindowMenu
Answer the menu to be put up in response to the user's clicking on the window-menu control in the window title. Specialized for CollapsedMorphs.
collapseOrExpand
Toggle the expand/collapsd state of the receiver. If expanding, copy the window title back to the name of the expanded morph
uncollapseToHand
Hand the uncollapsedMorph to the user, placing it in her hand, after remembering appropriate state for possible future use
wantsExpandBox
Answer whether I'd like an expand box
ColorMappingCanvas
A ColorMappingCanvas is xxxxxxxxx.
Instance Variables
myCanvas: <Object>
myCanvas
- xxxxx
clipBy:during:
Set a clipping rectangle active only during the execution of aBlock.
Note: In the future we may want to have more general clip shapes - not just rectangles
clipRect
Return the currently active clipping rectangle
depth
drawPolygon:color:borderWidth:borderColor:
Draw the given polygon.
drawString:from:to:in:font:color:
Draw the given string in the given font and color clipped to the given rectangle. If the font is nil, the default font is used.
drawString:from:to:in:font:color:underline:underlineColor:strikethrough:strikethroughColor:
Draw the given string in the given font and color clipped to the given rectangle. If the font is nil, the default font is used.
extent
Return the physical extent of the output device
fillOval:color:borderWidth:borderColor:
Fill the given oval.
flush
form
frameAndFillRectangle:fillColor:borderWidth:borderColor:
Draw the rectangle using the given attributes
frameAndFillRectangle:fillColor:borderWidth:topLeftColor:bottomRightColor:
Draw the rectangle using the given attributes
image:at:sourceRect:rule:
Draw the given form. For the 'paint' combination rule use stenciling otherwise simply fill the source rectangle.
isShadowDrawing
line:to:width:color:
Draw a line using the given width and color
mapColor:
on:
origin
Return the current origin for drawing operations
paragraph:bounds:color:
Draw the given paragraph
preserveStateDuring:
Preserve the full canvas state during the execution of aBlock
reset
Reset the canvas.
stencil:at:color:
Flood this canvas with aColor wherever stencilForm has non-zero pixels
stencil:at:sourceRect:color:
Flood this canvas with aColor wherever stencilForm has non-zero pixels
transformBy:clippingTo:during:smoothing:
Transform the receiver by the given display transformation during the execution of aBlock. The given clip rectangle defines the *global* (e.g., outer) rectangle against which the receiver should clip (which would be equivalent to 'self clipRect: aClipRect; transformBy: aDisplayTransform').
translateBy:clippingTo:during:
Set a translation and clipping rectangle only during the execution of aBlock.
translateBy:during:
Set a translation only during the execution of aBlock.
translateTo:clippingTo:during:
Set a new origin and clipping rectangle only during the execution of aBlock.
ColorPatchCanvas
I generate patches of Morphic worlds that views below certain Morphs. This facility is used for the end-user scripting system.
clipBy:during:
Set a clipping rectangle active only during the execution of aBlock.
Note: In the future we may want to have more general clip shapes - not just rectangles
doStop
doStop:
foundMorph
foundMorph:
fullDrawMorph:
preserveStateDuring:
Preserve the full canvas state during the execution of aBlock.
Note: This does *not* include the state in the receiver (e.g., foundMorph).
reset
Initialize the receiver to act just as a FormCanvas
setForm:
Initialize the receiver to act just as a FormCanvas
stopMorph
stopMorph:
transformBy:clippingTo:during:smoothing:
Note: This method has been originally copied from TransformationMorph.
translateBy:clippingTo:during:
Set a translation and clipping rectangle only during the execution of aBlock.
translateBy:during:
Set a translation only during the execution of aBlock.
translateTo:clippingTo:during:
Set a new origin and clipping rectangle only during the execution of aBlock.
ColorPickerMorph
A gui for setting color and transparency. Behaviour can be changed with the Preference modalColorPickers.
addCustomMenuItems:hand:
Add custom menu items
addToWorld:near:
anchorAndRunModeless:
If user clicks on the drag-dot of a modal picker,
anchor it, and change to modeless operation.
argument
argument:
argumentsWith:
Return an argument array appropriate to this action selector
bestPositionNear:inWorld:
buildChartForm
choseModalityFromPreference
Decide whether to be modal or not by consulting the prevailing preference
colorPaletteForDepth:extent:
containsPoint:
delete
The moment of departure has come.
If the receiver has an affiliated command, finalize it and have the system remember it.
In any case, delete the receiver
deleteAllBalloons
deleteOnMouseUp
deleteOnMouseUp:
drawOn:
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
indicateColorUnderMouse
Track the mouse with the special eyedropper cursor, and accept whatever color is under the mouse as the currently-chosen color; reflect that choice in the feedback box, and return that color.
inhibitDragging
initialize
Initialize the receiver. Obey the modalColorPickers preference when deciding how to configure myself. This is not quite satisfactory -- we'd like to have explicit calls tell us things like whether whether to be modal, whether to allow transparency, but for the moment, in grand Morphic fashion, this is rather inflexibly all housed right here
initializeForPropertiesPanel
Initialize the receiver. If beModal is true, it will be a modal color picker, else not
initializeModal:
Initialize the receiver. If beModal is true, it will be a modal color picker, else not
isLikelyRecipientForMouseOverHalos
localeChanged
locationIndicator
modalBalloonHelpAtPoint:
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
noColorCaption
originalColor:
Set the receiver's original color. It is at this point that a command is launched to represent the action of the picker, in support of Undo.
perniciousBorderColor
pickColorAt:
pickUpColorFor:
Show the eyedropper cursor, and modally track the mouse through a mouse-down and mouse-up cycle
positionOfColor:
Compute the position of the given color in the color chart form
putUpFor:near:
Put the receiver up on the screen. Note highly variant behavior depending on the setting of the #modalColorPickers preference
selectedColor
selector
selector:
Set the selector to be associated with the receiver. Store it in the receiver's command, if appropriate
sourceHand
sourceHand:
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
target
target:
Morphs with targets will override. This backstop does nothing.
toggleDeleteOnMouseUp
toggleUpdateContinuously
trackColorAt:
Before the mouse comes down in a modal color picker, track the color under the cursor, and show it in the feedback box, but do not make transparency changes
trackColorUnderMouse
Track the mouse with the special eyedropper cursor, and accept whatever color is under the mouse as the currently-chosen color; reflect that choice in the feedback box, and return that color.
updateAlpha:
updateColor:feedbackColor:
Set my selected color to the given color if it is different. Give user feedback. Inform the target of the change if the target and selector are not nil.
updateContinuously
updateContinuously:
updateSelectorDisplay
updateTargetColor
updateTargetColorWith:
Update the target so that it reflects aColor as the color choice
Command
An object representing an undoable command to be done in the environment.
Structure:
phase indicates whether the cmd is current in undone or redone mode
cmdWording The wording of the command (used in arming the "undo"/"redo" menu items
parameters an IdentityDictionary /NOT USED/
undoTarget Receiver, selector and arguments to accomplish undo
undoSelector
undoArguments
redoTarget Receiver, selector and arguments to accomplish redo
redoSelector
redoArguments
To use this, for any command you wish to use, you
* Create an instance of Command, as follows...
cmd _ Command new cmdWording: 'resizing'.
* Give the the command undo state and redo state, as follows...
cmd undoTarget: target selector: #extent: argument: oldExtent.
cmd redoTarget: target selector: #extent: argument: newExtent.
* Send a message of the form
Command rememberCommand: cmd
LastCommand is the last command that was actually done or undone.
CommandHistory, applicable only when infiniteUndo is set, holds a 'tape' of the complete history of commands, as far back as it's possible to go.
CommandExcursions, also applicable only in the infiniteUndo case, and rather at the fringe even then, holds segments of former CommandHistory that have been lopped off because of variant paths taken.
assuredParameterDictionary
Private! Answer the parameters dictionary, creating it if necessary
cmdWording
Answer the wording to be used to refer to the command in a menu
cmdWording:
Set the wording to be used in a menu item referring to the receiver
doCommand
Do the command represented by the receiver. Not actually called by active current code, but reachable by the not-yet-unsealed promoteToCurrent: action.
parameterAt:
Answer the parameter stored at the given symbol, or nil if none
parameterAt:ifAbsent:
Answer the parameter stored at the aSymbol, but if none, return the result of evaluating aBlock
parameterAt:put:
Place aValue in the parameters dictionary using aSymbol as key
phase
Answer the phase of the command
phase:
Set the phase of the command to the supplied symbol
printOn:
Provide more detailed info about the receiver, put in for debugging, maybe should be removed
redoCommand
Perform the 'redo' operation
redoEnabled
redoNextCommand
redoTarget:selector:argument:
redoTarget:selector:arguments:
Give target morph a chance to refine its undo operation
stillValid
Answer whether the receiver is still valid.
undoCommand
Perform the 'undo' operation
undoEnabled
undoLastCommand
undoRedoButtons
undoTarget
undoTarget:selector:argument:
undoTarget:selector:arguments:
Give target morph a chance to refine its undo operation
veryDeepFixupWith:
ALL inst vars were weakly copied. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
ALL fields are weakly copied! Can't duplicate an object by duplicating a Command that involves it. See DeepCopier.
zapObsolete
CommandHistory
A CommandHistory is xxxxxxxxx.
Instance Variables
excursions: <Object>
history: <Object>
lastCommand: <Object>
excursions
- xxxxx
history
- xxxxx
lastCommand
- xxxxx
assureLastCommandStillValid
If the lastCommand is not valid, set it to nil; answer the lastCommand.
cantUndo
Called by client to indicate that the prior undoable command is no longer undoable
commandToUndo
Undo the last command, i.e. move backward in the recent-commands tape, if possible.
forgetAllGrabCommandsFrom:
historyIndexOfLastCommand
Answer which position of the CommandHistory list is occupied by the LastCommand
initialize
Subclasses should redefine this method to perform initializations on instance creation
lastCommand
Answer the last command done or undone
nextCommand
Answer the command object that would be sent the #redoCommand message if the user were to request Redo, or nil if none
nextCommandToUndo
promoteToCurrent:
Very unusual and speculative and unfinished!. Not currently reachable. For the real thing, we presumably march forward or backward from the current command pointer to the target command in an orderly fashion, doing or undoing each command in turn.
purgeAllCommandsSuchThat:
Remove a bunch of commands, as in [:cmd | cmd undoTarget == zort]
redoEnabled
Answer whether the redo command is currently available
redoMenuWording
Answer the wording to be used in a menu offering the current
Redo command
redoNextCommand
If there is a way to 'redo' (move FORWARD) in the undo/redo history tape, do it.
rememberCommand:
Make the supplied command be the 'LastCommand', and mark it 'done'
resetAllHistory
resetCommandHistory
CommandHistory allInstancesDo: [:ch | ch resetCommandHistory]
shutDown:
startUp:
undoEnabled
Answer whether there is an undoable command at the ready
undoLastCommand
Undo the last command, i.e. move backward in the recent-commands tape, if possible.
undoMenuWording
Answer the wording to be used in an 'undo' menu item
undoOrRedoCommand
This gives a feature comparable to standard Mac undo/redo. If the undo/redo action taken was a simple do or a redo, then undo it. But if the last undo/redo action taken was an undo, then redo it.
undoOrRedoMenuWording
Answer the wording to be used in a menu item offering undo/redo (i.e., the form used when the #infiniteUndo preference is false)
undoTo
Not yet functional, and not yet sent. Allow the user to choose a point somewhere in the undo/redo tape, and undo his way to there. Applicable only if infiniteUndo is set.
ComplexBorder
see BorderedMorph.
poly _ polygon250
baseColor _ Color blue twiceLighter.
border _ (ComplexBorder framed: 10) baseColor: poly color.
border frameRectangle: ((100@100 extent: 200@200) insetBy: -5) on: Display getCanvas.
baseColor _ Color red twiceLighter.
border _ (ComplexBorder framed: 10) baseColor: baseColor.
border drawPolygon: {100@100. 300@100. 300@300. 100@300} on: Display getCanvas.
border drawPolyPatchFrom: 100@200 via: 100@100 via: 200@100 to: 200@200 on: Display getCanvas.
border drawPolyPatchFrom: 100@100 via: 200@100 via: 200@200 to: 100@200 on: Display getCanvas.
border drawPolyPatchFrom: 200@100 via: 200@200 via: 100@200 to: 100@100 on: Display getCanvas.
border drawPolyPatchFrom: 200@200 via: 100@200 via: 100@100 to: 200@100 on: Display getCanvas.
border _ (ComplexBorder raised: 10) baseColor: poly color.
border drawPolygon: poly getVertices on: Display getCanvas
360 / 16.0 22.5
points _ (0 to: 15) collect:[:i| (Point r: 100 degrees: i*22.5) + 200].
Display getCanvas fillOval: (100@100 extent: 200@200) color: baseColor.
border drawPolygon: points on: Display getCanvas.
-1 to: points size + 1 do:[:i|
border drawPolyPatchFrom: (points atWrap: i) via: (points atWrap: i+1) via: (points atWrap: i+2) to: (points atWrap: i+3) on: Display getCanvas.
].
Display getCanvas fillOval: (100@100 extent: 200@200) color: baseColor.
0 to: 36 do:[:i|
border drawLineFrom: (Point r: 100 degrees: i*10) + 200 to: (Point r: 100 degrees: i+1*10) + 200
on: Display getCanvas.
].
drawPolygon:
Point r: 1.0 degrees: 10
MessageTally spyOn:[
Display deferUpdates: true.
t1 _ [1 to: 1000 do:[:i|
border drawLineFrom: (100@100) to: (300@100) on: Display getCanvas.
border drawLineFrom: (300@100) to: (300@300) on: Display getCanvas.
border drawLineFrom: (300@300) to: (100@300) on: Display getCanvas.
border drawLineFrom: (100@300) to: (100@100) on: Display getCanvas]] timeToRun.
Display deferUpdates: false.
].
MessageTally spyOn:[
Display deferUpdates: true.
t2 _ [1 to: 1000 do:[:i|
border drawLine2From: (100@100) to: (300@100) on: Display getCanvas.
border drawLine2From: (300@100) to: (300@300) on: Display getCanvas.
border drawLine2From: (300@300) to: (100@300) on: Display getCanvas.
border drawLine2From: (100@300) to: (100@100) on: Display getCanvas]] timeToRun.
Display deferUpdates: false.
].
colors
colorsForDirection:
Return an array of colors describing the receiver in the given direction
computeAltFramedColors
computeAltInsetColors
computeAltRaisedColors
computeColors
computeFramedColors
computeInsetColors
computeRaisedColors
drawLineFrom:to:on:
Here we're using the balloon engine since this is much faster than BitBlt w/ brushes.
drawPolyPatchFrom:to:on:usingEnds:
fillStyleForDirection:
Fill the given form describing the receiver's look at a particular direction
framePolygon2:on:
framePolygon:on:
Frame the given rectangle on aCanvas
frameRectangle:on:
Note: This uses BitBlt since it's roughly a factor of two faster for rectangles
intersectFrom:with:to:with:
Compute the intersection of two lines. Return nil if either
* the intersection does not exist, or
* the intersection is 'before' startPt, or
* the intersection is 'after' endPt
isComplex
Answer true if receiver is a Complex number. False by default.
releaseCachedState
Release any associated cached state
style
style:
trackColorFrom:
If necessary, update our color to reflect a change in aMorphs color
widthForRounding
CornerGripMorph
I am the superclass of a hierarchy of morph specialized in allowing the user to resize windows.
defaultHeight
defaultWidth
initialize
initialize the state of the receiver
mouseDown:
Remember the receiver and target offsets too.
mouseMove:
Track the mouse for resizing.
target
Answer the target.
target:
Morphs with targets will override. This backstop does nothing.
targetPoint
Answer the reference point of the target.
targetPoint:
Set the reference point of the target.
Cubic
I am a segment between to points. In the form of a cubic polynomial that can be evaluated between 0..1 to obtain the end points and intermediate values.
bestSegments
Return the smallest integer number of segments that give the
best curve.
calcEnoughSegments
Find the power of two that represents a sufficient number of
segments for this cubic.
The measure is the sum of distances for the segments.
We want this to be close enough not affect the straightness of
the drawn lines. Which means within one pixel.
enough:withMeasure:withIn:
See comment in calcEnoughSegments for which I am a helper
honeIn:
Find if there is a smaller n than enough that give the same
measure for n.
honeIn:step:measure:withIn:
Pick the best n by binary search.
leeway
How close can measure be
measureFor:
Return a distance measure for cubic curve with n segments.
For convienence and accuracy we use the sum of the
distances.
with:with:with:with:
CurveMorph
This is really only a shell for creating Shapes with smooth outlines.
arrowPrototype
initialize
initialize the state of the receiver
initializeToStandAlone
Set up the receiver, created by a #basicNew and now ready to be initialized, as a fully-formed morph suitable for providing a graphic for a parts bin surrogate, and, when such a parts-bin surrogate is clicked on, for attaching to the hand as a viable stand-alone morph. Because of historical precedent, #initialize has been expected to handle this burden, though a great number of morphs actually cannot stand alone. In any case, by default we call the historical #initialize, though unhappily, so that all existing morphs will work no worse than before when using this protocol.
isCurvier
Test used by smoothing routines. If true use true closed curve splines for closed curves. If not mimic old stodgy curveMorph curves with one sharp bend. Curve overrides this test for backward compatability..
CurvierMorph
I want to be merged into PolygonMorph.
I implement Closed Cubic Curves and restructured routines to ease maintence and development.
New way to calculate curves.
cVariables
SlopeConstantsCache anArray size 2 indexed by nVerts \\2 .
Each element is an array of integers. The integers represent the constants for
calculating slopes for closed cubic curves from the vertices.
Class Variable SlopeConstantsCache holds a pair of arrays for even and odd number of vertices( aka knots).
Each array holds a series of constants in Integer form.
This allows slopes to be calculated directly from the array of knots.
Wonderfully it turns out that only two arrays are needed.
By matching up the knots equidistant from the point in question;
Summing the weighted differences of the pairs the unscaled slope can be arrived at.
The scale needed to get the slopes needed is trice the reciprical of the next integer in the series.
We leave the division til last to get the full benifit of the integer arithmetic.
Rounding the vertices before calculation is recommended.
Instead of calculating the number of curve subsegments in lineSegDo we add a ninth array to curve state to allow the number to be precalculated.
Getting better looking curves motivates finding a better way of guessing n. So this provides a framework for trying.
For the first pass we just used the constant 12 for every thing.
In the second pass we judge the number of segments by starting with two and doubling the number until the distance of the curve no longer increases.
Then we hone in using a binary search to find the smallest number of segments with that same curve length.
We have changed some assumptions. Previously curves were figured by solving for the second derivative first and using the results to determine the slope and the third derivative. So lineSegDo counted on the last second deriv being a number it could use in its calculation of the number of subsegments.
Currently we just solve for slopes and the second and third derivs are derived from that.
Also the derivation for the second and third derivs only assume C(1) (first derivitive continuity). The calculations for the slopes are the only calcs using C(2) continuity. Therefore the slopes can alternately be chosen to fit some other chriteria and the resulting curves will still be smooth to the first degree.
A useful variant of closed slopes is to scale them by a constant.
Also the last of each element of curvestate always reflects a closing segment. And we don't add an extra row for closed curves anymore.
That is now lineSegDo's responsibility to be aware of as it was already doing with segmented curves. So the last n does not track its old value.
Preferences:
A Preference has been added to toggle between the old (ugly) closed curves based on natural cubic slopes and the new smooth algorythim. This doesn't make much difference while newcurves are a subclass of polygons but the ambition is for newcurves to supercede polygons. This will allow backwards compatibility.
Shapes: With closed curves a smooth oval results from rectagular or diamond vertices. So two menuitems have been added (to PolygonMorph) that allow the vertices to be set to these shapes using the current bounds of the polygon. The former state of vertices will be lost but it seems useful to lose a complicated shape and start fresh with a simple symmetrical one.
Furthur on: Modify curveState to only contain slope and higher deriv information. Let the information about the knots only be held only in the vertices of the polygon. Once that is done curvestate will not have to be recalcutaled each time the polygon is moved but only when its shape changes.
There is also some possible speed up to be had by refining or experimenting with other number of segment calculating schemes but not as much as preserving curvestate over a move.
Furthur furthur on: Figure out how to combine straight and curved segments into a single shape in a pleasing way.
initialize
We use an oval shape because we wear it well.
registerInFlapsRegistry
DamageRecorder
A DamageRecorder is xxxxxxxxx.
Instance Variables
invalidRects: <Object>
totalRepaint: <Object>
invalidRects
- xxxxx
totalRepaint
- xxxxx
doFullRepaint
Record that a full redisplay is needed. No further damage rectangles will be recorded until after the next reset.
invalidRectsFullBounds:
Return a collection of damaged rectangles for the given canvas. If a total repaint has been requested, return the given rectangle.
new
recordInvalidRect:
Record the given rectangle in my damage list, a list of rectangular areas of the display that should be redraw on the next display cycle.
reset
Clear the damage list.
updateIsNeeded
Return true if the display needs to be updated.
DockingBarMorph
A DockingBarMorph is xxxxxxxxx.
Instance Variables
activeSubMenu: <Object>
autoGradient: <Object>
avoidVisibleBordersAtEdge: <Object>
fillsOwner: <Object>
gradientRamp: <Object>
originalColor: <Object>
selectedItem: <Object>
activeSubMenu
- xxxxx
autoGradient
- xxxxx
avoidVisibleBordersAtEdge
- xxxxx
fillsOwner
- xxxxx
gradientRamp
- xxxxx
originalColor
- xxxxx
selectedItem
- xxxxx
aboutToBeGrabbedBy:
The morph is about to be grabbed, make it float
activate:
Receiver should be activated; e.g., so that control passes
correctly.
activeSubmenu:
add:font:icon:help:subMenu:
Append the given submenu with the given label.
add:icon:help:subMenu:
Append the given submenu with the given label.
add:icon:subMenu:
Append the given submenu with the given label.
add:subMenu:
Append the given submenu with the given label.
addBlankIconsIfNecessary:
If any of my items have an icon, ensure that all do by using
anIcon for those that don't
addCustomMenuItems:hand:
Populate aMenu with appropriate menu items for a
yellow-button (context menu) click.
addDefaultSpace
Add a new space of the given size to the receiver.
addLine
Append a divider line to this menu. Suppress duplicate lines.
addSpace:
Add a new space of the given size to the receiver.
addSpacer
Add a new spacer to the receiver.

Spacer are objects that try to use as much space as they can
adhereTo:
Private - Instruct the receiver to adhere to the given edge.

Options: #left #top #right #bottom or #none
adhereToBottom
Instract the receiver to adhere to bottom
adhereToLeft
Instract the receiver to adhere to left
adhereToRight
Instract the receiver to adhere to right
adhereToTop
Instract the receiver to adhere to top
adoptPaneColor:
Change our color too.
autoGradient
Answer if the receiver is in autoGradient mode
autoGradient:
Instruct the receiver to fill the owner or not
autoGradientString
Answer the string to be shown in a menu to represent the
'resistsRemoval' status
avoidVisibleBordersAtEdge
Answer if the receiver is in avoidVisibleBordersAtEdge mode
avoidVisibleBordersAtEdge:
Instruct the receiver to avoid showing the borders at edge
avoidVisibleBordersAtEdgeString
Answer the string to be shown in a menu to represent the
'resistsRemoval' status
beFloating
Instract the receiver to be floating
color:
Set the receiver's color.
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
deleteIfPopUp:
edgeToAdhereTo
private - answer the edge where the receiver is adhering to
extent:
Change the receiver's extent.
optimized to not keep updating the (gradient) color!
fillsOwner
Answer if the receiver is in fillOwner mode
fillsOwner:
Instruct the receiver to fill the owner or not
fillsOwnerString
Answer the string to be shown in a menu to represent the
'resistsRemoval' status
gradientRamp
gradientRamp:
handleFocusEvent:
Handle focus events. Valid menu transitions are determined based on the menu currently holding the focus after the mouse went down on one of its children.
initialize
initialize the receiver
isAdheringToBottom
Answer true if the receiver is adhering to bottom
isAdheringToLeft
Answer true if the receiver is adhering to left
isAdheringToRight
Answer true if the receiver is adhering to right
isAdheringToTop
Answer true if the receiver is adhering to top
isDockingBar
Return true if the receiver is a docking bar
isFloating
Answer true if the receiver has a float layout
isHorizontal
Answer true if the receiver has a horizontal layout
isVertical
Answer true if the receiver has a vertical layout
justDroppedInto:event:
This message is sent to a dropped morph after it has been dropped on -- and been accepted by -- a drop-sensitive morph
morphicLayerNumber
helpful for insuring some morphs always appear in front of or
behind others. smaller numbers are in front
noteNewOwner:
I have just been added as a submorph of aMorph
originalColor
Answer the original color.
ownerChanged
The receiver's owner has changed its layout.
predominantDockingBarsOfChastes:
Private - Answer a collection of the docking bar of my owner
that are predominant to the receiver.

By 'predominant' we mean docking bar that have the right to
get a position before the receiver.

The predominance of individual living in the same chaste is
determinated by the arrival order.
rootMenu
roundedCorners
Return a list of those corners to round
selectItem:event:
selectedItem
setDefaultParameters
private - set the default parameter using Preferences as the inspiration source
snapToEdgeIfAppropriate
squeakMenu
stayUp
toggleAutoGradient
toggleAvoidVisibleBordersAtEdge
toggleFillsOwner
updateBounds
private - update the receiver's bounds
updateColor
private - update the receiver's color
updateExtent
private - update the receiver's extent
updateLayoutProperties
private - update the layout properties based on adhering,
fillsOwner and avoidVisibleBordersAtEdge preferencs
updatePosition
private - update the receiver's position.
Fixed so as not to keep changing position!
(called twice if adhereing)
usedHeightByPredominantDockingBarsOfChastes:
Private - convenience
usedWidthByPredominantDockingBarsOfChastes:
Private - convenience
wantsToBeTopmost
Answer if the receiver want to be one of the topmost objects in
its owner
wantsYellowButtonMenu
Answer true if the receiver wants a yellow button menu.
Fixed for when generalizedYellowButtonMenu pref is off
DropEvent
A DropEvent is xxxxxxxxx.
Instance Variables
contents: <Object>
position: <Object>
wasHandled: <Object>
contents
- xxxxx
position
- xxxxx
wasHandled
- xxxxx
contents
copyHandlerState:
Copy the handler state from anEvent. Used for quickly transferring handler information between transformed events.
cursorPoint
For compatibility with mouse events
isDropEvent
position
Since cursorPoint is defined and refers to position it should be defined
here as well
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
resetHandlerFields
Reset anything that is used to cross-communicate between two eventual handlers during event dispatch
sentTo:
Dispatch the receiver into anObject
setPosition:contents:hand:
transformBy:
Transform the receiver into a local coordinate system.
transformedBy:
Return the receiver transformed by the given transform into a local coordinate system.
type
Return a symbol indicating the type this event.
wasHandled
Return true if this event was handled. May be ignored for some types of events.
wasHandled:
Determine if this event was handled. May be ignored for some types of events.
DropFilesEvent
A DropFilesEvent is xxxxxxxxx.
Instance Variables
sentTo:
Dispatch the receiver into anObject
type
Return a symbol indicating the type this event.
EditCommand
This class handles all paragraph surgery in VI. In general, subclasses of EditCommand should be able to rely on the super class' undo/redo machinery -- only the repeat command needs to be overridden in most cases. This assumes, of course, that the newText, replacedText, newTextInterval, and replacedTextInterval have been set correctly.
When setting the interval, use normal mode style selections, not insert mode selections (see class comment of VIMorphEditor).
Possible useful expressions for doIt or printIt.
Structure:
instVar1 type -- comment about the purpose of instVar1
instVar2 type -- comment about the purpose of instVar2
Any further useful comments about the general approach of this implementation.
doCommand
doSelectionInterval
iEditCommand
newText
newText:
newTextInterval
newTextInterval:
pEditor
phase
phase:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
redoCommand
Debug dShow: ('rInterval: ', replacedTextInterval asString, '. rText: ', replacedText string, ' nInterval: ', newTextInterval asString, ' nText: ', newText string).
redoSelectionInterval
Return an interval to be displayed as a subtle selection after undo, or nil
replacedText
replacedText:
replacedTextInterval
replacedTextInterval:
textMorph:replacedText:replacedTextInterval:newText:newTextInterval:
textMorphEditor
textMorphString
textMorphStringSize
undoCommand
Debug dShow: ('new Interval: ', newTextInterval asString, '. rText: ', replacedText string).
undoSelection
Return an interval to be displayed as a selection after undo, or nil
undoSelectionInterval
Return an interval to be displayed as a selection after undo, or nil
EllipseMidpointTracer
An EllipseMidpointTracer is xxxxxxxxx.
Instance Variables
a: <Object>
aSquared: <Object>
b: <Object>
bSquared: <Object>
d1: <Object>
d2: <Object>
inFirstRegion: <Object>
rect: <Object>
x: <Object>
y: <Object>
a
- xxxxx
aSquared
- xxxxx
b
- xxxxx
bSquared
- xxxxx
d1
- xxxxx
d2
- xxxxx
inFirstRegion
- xxxxx
rect
- xxxxx
x
- xxxxx
y
- xxxxx
on:
stepInY
Step to the next y value
EllipseMorph
A round BorderedMorph. Supports borderWidth and borderColor.
Only simple borderStyle is implemented.
EllipseMorph new borderWidth:10; borderColor: Color green; openInWorld.
EllipseMorph new borderStyle:(SimpleBorder width: 5 color: Color blue); openInWorld.
areasRemainingToFill:
Could be improved by quick check of inner rectangle
bottomLeftCorner
bottomRightCorner
canDrawBorder:
Return true if the receiver can be drawn with the given border style.
canHaveFillStyles
Return true if the receiver can have general fill styles; not just colors.
This method is for gradually converting old morphs.
closestPointTo:
account for round corners. Still has a couple of glitches at upper left and right corners
containsPoint:
cornerStyle:
Set the receiver's corner style. But, in this case, do *not*
couldHaveRoundedCorners
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
doesBevels
To return true means that this object can show bevelled borders, and
therefore can accept, eg, #raised or #inset as valid borderColors.
Must be overridden by subclasses that do not support bevelled borders.
drawOn:
intersectionWithLineSegmentFromCenterTo:
account for round corners. Still has a couple of glitches at upper left and right corners
topLeftCorner
topRightCorner
EventHandler
Events in Morphic originate in a Hand, pass to a target morph, and are then dispatched by an EventHandler. EventHandlers support redirection of mouse and keyboard activity by specifying and independent recipient object and message selector for each of the possible events. In addition each eventHandler can supply an optional value parameter for distinguishing between, eg, events from a number of otherwise identical source morphs.
The basic protocol of an event handler is to receive a message of the form
mouseDown: event in: targetMorph
and redirect this as one of
mouseDownRecipient perform: mouseDownSelector0
mouseDownRecipient perform: mouseDownSelector1 with: event
mouseDownRecipient perform: mouseDownSelector2 with: event with: targetMorph
mouseDownRecipient perform: mouseDownSelector3 with: event with: targetMorph with: valueParameter
depending on the arity of the mouseDownSelector.
allRecipients
Answer a list, without duplication, of all the objects serving as recipients to any of the events I handle. Intended for debugging/documentation use only
click:fromMorph:
This message is sent only when double clicks are handled.
doubleClick:fromMorph:
doubleClickTimeout:fromMorph:
firstMouseSelector
Answer the selector corresponding to the first mouse-handling selector fielded. Created in support of providing balloon-help for halo handles, triggered by the selector handled
fixReversedValueMessages
ar 3/18/2001: Due to the change in the ordering of the value parameter old event handlers may have messages that need to be fixed up. Do this here.
handlesClickOrDrag:
handlesGestureStart:
Does the associated morph want to handle gestures?
handlesKeyboard:
handlesMouseDown:
handlesMouseMove:
handlesMouseOver:
handlesMouseOverDragging:
handlesMouseStillDown:
keyStroke:fromMorph:
messageList
Return a list of 'Class selector' for each message I can send. tk
9/13/97
methodRefList
Return a MethodReference for each message I can send. tk 9/13/97, raa
5/29/01
mouseDown:fromMorph:
Take double-clicks into account.
mouseDownSelector
mouseEnter:fromMorph:
mouseEnterDragging:fromMorph:
mouseLeave:fromMorph:
mouseLeaveDragging:fromMorph:
mouseMove:fromMorph:
mouseStillDown:fromMorph:
mouseStillDownRecipient
mouseStillDownSelector
mouseUp:fromMorph:
mouseUpSelector
on:send:to:
on:send:to:withValue:
onGestureSend:to:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
replaceSendsIn:with:
Replace all the sends that occur in array1 with those in array2. Used for fixing old event handlers in files.
send:to:withEvent:fromMorph:
startDrag:fromMorph:
veryDeepFixupWith:
ALL inst vars were weakly copied. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
ALL fields are weakly copied! Can't duplicate an object by duplicating a button that activates it. See DeepCopier.
FileDirectoryWrapper
A FileDirectoryWrapper is xxxxxxxxx.
Instance Variables
balloonText: <Object>
hasContents: <Object>
itemName: <Object>
balloonText
- xxxxx
hasContents
- xxxxx
itemName
- xxxxx
asString
Answer a string that represents the receiver.
balloonText
balloonText:
contents
directoryNamesFor:
hasContents
Return whether this directory has subfolders. The value is cached to
avoid a performance penalty. Also for performance reasons, the code
below will just assume that the directory does indeed have contents in a
few of cases:
1. If the item is not a FileDirectory (thus avoiding the cost
of refreshing directories that are not local)
2. If it's the root directory of a given volume
3. If there is an error computing the FileDirectory's contents
icon
Answer a form to be used as icon
setItem:name:model:
settingSelector
with:name:model:
FileList
Some variations on FileList that
- use a hierarchical pane to show folder structure
- use different pane combinations, button layouts and prefiltering for specific uses
FileList2 morphicView openInWorld "an alternative to the standard FileList"
FileList2 morphicViewNoFile openInWorld "useful for selecting, but not viewing"
FileList2 morphicViewProjectLoader openInWorld "useful for finding and loading projects"
FileList2 modalFolderSelector "allows the user to select a folder"
acceptDroppingMorph:event:inMorph:
addButtonsAndFileListPanesTo:at:plus:forFileList:
addFullPanesTo:from:
addNew:byEvaluating:
A parameterization of earlier versions of #addNewDirectory and
#addNewFile. Fixes the bug in each that pushing the cancel button
in the FillInTheBlank dialog gave a walkback.
addNewDirectory
addNewFile
addPath:
Add the given string to the list of recently visited directories.
addVolumesAndPatternPanesTo:at:plus:forFileList:
allRegisteredServices
askServerInfo
Get the user to create a ServerDirectory for a new server. Fill in and say Accept.
blueButtonForService:textColor:inWindow:
blueButtonText:textColor:color:inWindow:
blueButtonText:textColor:color:inWindow:balloonText:selector:recipient:
blueButtonText:textColor:inWindow:
blueButtonText:textColor:inWindow:balloonText:selector:recipient:
buttonSelectorsToSuppress
Answer a list of action selectors whose corresponding services we would prefer *not* to have appear in the filelist's button pane; this can be hand-jimmied to suit personal taste.
cancelHit
changeDirectoryTo:
Change directory as requested.
compressFile
Compress the currently selected file
contents
Answer the contents of the file, reading it first if needed.
copyName
Copy the current selector to the clipboard
currentDirectorySelected
defaultButtonPaneHeight
defaultContents
defaultEncoderFor:
This method just illustrates the stupidest possible implementation of encoder selection.
deleteDirectory
deleteFile
Delete the currently selected file
detectService:ifNone:
directory
directory:
Set the path of the volume to be displayed.
directoryChangeBlock:
directoryNamesFor:
item may be file directory or server directory
dragPassengerFor:inMorph:
dragTransferTypeForMorph:
dropDestinationDirectory:event:
Answer a FileDirectory representing the drop destination in the directory hierarchy morph dest
dynamicButtonServices
Answer services for buttons that may come and go in the button pane, depending on selection
enableTypeButtons:info:forDir:
endingSpecs
entriesMatching:
Answer a list of directory entries which match the patternString.
The patternString may consist of multiple patterns separated by ';'.
Each pattern can include a '*' or '#' as wildcards - see String>>match:
fileContentsMenu:shifted:
Construct aMenu to have items appropriate for the file browser's code pane, given the shift state provided
fileList
Answer the list of files in the current volume.
fileListIndex
Answer the index of the currently selected file.
fileListIndex:
Select the file name having the given index, and display its contents.
fileListMenu:
fileName
fileNameFormattedFrom:sizePad:
entry is a 5-element array of the form:
(name creationTime modificationTime dirFlag fileSize)
fileNameFromFormattedItem:
Extract fileName and folderString from a formatted fileList item string
fileSelectedMenu:
fileSelectionBlock:
folderString
fullFileListMenu:shifted:
Fill the menu with all possible items for the file list pane, regardless of
selection.
fullName
Answer the full name for the currently selected file; answer nil if no file is selected.
get
Get contents of file again, it may have changed. Do this by making the cancel string be the contents, and doing a cancel.
getEncodedText
getHex
Get contents of file again, and display in Hex. Do this by making the cancel string be the contents, and doing a cancel.
getSelectedDirectory
getSelectedFile
Answer a filestream on the selected file. If it cannot be opened for read/write, try read-only before giving up; answer nil if unsuccessful
hideSqueakletDirectoryBlock
importImage
Import the given image file and store the resulting Form in the default Imports
initialDirectoryList
initialize
Initialize the state of the receiver with its default contents.
isDirectoryList:
isFileSelected
return if a file is currently selected
isReaderNamedRegistered:
itemsForAnyFile
Answer a list of universal services that could apply to any file
itemsForDirectory:
itemsForFile:
Answer a list of services appropriate for a file of the given full name
itemsForNoFile
labelString
listForPatterns:
Make the list be those file names which match the pattern.
modalFileSelector
modalFileSelectorForSuffixes:
modalFileSelectorForSuffixes:directory:
modalFolderSelector
modalFolderSelector:
modalLoopOn:
modalView:
modelSleep
User has exited or collapsed the window -- close any remote connection.
modelWakeUp
User has entered or expanded the window -- reopen any remote connection.
morphicDirectoryTreePane
morphicDirectoryTreePaneFiltered:
morphicFileContentsPane
morphicFileListPane
morphicPatternPane
Remove the vertical scrollbar since the minHeight would otherwise
be too large to fit the layout frame. Added here for Pharo since
FileList2 has been merged into FileList.
morphicView
morphicViewFileSelector
morphicViewFileSelectorForSuffixes:
morphicViewFileSelectorForSuffixes:directory:
morphicViewFolderSelector
morphicViewFolderSelector:
morphicViewGeneralLoaderInWorld:
morphicViewImageViewer
morphicViewNoFile
morphicViewOnDirectory:
morphicViewProjectLoader
myServicesForFile:suffix:
noFileSelectedMenu:
offerAllFileOptions
Put up a menu offering all possible file options, whatever the suffix of the current selection may be. Specially useful if you're wanting to keep the menu up
okHit
okayAndCancelServices
Answer ok and cancel services
open
openAsMorph
Open a morph, as best one can, on the receiver
openEditorOn:editString:
openFileDirectly
openImageInWindow
Handle five file formats: GIF, JPG, PNG, Form stoteOn: (run coded), and
BMP. Fail if file format is not recognized.
openMorphOn:editString:
openMorphicViewInWorld
optionalButtonRow
Answer the button row associated with a file list
optionalButtonSpecs
Answer a list of services underlying the optional buttons in their initial inception.
optionalButtonSpecs:
pattern
pattern:
perform:orSendTo:
Selector was just chosen from a menu by a user.
If it's one of the three sort-by items, handle it specially.
If I can respond myself, then perform it on myself.
If not, send it to otherTarget, presumably the editPane from which the menu was invoked.
postOpen
primitiveCopyFileNamed:to:
Copied from VMMaker code.
This really ought to be a facility in file system. The major annoyance
here is that file types and permissions are not handled by current
Squeak code.
NOTE that this will clobber the destination file!
projectOnlySelectionBlock
projectOnlySelectionMethod:
prototypicalToolWindow
put:
Private - put the supplied text onto the file
putUpdate:
Put this file out as an Update on the servers.
readContentsAsEncoding:
readContentsBrief:
Read the contents of the receiver's selected file, unless it is too long, in which case show just the first 5000 characters. Don't create a file if it doesn't already exist.
readContentsCNGB
readContentsEUCJP
readContentsEUCKR
readContentsHex:
retrieve the contents from the external file unless it is too long.
Don't create a file here. Check if exists.
readContentsShiftJIS
readContentsUTF8
readOnlyStream
Answer a read-only stream on the selected file. For the various stream-reading services.
recentDirs
Put up a menu and let the user select from the list of recently visited directories.
registerFileReader:
registerInFlapsRegistry
registeredFileReaderClasses
return the list of classes that provide file reader services
release
Remove references to objects that may refer to the receiver. This message
should be overridden by subclasses with any cycles, in which case the
subclass should also include the expression super release.
removeObsolete
removeServer
renameFile
Rename the currently selected file
resort:
Re-sort the list of files.
selectEncoding
selectionBlockForSuffixes:
serviceAddNewDirectory
Answer a service entry characterizing the 'add new directory' command
serviceAddNewFile
Answer a service entry characterizing the 'add new file' command
serviceAllFileOptions
serviceBroadcastUpdate
Answer a service for broadcasting a file as an update
serviceCancel
Answer a service for hitting the cancel button
serviceCompressFile
Answer a service for compressing a file
serviceCopyName
serviceDeleteFile
serviceGet
Answer a service for getting the entire file
serviceGetEncodedText
serviceGetHex
serviceOkay
Answer a service for hitting the okay button
serviceOpenProjectFromFile
Answer a service for opening a .pr project file
serviceRenameFile
serviceSortByDate
Answer a service for sorting by date
serviceSortByName
Answer a service for soring by name
serviceSortBySize
Answer a service for sorting by size
serviceViewContentsInWorkspace
Answer a service for viewing the contents of a file in a workspace
servicesForFolderSelector
Answer the ok and cancel servies for the folder selector
servicesForProjectLoader
Answer the services to show in the button pane for the project loader
servicesFromSelectorSpecs:
Answer an array of services represented by the incoming symbols, eliminating any that do not have a currently-registered service. Pass the symbol #- along unchanged to serve as a separator between services
setFileStream:
Used to initialize a spawned file editor. Sets directory too.
setSelectedDirectoryTo:
sortBlock
Answer block to decide what order to display the directory entries.
sortByDate
sortByName
sortBySize
sortingByDate
sortingByName
sortingBySize
specsForImageViewer
suffixOf:
suffixOfSelectedFile
Answer the file extension of the receiver's selected file
textRow:
universalButtonServices
Answer the services to be reflected in the receiver's buttons
unload
unregisterFileReader:
update:
Receive a change notice from an object of whom the receiver is a dependent
update:in:fileTypeRow:morphUp:
updateButtonRow
Dynamically update the contents of the button row, if any.
updateDirectory
directory has been changed externally, by calling directory:.
Now change the view to reflect the change.
updateFileList
Update my files list with file names in the current directory
that match the pattern.
The pattern string may have embedded newlines or semicolons; these separate different patterns.
veryDeepFixupWith:
See if the dependents are being copied also. If so, point at the new copies. (The dependent has self as its model.)
Dependents handled in class Object, when the model is not a Model, are fixed up in Object veryDeepCopy.
viewContentsInWorkspace
View the contents of my selected file in a new workspace
volumeList
Answer the current list of volumes.
volumeListIndex
Answer the index of the currently selected volume.
volumeListIndex:
Select the volume name having the given index.
volumeMenu:
wantsDroppedMorph:event:inMorph:
windowColorSpecification
FillInTheBlankMorph
A FillInTheBlankMorph is xxxxxxxxx.
Instance Variables
done: <Object>
response: <Object>
responseUponCancel: <Object>
textPane: <Object>
done
- xxxxx
response
- xxxxx
responseUponCancel
- xxxxx
textPane
- xxxxx
accept
Sent by the accept button.
cancel
Sent by the cancel button.
codePaneMenu:shifted:
createAcceptButton
create the [accept] button
createCancelButton
create the [cancel] button
createQueryTextMorph:
create the queryTextMorph
createTextPaneExtent:acceptBoolean:topOffset:buttonAreaHeight:
create the textPane
defaultAnswerExtent
defaultColor
answer the default color/fill style for the receiver
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
extent:
change the receiver's extent
getUserResponse
Wait for the user to accept or cancel, and answer the result string. Answers the empty string if the user cancels.
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
initialize
initialize the state of the receiver
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
request:
request:initialAnswer:
request:initialAnswer:centerAt:
request:initialAnswer:centerAt:inWorld:
request:initialAnswer:centerAt:inWorld:onCancelReturn:
request:initialAnswer:centerAt:inWorld:onCancelReturn:acceptOnCR:
request:initialAnswer:centerAt:inWorld:onCancelReturn:acceptOnCR:answerExtent:
request:initialAnswer:centerAt:inWorld:onCancelReturn:acceptOnCR:answerHeight:
requestPassword:
requestPassword:initialAnswer:centerAt:inWorld:onCancelReturn:acceptOnCR:
response
response:
Sent when text pane accepts.
responseUponCancel:
selection
answers what is actually selected in the morph
selectionInterval
setDefaultParameters
change the receiver's appareance parameters
setPasswordQuery:initialAnswer:answerHeight:acceptOnCR:
setQuery:initialAnswer:answerExtent:acceptOnCR:
setQuery:initialAnswer:answerHeight:acceptOnCR:
undoGrabCommand
Return an undo command for grabbing the receiver
updateColor
update the recevier's fillStyle
updateColor:color:intensity:
update the apareance of aMorph
FlapTab
The tab associated with a flap.
nb: slidesOtherObjects and inboard are instance variables relating to disused features. The feature implementations still exist in the system, but the UI to them has been sealed off.
acquirePlausibleFlapID
Give the receiver a flapID that is globally unique; try to hit the mark vis a vis the standard system flap id's, for the case when this method is invoked as part of the one-time transition
adaptToWorld
addCustomMenuItems:hand:
Add further items to the menu as appropriate
addTitleForHaloMenu:
adjustPositionAfterHidingFlap
adjustPositionVisAVisFlap
applyEdgeFractionWithin:
Make the receiver reflect remembered edgeFraction
applyTabThickness:
applyThickness:
arrangeToPopOutOnDragOver:
arrangeToPopOutOnMouseOver:
assumeString:font:orientation:color:
balloonTextForFlapsMenu
Answer the balloon text to show on a menu item in the flaps menu that governs the visibility of the receiver in the current project
changeColor
Change the color of the receiver -- triggered, e.g. from a menu
changeFlapColor
changeTabSolidity
Presently no actual options associated with this menu item if the flap is currently alreadly solid, so entertain the user with an anuran sound. However, in latest scheme, the corresponding menu item is disabled in this circumstance, so this method is effectively unreachable.
changeTabText
Allow the user to change the text on the tab
changeTabText:
changeTabThickness
computeEdgeFraction
Compute and remember the edge fraction
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
destroyFlap
Destroy the receiver
dismissViaHalo
Dismiss the receiver (and its referent), unless it resists
dragoverString
Answer the string to be shown in a menu to represent the
dragover status
edgeFraction
edgeFraction:
Set my edgeFraction to the given number, without side effects
edgeString
edgeToAdhereTo
edgeToAdhereTo:
existingWording
fitContents
fitOnScreen
19 sept 2000 - allow flaps in any paste up
flapID
Answer the receiver's flapID, creating it if necessary
flapID:
Set the receiver's flapID
flapIDOrNil
If the receiver has a flapID, answer it, else answer nil
flapMenuTitle
flapShowing
givenID:matches:
graphicalTab
graphicalTabString
hideFlap
hideFlapUnlessBearingHalo
hideFlapUnlessOverReferent
Hide the flap unless the mouse is over my referent.
ifVertical:ifHorizontal:
Evaluate and return the value of either the first or the second block, depending whether I am vertically or horizontally oriented
inboard
inboard:
includeInNewMorphMenu
initialize
initialize the state of the receiver
isCurrentlySolid
Don't never use double negatives
isCurrentlyTextual
isFlapTab
isGlobalFlap
Answer whether the receiver is currently a shared flap
isGlobalFlapString
Answer a string to construct a menu item representing control
over whether the receiver is or is not a shared flap
labelString
lastReferentThickness:
Set the last remembered referent thickness to the given integer
layoutChanged
Fixed to always flush layout cache - finally tracked down
layout anomalies due to cached extents in layout
policies not being flushed, the previous (incorrect) assumption being
that it did not matter if layout was to be recomputed (fullBounds being nil).
Recomputing of the layout apparently does not flush so must be done here.
maybeHideFlapOnMouseLeave
maybeHideFlapOnMouseLeaveDragging
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
mouseMove:
The mouse moved while the butten was down in the receiver
mouseUp:
The mouse came back up, presumably after having dragged the tab. Caution: if not operating full-screen, this notification can easily be *missed*, which is why the edge-fraction-computation is also being done on mouseMove.
mouseoverString
Answer the string to be shown in a menu to represent the
mouseover status
notSolid
Answer whether the receiver is currenty not solid. Used for determining whether the #solidTab menu item should be enabled
objectForDataStream:
I am about to be written on an object file. If I am a global flap, write a proxy instead.
openFully
Make an educated guess at how wide or tall we are to be, and open to that thickness
orientation
ownerChanged
The receiver's owner, some kind of a pasteup, has changed its layout.
partsBinString
Answer the string to be shown in a menu to represent the
parts-bin status
permitsThumbnailing
positionObject:
anObject could be myself or my referent
positionObject:atEdgeOf:
anObject could be myself or my referent
positionReferent
preserveDetails
The receiver is being switched to use a different format. Preserve the existing details (e.g. wording if textual, grapheme if graphical) so that if the user reverts back to the current format, the details will be right
printOn:
Append a textual representation of the receiver to aStream
provideDefaultFlapIDBasedOn:
Provide the receiver with a default flap id
referentThickness
reformatTextualTab
The font choice possibly having changed, reformulate the receiver
roundedCorners
Return a list of those corners to round.
1-4
| |
2-3
Returned array contains `codes' of those corners, which should be rounded.
1 denotes top-left corner
2 denotes bottom-left corner
3 denotes bottom-right corner
4 denotes top-right corner.
Thus, if this method returned #(2 3) that would mean that bottom (left and right)
corners would be rounded whereas top (left and right) corners wouldn't be rounded.
This method returns #(1 2 3 4) and that means that all the corners should be rounded.
setEdge:
Set the edge as indicated, if possible
setEdgeToAdhereTo
setName:edge:color:
Set me up with the usual...
setToPopOutOnDragOver:
setToPopOutOnMouseOver:
sharedFlapsAllowed
Answer (for the benefit of a menu item for which I am the target) whether the system presently allows shared flaps
showFlap
Open the flap up
showFlapIfHandLaden:
The hand has drifted over the receiver with the button down. If the hand is carrying anything, show the flap. If the hand is empty, the likely cause is that it's manipulating a scrollbar or some such, so in that case don't pop the flap out.
slidesOtherObjects
solidTab
solidTabString
spanWorld
Fix for making the height/width of a solid tab be the same as the flap.
stickOntoReferent
Place the receiver directly onto the referent -- for use when the referent is being shown as a flap
tabSelected
The user clicked on the tab. Show or hide the flap. Try to be a little smart about a click on a tab whose flap is open but only just barely.
tabThickness
textualTab
textualTabString
thicknessString
toggleDragOverBehavior
toggleIsGlobalFlap
Toggle whether the receiver is currently a global flap or not
toggleMouseOverBehavior
togglePartsBinMode
transposeParts
The receiver's orientation has just been changed from vertical to horizontal or vice-versa.
useSolidTab
useStringTab:
useTextualTab
Use a textually-emblazoned tab
wantsRoundedCorners
Return true if the receiver wants its corners rounded
wording
Flaps
ClassVariables
FlapsQuads quads defining predefined flaps
default flaps are: 'PlugIn Supplies', 'Stack Tools', 'Supplies', 'Tools', 'Widgets' and 'Scripting'
SharedFlapTabs an array of flaps shared between squeak projects
SharedFlapsAllowed boolean
addGlobalFlap:
addIndividualGlobalFlapItemsTo:
addLocalFlap
addMorph:asElementNumber:inGlobalFlapSatisfying:
addMorph:asElementNumber:inGlobalFlapWithID:
addStandardFlaps
addToSuppliesFlap:asElementNumber:
automaticFlapLayoutChanged
clobberFlapTabList
defaultColorForFlapBackgrounds
defaultsQuadsDefiningPlugInSuppliesFlap
defaultsQuadsDefiningScriptingFlap
defaultsQuadsDefiningStackToolsFlap
defaultsQuadsDefiningSuppliesFlap
defaultsQuadsDefiningToolsFlap
defaultsQuadsDefiningWidgetsFlap
deleteMorphsSatisfying:fromGlobalFlapSatisfying:
disableGlobalFlapWithID:
disableGlobalFlaps
disableGlobalFlaps:
doAutomaticLayoutOfFlapsIfAppropriate
enableDisableGlobalFlapWithID:
enableGlobalFlapWithID:
enableGlobalFlaps
enableOnlyGlobalFlapsWithIDs:
explainFlaps
explainFlapsText
fileOutChanges
freshFlapsStart
globalFlapTab:
globalFlapTabOrDummy:
globalFlapTabWithID:
globalFlapTabs
globalFlapTabsIfAny
globalFlapTabsWithID:
globalFlapWithIDEnabledString:
initialize
Subclasses should redefine this method to perform initializations on instance creation
initializeFlapsQuads
initializeStandardFlaps
newFlapTitled:onEdge:
newFlapTitled:onEdge:inPasteUp:
newPharoFlap
newSqueakFlap
orientationForEdge:
positionNavigatorAndOtherFlapsAccordingToPreference
positionVisibleFlapsRightToLeftOnEdge:butPlaceAtLeftFlapsWithIDs:
quadsDefiningPlugInSuppliesFlap
quadsDefiningStackToolsFlap
quadsDefiningSuppliesFlap
quadsDefiningToolsFlap
quadsDefiningWidgetsFlap
quadsDeiningScriptingFlap
registerQuad:forFlapNamed:
registeredFlapsQuads
registeredFlapsQuadsAt:
reinstateDefaultFlaps
removeDuplicateFlapTabs
removeFlapTab:keepInList:
removeFromGlobalFlapTabList:
replaceGlobalFlapwithID:
replacePartSatisfying:inGlobalFlapSatisfying:with:
replacePartSatisfying:inGlobalFlapWithID:with:
replaceToolsFlap
setUpSuppliesFlapOnly
sharedFlapsAllowed
sharedFlapsAlongBottom
showSharedFlaps
suppressFlapsString
twiddleSuppliesButtonsIn:
unregisterQuad:forFlapNamed:
unregisterQuadsWithReceiver:
unregisterQuadsWithReceiver:fromFlapNamed:
FlattenEncoder
The simplest possible encoding: leave the objects as is.
cr
elementSeparator
filterSelector
writeArrayedCollection:
writeCollection:
writeCollectionContents:
writeCollectionContents:separator:
writeCollectionContents:separator:iterationMessage:
writeDictionary:
writeDictionaryContents:separator:
FormCanvas
Note that when shadowDrawing is true, shadowStipple may be either a color, for a solid shadow of the given color, or it may be a stipple used to simulate gray shading when the display cannot support alpha blending.
allocateForm:
Allocate a new form which is similar to the receiver
asBalloonCanvas
asShadowDrawingCanvas
Note: This is sort of an optimization here since since the logic is all there
asShadowDrawingCanvas:
Note: This is sort of an optimization here since since the logic is all there
balloonFillOval:fillStyle:borderWidth:borderColor:
balloonFillRectangle:fillStyle:
clipBy:during:
Set a clipping rectangle active only during the execution of aBlock.
Note: In the future we may want to have more general clip shapes - not just rectangles
clipRect
Return the currently active clipping rectangle
contentsOfArea:into:
Return the contents of the given area
copy
Make a copy the receiver on the same underlying Form but with its own grafPort.
copyClipRect:
copyOffset:
copyOffset:clipRect:
Make a copy of me offset by aPoint, and further clipped
by sourceClip, a rectangle in the un-offset coordinates
copyOrigin:clipRect:
Return a copy of this canvas with the given origin. The clipping rectangle of this canvas is the intersection of the given rectangle and the receiver's current clipping rectangle. This allows the clipping rectangles of nested clipping morphs to be composed.
depth
drawPolygon:color:borderWidth:borderColor:
Generalize for the BalloonCanvas
drawPolygon:fillStyle:borderWidth:borderColor:
Use a BalloonCanvas
drawString:from:to:at:font:color:
drawString:from:to:in:font:color:
drawString:from:to:in:font:color:underline:underlineColor:strikethrough:strikethroughColor:
extent
Return the physical extent of the output device
extent:
extent:depth:
extent:depth:origin:clipRect:
fillColor:
Note: This always fills, even if the color is transparent.
fillOval:color:borderWidth:borderColor:
draw the border of the oval
fillOval:fillStyle:borderWidth:borderColor:
Fill the given oval.
fillRectangle:basicFillStyle:
Fill the given rectangle with the given, non-composite, fill style.
fillRectangle:fillStyle:
Fill the given rectangle. Double-dispatched via the fill style.
finish
If there are any pending operations on the receiver complete them. Do not return before all modifications have taken effect.
flushDisplay
Dummy .
forceToScreen:
dummy
form
frameAndFillRectangle:fillColor:borderWidth:borderColor:
Draw the rectangle using the given attributes
frameAndFillRectangle:fillColor:borderWidth:topLeftColor:bottomRightColor:
First use quick code for top and left borders and fill
image:at:sourceRect:rule:
Draw the portion of the given Form defined by sourceRect at the given point using the given BitBlt combination rule.
image:at:sourceRect:rule:alpha:
Draw the portion of the given Form defined by sourceRect at the given point using the given BitBlt combination rule.
infiniteFillRectangle:fillStyle:
this is a bit of a kludge to get the form to be aligned where I *think* it should be.
something better is needed, but not now
isShadowDrawing
isVisible:
Optimization
line:to:brushForm:
Obsolete - will be removed in the future
line:to:width:color:
Draw a line using the given width and color
on:
origin
Return the current origin for drawing operations
paragraph3:bounds:color:
paragraph:bounds:color:
Draw the given paragraph
point:color:
Obsolete - will be removed in the future
portClass
Return the class used as port
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
privateClipRect
privatePort
privateWarp:transform:at:sourceRect:cellSize:
Warp the given using the appropriate transform and offset.
render:
Do some 3D operations with the object if possible
reset
Reset the canvas.
resetGrafPort
Private! Create a new grafPort for a new copy.
roundCornersOf:in:during:
setClearColor:
Install a new clear color - e.g., a color is used for clearing the background
setFillColor:
Install a new color used for filling.
setForm:
setOrigin:clipRect:
setPaintColor:
Install a new color used for filling.
shadowColor
Return the current override color or nil if no such color exists
shadowColor:
Set a shadow color. If set this color overrides any client-supplied color.
showAt:
showAt:invalidRects:
stencil:at:sourceRect:color:
Flood this canvas with aColor wherever stencilForm has non-zero pixels
test1
test2
test3
transformBy:clippingTo:during:smoothing:
Note: This method has been originally copied from TransformationMorph.
translateBy:during:
Set a translation only during the execution of aBlock.
translateTo:clippingTo:during:
Set a new origin and clipping rectangle only during the execution of aBlock.
warpFrom:toRect:
warpImage:transform:at:sourceRect:cellSize:
Warp the given using the appropriate transform and offset.
GrafPort
A GrafPort is xxxxxxxxx.
Instance Variables
alpha: <Object>
fillPattern: <Object>
lastFont: <Object>
lastFontBackgroundColor: <Object>
lastFontForegroundColor: <Object>
alpha
- xxxxx
fillPattern
- xxxxx
lastFont
- xxxxx
lastFontBackgroundColor
- xxxxx
lastFontForegroundColor
- xxxxx
alphaBits:
clippedBy:
contentsOfArea:into:
copyBits
Override copybits to do translucency if desired
displayScannerFor:foreground:background:ignoreColorChanges:
Fixed to answer a MultiDisplayScanner when the paragraph is any kind of
MultiNewParagraph (rather than an instance of the one class) or the paragraph
text string is a WideString.
displayScannerForMulti:foreground:background:ignoreColorChanges:
fillOval:
fillPattern:
fillRect:offset:
The offset is really just for stupid InfiniteForms.
frameOval:borderWidth:
frameRect:borderWidth:
frameRectBottom:height:
frameRectRight:width:
image:at:sourceRect:rule:
Draw the portion of the given Form defined by sourceRect at the given point using the given BitBlt combination rule.
image:at:sourceRect:rule:alpha:
Draw the portion of the given Form defined by sourceRect at the given point using the given BitBlt combination rule.
installFreeTypeFont:foregroundColor:backgroundColor:
Set up the parameters. Since the glyphs in a TTCFont is 32bit depth form, it tries to use rule=34 to get better AA result if possible.
installStrikeFont:
installStrikeFont:foregroundColor:backgroundColor:
installTTCFont:
installTTCFont:foregroundColor:backgroundColor:
Set up the parameters. Since the glyphs in a TTCFont is 32bit depth form, it tries to use rule=34 to get better AA result if possible.
lastFont
lastFontForegroundColor
stencil:at:sourceRect:
Paint using aColor wherever stencilForm has non-zero pixels
HaloMorph
This morph provides a halo of handles for its target morph. Dragging, duplicating, rotating, and resizing to be done by mousing down on the appropriate handle. There are also handles for help and for a menu of infrequently used operations.
acceptNameEdit
If the name is currently under edit, accept the changes
addChooseGraphicHandle:
If the target is a sketch morph, and if the governing preference is set, add a halo handle allowing the user to select a new graphic
addCircleHandles
addCollapseHandle:
Add the collapse handle, with all of its event handlers set up, unless the target's owner is not the world or the hand.
addDebugHandle:
addDirectionHandles
addDismissHandle:
Add the dismiss handle according to the spec, unless selectiveHalos is on and my target resists dismissal
addDragHandle:
addDupHandle:
Add the halo that offers duplication, or, when shift is down, make-sibling
addFewerHandlesHandle:
addFontEmphHandle:
addFontSizeHandle:
addFontStyleHandle:
addFullHandles
Later, obey a preference to choose between circle-iconic and solid-circles
addGrabHandle:
If appropriate, add the black halo handle for picking up the target
addGraphicalHandle:at:on:send:to:
Add the supplied form as a graphical handle centered at the given point, and set it up to respond to the given event by sending the given selector to the given recipient. Return the handle.
addGraphicalHandleFrom:at:
Add the supplied form as a graphical handle centered at the given point. Return the handle.
addGrowHandle:
addHandle:on:send:to:
Add a handle within the halo box as per the haloSpec, and set
it up to respond to the given event by sending the given
selector to the given recipient. Return the handle.
addHandleAt:color:icon:on:send:to:
Add a handle centered at the given point with the given color,
and set it up to respond to the given event by sending the
given selector to the given recipient. Return the handle.
addHandleAt:color:on:send:to:
addHandles
addHandlesForWorldHalos
Add handles for world halos, like the man said
addHelpHandle:
addMenuHandle:
addName
Add a name readout at the bottom of the halo.
addNameBeneath:string:
Add a name display centered beneath the bottom of the outer rectangle. Return the handle.
addRecolorHandle:
Add a recolor handle to the receiver, if appropriate
addRepaintHandle:
addRotateHandle:
addScaleHandle:
addSimpleHandles
addSimpleHandlesForWorldHalos
Nothing special at present here -- just use the regular handles. Cannot rotate or resize world
addSimpleHandlesTo:box:
addSimpleSketchMorphHandlesInBox:
basicBox
basicBoxForSimpleHalos
blueButtonDown:
Transfer the halo to the next likely recipient
borderStyle
Answer the border style to use for the receiver.
Depends on the target and preference.
changed
Quicker to invalidate handles individually if target is large (especially the world)
containsPoint:
This method is overridden so that, once up, the handles will stay up as long as the mouse is within the box that encloses all the handles even if it is not over any handle or over its owner.
containsPoint:event:
Blue buttons are handled by the halo
createHandleAt:color:iconName:
defaultColor
Answer the default color/fill style for the receiver.
delete
Delete the halo. Tell the target that it no longer has the halo; accept any pending edits to the name; and then actually delete myself
directionArrowLength
doDebug:with:
Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target
doDirection:with:
doDrag:with:
doDup:with:
Ask hand to duplicate my target.
doGrab:with:
Ask hand to grab my target.
doGrow:with:
Called while the mouse is down in the grow handle
doMenu:with:
Ask hand to invoke the halo menu for my inner target.
doRecolor:with:
The mouse went down in the 'recolor' halo handle. Allow the user to change the color of the innerTarget
doRot:with:
Update the rotation of my target if it is rotatable. Keep the relevant command object up to date.
doScale:with:
Update the scale of my target if it is scalable.
dragTarget:
Begin dragging the target
drawSubmorphsOn:
Display submorphs back to front
endInteraction
Clean up after a user interaction with the a halo control
fadeIn
fadeInInitially
fadeOut
fadeOutFinally
haloBox:
handleAllowanceForIconicHalos
handleEntered
handleLeft
handleListenEvent:
We listen for possible drop events here to add back those handles after a dup/grab operation
handleSize
handlerForBlueButtonDown:
Blue button was clicked within the receiver
initialize
initialize the state of the receiver
innerTarget
isMagicHalo
isMagicHalo:
localHaloBoundsFor:
aMorph may be in the hand and perhaps not in our world
magicAlpha
magicAlpha:
maybeCollapse:with:
Ask hand to collapse my target if mouse comes up in it.
maybeDismiss:with:
Ask hand to dismiss my target if mouse comes up
in it.
maybeDoDup:with:
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
mouseDownInCollapseHandle:with:
The mouse went down in the collapse handle; collapse the morph
mouseDownInDimissHandle:with:
mouseMove:
Drag our target around
obtainHaloForEvent:andRemoveAllHandlesBut:
Make sure the event's hand correlates with the receiver, and remove all handles except the given one. If nil is provided as the handles argument, the result is that all handles are removed. Note that any pending edits to the name-string in the halo are accepted at this time.
popUpFor:event:
This message is sent by morphs that explicitly request the halo on a button click. Note: anEvent is in aMorphs coordinate frame.
popUpMagicallyFor:hand:
Programatically pop up a halo for a given hand.
position:
Halos display imprefectly if their coordinates are non-integral
-- especially the direction handles.
positionDirectionShaft:
Position the shaft.
positionIn:horizontalPlacement:verticalPlacement:
prepareToTrackCenterOfRotation:with:
rejectsEvent:
Return true to reject the given event. Rejecting an event means neither the receiver nor any of it's submorphs will be given any chance to handle it.
removeAllHandlesBut:
Remove all handles except h.
setCenterOfRotation:with:
setColor:toHandle:
private - change the color to the given handle, applying the
alternate look if corresponds
setDirection:with:
The user has let up after having dragged the direction arrow; now set the forward direction of the actual SketchMorph accordingly
setDismissColor:with:
Called on mouseStillDown in the dismiss handle; set the color appropriately.
setTarget:
Private! Set the target without adding handles.
showDirectionHandles:
showDirectionHandles:addHandles:
showingDirectionHandles
simpleFudgeOffset
account for the difference in basicBoxes between regular and simple handles
startDrag:with:
Drag my target without removing it from its owner.
startGrow:with:
Initialize resizing of my target. Launch a command representing it, to support Undo
startRot:with:
Initialize rotation of my target if it is rotatable. Launch a command object to represent the action
startScale:with:
Initialize scaling of my target.
staysUpWhenMouseIsDownIn:
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
target
target:
Morphs with targets will override. This backstop does nothing.
trackCenterOfRotation:with:
trackDirectionArrow:with:
transferHalo:
Transfer the halo to the next likely recipient
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared. Warning!! Every instance variable defined in this class must be handled. We must also implement veryDeepFixupWith:. See DeepCopier class comment.
wantsKeyboardFocusFor:
to allow the name to be edited in the halo in the old tty way; when we morphic-text-ize the name editing, presumably this method should be removed
wantsToBeTopmost
Answer if the receiver want to be one of the topmost objects in
its owner
wantsYellowButtonMenu
Answer true if the receiver wants a yellow button menu
HaloSpec
Sets spec's for how handles are layed out in a halo.
addHandleSelector
color
horizontalPlacement
horizontalPlacement:verticalPlacement:color:iconSymbol:addHandleSelector:
iconSymbol
printOn:
Add a textual printout representing the receiver to a stream
verticalPlacement
HandMorph
The cursor may be thought of as the HandMorph. The hand's submorphs hold anything being carried by dragging.
There is some minimal support for multiple hands in the same world.
adaptedToWorld:
If I refer to a world or a hand, return the corresponding items in the new world.
addEventListener:
Make anObject a listener for all events. All events will be reported to the object.
addListener:to:
Add anObject to the given listener group. Return the new group.
addMouseListener:
Make anObject a listener for mouse events. All mouse events will be reported to the object.
anyButtonPressed
attach:
attachMorph:
Position the center of the given morph under this hand, then grab it.
This method is used to grab far away or newly created morphs.
balloonHelp
Return the balloon morph associated with this hand
balloonHelp:
Return the balloon morph associated with this hand
changed
Report that the area occupied by this morph should be redrawn.
Fixed to include submorphs outside the outerBounds.
clearCompositionWindowManager
clearInterpreters
colorForInsets
Morphs being dragged by the hand use the world's color
compositionWindowManager
copyToPasteBuffer:
Save this morph in the paste buffer. This is mostly useful for copying morphs between projects.
cursorBounds
cursorPoint
Implemented for allowing embedded worlds in an event cycle to query a hand's position and get it in its coordinates. The same can be achieved by #point:from: but this is simply much more convenient since it will look as if the hand is in the lower world.
deleteBalloonTarget:
Delete any existing balloon help. This is now done unconditionally, whether or not the morph supplied is the same as the current balloon target
doubleClickTime
doubleClickTime:
drawOn:
Draw the hand itself (i.e., the cursor).
dropMorph:event:
Drop the given morph which was carried by the hand
dropMorphs
Drop the morphs at the hands position
dropMorphs:
Drop the morphs at the hands position
eventListeners
eventListeners:
fullBounds
Extend my bounds by the shadow offset when carrying morphs.
fullDrawOn:
A HandMorph has unusual drawing requirements:
1. the hand itself (i.e., the cursor) appears in front of its submorphs
2. morphs being held by the hand cast a shadow on the world/morphs below
The illusion is that the hand plucks up morphs and carries them above the world.
generateDropFilesEvent:
Generate the appropriate mouse event for the given raw event buffer
generateKeyboardEvent:
Generate the appropriate mouse event for the given raw event buffer
generateMouseEvent:
Generate the appropriate mouse event for the given raw event buffer
grabMorph:
Grab the given morph (i.e., add it to this hand and remove it from its current owner) without changing its position. This is used to pick up a morph under the hand's current position, versus attachMorph: which is used to pick up a morph that may not be near this hand.
grabMorph:from:
Grab the given morph (i.e., add it to this hand and remove it from its current owner) without changing its position. This is used to pick up a morph under the hand's current position, versus attachMorph: which is used to pick up a morph that may not be near this hand.
halo
Return the halo associated with this hand, if any
halo:
Set halo associated with this hand
handleEvent:
Handle the given event
hasChanged
Return true if this hand has changed, either because it has moved or because some morph it is holding has changed.
hasUserInformation
includeInNewMorphMenu
initForEvents
initialize
initialize the state of the receiver
interrupted
Something went wrong - we're about to bring up a debugger.
Release some stuff that could be problematic.
invalidRect:from:
Note that a change has occurred and record the given damage rectangle relative to the origin this hand's cache.
isHandMorph
keyboardFocus
keyboardFocus:
keyboardListeners
lastEvent
mouseFocus
mouseFocus:
mouseListeners
mouseListeners:
mouseOverHandler
mouseTrailFrom:
Current event, a mouse event buffer, is about to be processed. If there are other similar mouse events queued up, then drop them from the queue, and report the positions inbetween.
moveToEvent:
Issue a mouse move event to make the receiver appear at the given position
needsToBeDrawn
Return true if this hand must be drawn explicitely instead of being drawn via the hardware cursor. This is the case if it (a) it is a remote hand, (b) it is showing a temporary cursor, or (c) it is not empty and there are any visible submorphs. If using the software cursor, ensure that the hardware cursor is hidden.
newKeyboardFocus:
Make the given morph the new keyboard focus, canceling the previous keyboard focus if any. If the argument is nil, the current keyboard focus is cancelled.
newMouseFocus:
Make the given morph the new mouse focus, canceling the previous mouse focus if any. If the argument is nil, the current mouse focus is cancelled.
newMouseFocus:event:
noButtonPressed
Answer whether any mouse button is not being pressed.
nonCachingFullDrawOn:
A HandMorph has unusual drawing requirements:
1. the hand itself (i.e., the cursor) appears in front of its submorphs
2. morphs being held by the hand cast a shadow on the world/morphs below
The illusion is that the hand plucks up morphs and carries them above the world.
noticeMouseOver:event:
objectForDataStream:
I am about to be written on an object file. Write a path to me in the other system instead.
objectToPaste
It may need to be sent #startRunning by the client
obtainHalo:
Used for transfering halos between hands
pasteBuffer
Return the paste buffer associated with this hand
pasteBuffer:
Set the contents of the paste buffer.
pasteMorph
pauseEventRecorderIn:
Suspend any recorder prior to a project change, and return it.
It will be resumed after starting the new project.
position
position:
Overridden to align submorph origins to the grid if gridding is on.
processEvents
Process user input events from the local input devices.
releaseAllFoci
releaseCachedState
Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.
releaseHalo:
Used for transfering halos between hands
releaseKeyboardFocus
Release the current keyboard focus unconditionally
releaseKeyboardFocus:
If the given morph had the keyboard focus before, release it
releaseMouseFocus
Release the current mouse focus unconditionally.
releaseMouseFocus:
If the given morph had the mouse focus before, release it
removeEventListener:
Remove anObject from the current event listeners.
removeHalo
remove the receiver's halo (if any)
removeHaloFromClick:on:
removeListener:from:
Remove anObject from the given listener group. Return the new group.
removeMouseListener:
Remove anObject from the current mouse listeners.
removePendingBalloonFor:
Get rid of pending balloon help.
removePendingHaloFor:
Get rid of pending balloon help or halo actions.
resetClickState
Reset the double-click detection state to normal (i.e., not waiting for a double-click).
resourceJustLoaded
In case resource relates to me
restoreSavedPatchOn:
Clear the changed flag and restore the part of the given canvas under this hand from the previously saved patch. If necessary, handle the transition to using the hardware cursor.
savePatchFrom:
Save the part of the given canvas under this hand as a Form and return its bounding rectangle.
selectedObject
answer the selected object for the hand or nil is none
sendEvent:focus:
Send the event to the morph currently holding the focus, or if none to the owner of the hand.
sendEvent:focus:clear:
Send the event to the morph currently holding the focus, or if none to the owner of the hand.
sendFocusEvent:to:clear:
Send the event to the morph currently holding the focus
sendKeyboardEvent:
Send the event to the morph currently holding the focus, or if none to
the owner of the hand.
sendListenEvent:to:
Send the event to the given group of listeners
sendMouseEvent:
Send the event to the morph currently holding the focus, or if none to the owner of the hand.
shadowForm
Return a 1-bit shadow of my submorphs. Assumes submorphs is not empty
shadowOffset
Return the current shadow offset
shiftPressed
showEvents:
showTemporaryCursor:
Set the temporary cursor to the given Form. If the argument is nil, revert to the normal cursor.
showTemporaryCursor:hotSpotOffset:
Set the temporary cursor to the given Form.
If the argument is nil, revert to the normal hardware cursor.
spawnBalloonFor:
spawnMagicHaloFor:
startUp
targetOffset
Return the offset of the last mouseDown location relative to the origin of the recipient morph. During menu interactions, this is the absolute location of the mouse down event that invoked the menu.
targetPoint
Return the new position of the target.
I.E. return the position of the hand less
the original distance between hand and target position
temporaryCursor
triggerBalloonFor:after:
Trigger balloon help after the given time out for some morph
triggerHaloFor:after:
Trigger automatic halo after the given time out for some morph
updateCacheCanvas:
Update the cached image of the morphs being held by this hand.
userInitials
userInitials:andPicture:
userPicture
userPicture:
veryDeepCopyWith:
Return self. Do not copy hands this way.
visible:
set the 'visible' attribute of the receiver to aBoolean.
Must update owner layout since its full bounds may depend
on the receiver extending beyond its bounds.
waitForClicksOrDrag:event:
Wait for mouse button and movement events, informing aMorph about events interesting to it via callbacks.
This message is typically sent to the Hand by aMorph when it first receives a mouse-down event.
The callback methods invoked on aMorph (which are passed a copy of evt) are:
#click: sent when the mouse button goes up within doubleClickTime.
#doubleClick: sent when the mouse goes up, down, and up again all within DoubleClickTime.
#doubleClickTimeout: sent when the mouse does not have a doubleClick within DoubleClickTime.
#startDrag: sent when the mouse moves more than 10 pixels from evt's position within DoubleClickTime.
Note that mouseMove: and mouseUp: events are not sent to aMorph until it becomes the mouse focus,
which is typically done by aMorph in its click:, doubleClick:, or drag: methods.
waitForClicksOrDrag:event:selectors:threshold:
Wait for mouse button and movement events, informing aMorph about events interesting to it via callbacks.
This message is typically sent to the Hand by aMorph when it first receives a mouse-down event.
The callback methods, named in clickAndDragSelectors and passed a copy of evt, are:
1 (click) sent when the mouse button goes up within doubleClickTime.
2 (doubleClick) sent when the mouse goes up, down, and up again all within DoubleClickTime.
3 (doubleClickTimeout) sent when the mouse does not have a doubleClick within DoubleClickTime.
4 (startDrag) sent when the mouse moves more than threshold pixels from evt's position within DoubleClickTime.
Note that mouseMove: and mouseUp: events are not sent to aMorph until it becomes the mouse focus,
which is typically done by aMorph in its click:, doubleClick:, or drag: methods.
HandleMorph
A HandleMorph provides mouse-up control behavior.
forEachPointDo:
forEachPointDo:lastPointDo:
initialize
initialize the state of the receiver
justDroppedInto:event:
So that when the hand drops me (into the world) I go away
keyStroke:
Check for cursor keys
startStepping
Make the receiver the keyboard focus for editing
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepTime
Update every hundredth of a second.
IconicButton
A "Simple Button" in which the appearance is provided by a Form.
addLabelItemsTo:hand:
don't do the inherited behavior, since there is no textual label in this case
borderInset
borderNormal
borderRaised
borderThick
buttonSetup
handlesMouseOver:
Answer true, otherwise what is all that
#mouseEnter:/#mouseLeave: stuff about?
initialize
initialize the state of the receiver
initializeWithThumbnail:withLabel:andColor:andSend:to:
Initialize the receiver to show aThumbnail on its face, giving it the label supplied and arranging for it, when the button goes down on it, to obtain a new morph by sending the supplied selector to the supplied receiver
initializeWithThumbnail:withLabel:andSend:to:
Initialize the receiver to show aThumbnail on its face, giving it the label supplied and arranging for it, when the button goes down on it, to obtain a new morph by sending the supplied selector to the supplied receiver
labelFromString:
Make an iconic label from aString
labelGraphic:
Changed to look for any image morph rather than just a sketch.
mouseDown:
Partial workaraound for broken MouseOverHandler.
Remove the border on mouse down if mouse focus has changed.
mouseEnter:
Remember the old border style.
mouseLeave:
Reinstate the old border style.
mouseOverBorderStyle
Answer the border style to use whilst the mouse
is over the receiver.
mouseOverBorderStyle:
Set the border style to use whilst the mouse
is over the receiver.
setDefaultLabel
shedSelvedge
stationarySetup
ImageMorph
ImageMorph is a morph that displays a picture (Form). My extent is determined by the extent of my form.
Use #image: to set my picture.
Structure:
instance var Type Description
image Form The Form to use when drawing
Code examples:
ImageMorph new openInWorld; grabFromScreen
(Form fromFileNamed: 'myGraphicsFileName') asMorph openInWorld
Relationship to SketchMorph: ImageMorph should be favored over SketchMorph, a parallel, legacy class -- see the Swiki FAQ for details ( http://minnow.cc.gatech.edu/squeak/1372 ).
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
adoptPaneColor:
Change our border color too.
authoringPrototype
basicType
Answer a symbol representing the inherent type I hold
borderStyle:
Set the extent to include border width.
borderWidth:
changeOpacity
color:
Set the color.
Change to a ColorForm here if depth 1.
defaultForm
defaultImage
Answer the default image for the receiver.
drawOn:
Draw the border after the image.
extent:
Do nothing; my extent is determined by my image Form.
form
For compatability with SketchMorph.
fromString:
fromString:font:
grabFromScreen
image
image:
Fixed to take account of border width.
Use raw image, only change depth 1 forms to
ColorForm with transparency if #color: is sent.
initialize
initialize the state of the receiver
initializeToStandAlone
Set up the receiver, created by a #basicNew and now ready to be initialized, as a fully-formed morph suitable for providing a graphic for a parts bin surrogate, and, when such a parts-bin surrogate is clicked on, for attaching to the hand as a viable stand-alone morph. Because of historical precedent, #initialize has been expected to handle this burden, though a great number of morphs actually cannot stand alone. In any case, by default we call the historical #initialize, though unhappily, so that all existing morphs will work no worse than before when using this protocol.
isOpaque
Return true if the receiver is marked as being completely opaque
isOpaque:
Mark the receiver as being completely opaque or not
newForm:
opacityString
readFromFile
registerInFlapsRegistry
releaseCachedState
Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.
setNewImageFrom:
Change the receiver's image to be one derived from the supplied form. If nil is supplied, clobber any existing image in the receiver, and in its place put a default graphic, either the one known to the receiver as its default value, else a squeaky mouse
unload
wantsRecolorHandle
Answer whether the receiver would like a recoloring halo handle to be put up. Since this handle also presently affords access to the property-sheet, it is presently always allowed, even though SketchMorphs don't like regular recoloring
withSnapshotBorder
InsetBorder
see BorderedMorph
bottomRightColor
Changed from direct access to color since, if nil,
self color is transparent.
colorsAtCorners
style
topLeftColor
Changed from direct access to color since, if nil,
self color is transparent.
trackColorFrom:
If necessary, update our color to reflect a change in aMorphs color
KeyboardEvent
A KeyboardEvent is xxxxxxxxx.
Instance Variables
charCode: <Object>
keyValue: <Object>
scanCode: <Object>
charCode
- xxxxx
keyValue
- xxxxx
scanCode
- xxxxx
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
hash
Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define =
isKeyDown
isKeyUp
isKeyboard
isKeystroke
isMouseMove
keyCharacter
Answer the character corresponding this keystroke. This is defined only for keystroke events.
keyString
Answer the string value for this keystroke. This is defined only for keystroke events.
keyValue
Answer the ascii value for this keystroke. This is defined only for keystroke events.
printKeyStringOn:
Print a readable string representing the receiver on a given stream
printOn:
Print the receiver on a stream
scanCode
scanCode:
sentTo:
Dispatch the receiver into anObject
setType:buttons:position:keyValue:charCode:hand:stamp:
setType:buttons:position:keyValue:hand:stamp:
storeOn:
Append to the argument aStream a sequence of characters that is an
expression whose evaluation creates an object similar to the receiver.
type:readFrom:
Read a MorphicEvent from the given stream.
LabelStringMorph
I am the stringMorph label for a system window. When a user tries to edit me (shift-click's me) I call >>relabel in my SystemWindow. In this way the SystemWindow is informed of the change.
mouseDown:
If the shift key is pressed, make this string the keyboard input focus.
Process as normal if the editableStringMorphs preference is false.
mySystemWindow
mySystemWindow:
LayoutCell
I am used in table layouts to hold temporary values while the layout is being computed.
Instance variables:
target <Morph> The morph contained in this cell
cellSize <Point> The size of the cell
extraSpace <nil | Point> Additional space to add after this cell
nextCell <nil | LayoutCell> The next cell in the arrangement.
Implementation note:
Both, cellSize and extraSpace contains points where
x - represents the primary table direction
y - represents the secondary table direction
addExtraSpace:
cellSize
cellSize:
do:
extraSpace
extraSpace:
flags
hSpaceFill
hSpaceFill:
inject:into:
Accumulate a running value associated with evaluating the argument,
binaryBlock, with the current value of the argument, thisValue, and the
receiver as block arguments. For instance, to sum the numeric elements
of a collection, aCollection inject: 0 into: [:subTotal :next | subTotal +
next].
nextCell
nextCell:
size
Primitive. Answer the number of indexable variables in the receiver.
This value is the same as the largest legal subscript. Essential. See Object
documentation whatIsAPrimitive.
target
target:
vSpaceFill
vSpaceFill:
LayoutFrame
I define a frame for positioning some morph in a proportional layout.
Instance variables:
leftFraction
topFraction
rightFraction
bottomFraction <Float> The fractional distance (between 0 and 1) to place the morph in its owner's bounds
leftOffset
topOffset
rightOffset
bottomOffset <Integer> Fixed pixel offset to apply after fractional positioning (e.g., "10 pixel right of the center of the owner")
bottomFraction
bottomFraction:
bottomFraction:offset:
bottomOffset
bottomOffset:
classVersion
fractions:
fractions:offsets:
layout:in:
Return the proportional rectangle insetting the given bounds
leftFraction
leftFraction:
leftFraction:offset:
leftOffset
leftOffset:
minExtentFrom:
Return the minimal extent the given bounds can be represented in.
negateBottomRightOffsets
offsets:
rightFraction
rightFraction:
rightFraction:offset:
rightOffset
rightOffset:
topFraction
topFraction:
topFraction:offset:
topOffset
topOffset:
LayoutPolicy
A LayoutPolicy defines how submorphs of some morph should be arranged. Subclasses of the receiver define concrete layout policies.
flushLayoutCache
Flush any cached information associated with the receiver
indexForInserting:at:in:
Return the insertion index based on the layout strategy defined for some morph. Used for drop insertion.
isProportionalLayout
isTableLayout
layout:in:
Compute the layout for the given morph based on the new bounds
minExtentOf:in:
Return the minimal size aMorph's children would require given the new bounds
LayoutProperties
This class provides a compact bit encoding for the most commonly used layout properties.
asTableLayoutProperties
cellInset
Default
cellPositioning
cellSpacing
Default
disableTableLayout
disableTableLayout:
hResizing
hResizing:
includesTableProperties
initialize
Subclasses should redefine this method to perform initializations on instance creation
initializeFrom:
Initialize the receiver from a default provider
layoutInset
listCentering
Default
listDirection
Default
listSpacing
Default
maxCellSize
minCellSize
reverseTableCells
rubberBandCells
vResizing
vResizing:
wrapCentering
wrapDirection
LazyListMorph
The morph that displays the list in a PluggableListMorph. It is "lazy" because it will only request the list items that it actually needs to display.
I will cache the maximum width of my items in maxWidth to avoid this potentially expensive and frequent computation.
adjustHeight
private. Adjust our height to match the length of the underlying list
adjustWidth
private. Adjust our height to match the length of the underlying list
bottomVisibleRowForCanvas:
return the bottom visible row in aCanvas's clip rectangle
colorForRow:
Answer the color for the row text.
display:atRow:on:
Display the given item at the given row on the given canvas.
drawBackgroundForMulti:on:
shade the background darker, if this row is selected
drawBackgroundForPotentialDrop:on:
shade the background darker, if this row is a potential drop target
drawBoundsForRow:
calculate the bounds that row should be drawn at. This might be outside our bounds!
drawOn:
drawSelectionOn:
Draw the selection background.
font
return the font used for drawing. The response is never nil
font:
getListItem:
grab a list item directly from the model
getListSize
return the number of items in the list
hUnadjustedScrollRange
Ok, this is a bit messed up. We need to return the width of the widest item in the list. If we grab every item in the list, it defeats the purpose of LazyListMorph. If we don't, then we don't know the size.
This is a compromise -- find the widest of the first 30 items, then double it, This width will be updated as new items are installed, so it will always be correct for the visible items. If you know a better way, please chime in.
highlightPotentialDropRow:on:
initialize
initialize the state of the receiver
item:
return the index-th item, using the 'listItems' cache
listChanged
set newList to be the list of strings to display
listSource:
set the source of list items -- typically a PluggableListMorph
mouseDownRow
Answer the row that should have mouse down highlighting if any.
mouseDownRow:
Set the row that should have mouse down highlighting or nil if none.
mouseDownRowFrameChanged
Invalidate frame of the current mouse down row if any.
rectForRow:
return a rectangle containing the row at index
rowAtLocation:
return the number of the row at aPoint
selectRow:
Select the index-th row.
selectedRow
return the currently selected row, or nil if none is selected
selectedRow:
Select the index-th row. if nil, remove the current selection.
selectionFrameChanged
Invalidate frame of the current selection if any.
selectionFrameForRow:
Answer the selection frame rectangle.
topVisibleRowForCanvas:
return the top visible row in aCanvas's clip rectangle
unselectRow:
Unselect the index-th row.
userString
Do I have a text string to be searched on?
widthToDisplayItem:
LineMorph
This is really only a shell for creating single-segment straight-line Shapes.
from:to:color:width:
new
newStandAlone
ListItemWrapper
Contributed by Bob Arning as part of the ObjectExplorer package.
acceptDroppingObject:
asString
Answer a string that represents the receiver.
balloonText
canBeDragged
contents
handlesMouseOver:
hasContents
hasEquivalentIn:
highlightingColor
icon
Answer a form to be used as icon
item
Answer the item. It is useful!
model
Answer the model. It is useful!
preferredColor
sendSettingMessageTo:
setItem:
setItem:model:
settingSelector
wantsDroppedObject:
with:
with:model:
withoutListWrapper
MatrixTransformMorph
MatrixTransformMorph is similar to TransformMorph but uses a MatrixTransform2x3 instead of a MorphicTransform. It is used by clients who want use the BalloonEngine for vector-based scaling instead of the standard WarpBlt pixel-based mechanism.
addFlexShell
No flex shell necessary
asFlexOf:
Initialize me with position and bounds of aMorph,
and with an offset that provides centered rotation.
balloonHelpTextForHandle:
Answer a string providing balloon help for the
given halo handle
boundsChangedFrom:to:
changeRotationCenter:with:
changed
Report that the area occupied by this morph should be redrawn.
Fixed to include submorphs outside the outerBounds.
computeBounds
containsPoint:
drawOn:
drawSubmorphsOn:
Display submorphs back to front
extent:
fullBounds
Return the bounding box of the receiver and all its children. Recompute the layout if necessary.
fullContainsPoint:
handleBoundsChange:
hasNoScaleOrRotation
heading
Return the receiver's heading (in eToy terms)
heading:
Set the receiver's heading (in eToy terms)
initialize
initialize the state of the receiver
innerAngle
invalidRect:from:
lastRotationDegrees
lastRotationDegrees:
privateFullMoveBy:
Private! Relocate me and all of my subMorphs by recursion. Subclasses that implement different coordinate systems may override this method.
removeFlexShell
Do nothing
rotateBy:
rotationCenter
Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationCenter:
Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationDegrees:
setDirectionFrom:
setRotationCenterFrom:
transform
transform:
transformFrom:
Return a transform to be used to map coordinates in a morph above me into my childrens coordinates, or vice-versa. This is used to support scrolling, scaling, and/or rotation. This default implementation just returns my owner's transform or the identity transform if my owner is nil.
Note: This method cannot be used to map into the receiver's coordinate system!
transformedBy:
visible:
set the 'visible' attribute of the receiver to aBoolean
I represent a registry for icons. You can see the icons I contain using the following script:
| dict methods |
dict := Dictionary new.
methods := MenuIcons class selectors select: [:each | '*Icon' match: each asString].
methods do: [:each | dict at: each put: (MenuIcons perform: each)].
GraphicalDictionaryMenu openOn: dict withLabel: 'MenuIcons'
backIcon
backIconContents
base64ContentsOfFileNamed:
blankIcon
blankIconOfWidth:
configurationIcon
configurationIconContents
confirmIcon
confirmIconContents
createIconMethodsFromDirectory:
decorateMenu:
exportAllIconsAsGif
exportAllIconsAsPNG
exportIcon:asGifNamed:
exportIcon:asPNGNamed:
forwardIcon
forwardIconContents
fullScreenIcon
fullScreenIconContents
helpIcon
helpIconContents
homeIcon
homeIconContents
iconForMenuItem:
importAllIconNamed:
importAllIcons
importIconNamed:
initialize
Subclasses should redefine this method to perform initializations on instance creation
initializeIcons
initializeTranslations
itemsIcons
jumpIcon
jumpIconContents
loadProjectIconContents
methodEnd
methodStart:
noIcon
objectCatalogIcon
objectCatalogIconContents
objectsIcon
objectsIconContents
openIcon
openIconContents
overriddenIcon
overridesAndOverriddenIcon
overridesIcon
paintIcon
paintIconContents
projectIcon
projectIconContents
publishIcon
publishIconContents
smallAuthoringToolsIcon
smallAuthoringToolsIconContents
smallBackIcon
smallBackIconContents
smallCancelIcon
smallCancelIconContents
smallCenteredIcon
smallCenteredIconContents
smallConfigurationIcon
smallConfigurationIconContents
smallCopyIcon
smallCopyIconContents
smallCutIcon
smallCutIconContents
smallDebugIcon
smallDebugIconContents
smallDeleteIcon
smallDeleteIconContents
smallDoItIcon
smallDoItIconContents
smallExpertIcon
smallExpertIconContents
smallExportIcon
smallExportIconContents
smallFindIcon
smallFindIconContents
smallFontsIcon
smallFontsIconContents
smallForwardIcon
smallForwardIconContents
smallFullScreenIcon
smallFullScreenIconContents
smallHelpIcon
smallHelpIconContents
smallHomeIcon
smallHomeIconContents
smallInspectItIcon
smallInspectItIconContents
smallJumpIcon
smallJumpIconContents
smallJustifiedIcon
smallJustifiedIconContents
smallLanguageIcon
smallLanguageIconContents
smallLeftFlushIcon
smallLeftFlushIconContents
smallLoadProjectIcon
smallLoadProjectIconContents
smallNewIcon
smallNewIconContents
smallObjectCatalogIcon
smallObjectCatalogIconContents
smallObjectsIcon
smallObjectsIconContents
smallOkIcon
smallOkIconContents
smallOpenIcon
smallOpenIconContents
smallPaintIcon
smallPaintIconContents
smallPasteIcon
smallPasteIconContents
smallPrintIcon
smallPrintIconContents
smallProjectIcon
smallProjectIconContents
smallPublishIcon
smallPublishIconContents
smallQuitIcon
smallQuitIconContents
smallRedoIcon
smallRedoIconContents
smallRemoteOpenIcon
smallRemoteOpenIconContents
smallRightFlushIcon
smallRightFlushIconContents
smallSaveAsIcon
smallSaveAsIconContents
smallSaveIcon
smallSaveIconContents
smallSelectIcon
smallSelectIconContents
smallSqueakIcon
smallSqueakIconContents
smallUndoIcon
smallUndoIconContents
smallUpdateIcon
smallUpdateIconContents
smallVolumeIcon
smallVolumeIconContents
smallWindowIcon
smallWindowIconContents
squeakIcon
squeakIconContents
startUp:
tryIcons:
volumeIcon
volumeIconContents
windowIcon
windowIconContents
I represent an item in a menu.
Instance variables:
isEnabled <Boolean> True if the menu item can be executed.
subMenu <MenuMorph | nil> The submenu to activate automatically when the user mouses over the item.
isSelected <Boolean> True if the item is currently selected.
target <Object> The target of the associated action.
selector <Symbol> The associated action.
arguments <Array> The arguments for the associated action.
icon <Form | nil> An optional icon form to be displayed to my left.
If I have a dynamic marker, created by strings like <yes> or <no> in my contents, it will be installed as a submorph.
aboutToBeGrabbedBy:
Don't allow the receiver to act outside a Menu
activateOwnerMenu:
Activate our owner menu; e.g., pass control to it
activateSubmenu:
Activate our submenu; e.g., pass control to it
adaptToWorld:
The receiver finds itself operating in a possibly-different new world. If any of the receiver's parts are world-dependent (such as a target of a SimpleButtonMorph, etc.), then have them adapt accordingly
adjacentTo
allWordingsNotInSubMenus:
Answer a collection of the wordings of all items and subitems, but omit the stay-up item, and also any items in any submenu whose tag is in verbotenSubmenuContentsList
arguments
arguments:
bottomArrow
contentString
contentString:
contents:
contents:withMarkers:
contents:withMarkers:inverse:
Set the menu item entry. If aBool is true, parse aString for embedded markers.
defaultBounds
answer the default bounds for the receiver
deleteIfPopUp:
Recurse up for nested pop ups
deselect:
deselectItem
deselectTimeOut:
Deselect timout. Now really deselect
doButtonAction
Called programattically, this should trigger the action for which the receiver is programmed
drawOn:
duplicateMorph:
Make and return a duplicate of the receiver's argument
enabled
Delegate to exisitng method.
enabled:
Delegate to exisitng method.
hResizing
Default to #spaceFill
handleMouseUp:
The handling of control between menu item requires them to act on mouse up even if not the current focus. This is different from the default behavior which really only wants to handle mouse ups when they got mouse downs before
handlesMouseDown:
If the shift key is pressed then yes.
As normal if the editableStringMorphs preference is false.
handlesMouseOver:
Do I want to receive mouseEnter: and mouseLeave: when the button is up and the hand is empty? The default response is false, except if you have added sensitivity to mouseEnter: or mouseLeave:, using the on:send:to: mechanism.
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
hasIcon
Answer whether the receiver has an icon.
hasIconOrMarker
Answer whether the receiver has an icon or a marker.
hasMarker
Answer whether the receiver has a marker morph.
hasSubMenu
Return true if the receiver has a submenu
hasSubMenu:
icon
answer the receiver's icon
icon:
change the the receiver's icon
iconForm
private - answer the form to be used as the icon
initialize
initialize the state of the receiver
invokeWithEvent:
Perform the action associated with the given menu item.
isEnabled
isEnabled:
isSelected
isSelected:
isStayUpItem
itemWithWording:
If any of the receiver's items or submenu items have the given wording (case-blind comparison done), then return it, else return nil.
leftArrow
minHeight
Answer the minimum height of the receiver.
minWidth
answer the receiver's minWidth
mouseDown:
Handle a mouse down event. Menu items get activated when the mouse is over them.
mouseEnter:
The mouse entered the receiver
mouseEnterDragging:
The mouse entered the receiver. Do nothing if we're not in a 'valid menu transition', meaning that the current hand focus must be aimed at the owning menu.
mouseLeave:
The mouse has left the interior of the receiver...
mouseLeaveDragging:
The mouse left the receiver. Do nothing if we're not in a 'valid menu transition', meaning that the current hand focus must be aimed at the owning menu.
mouseUp:
Handle a mouse up event. Menu items get activated when the mouse is over them. Do nothing if we're not in a 'valid menu transition', meaning that the current hand focus must be aimed at the owning menu.
notObsolete
Provide backward compatibility with messages being sent to the Hand. Remove this when no projects made prior to 2.9 are likely to be used. If this method is removed early, the worst that can happen is a notifier when invoking an item in an obsolete menu.
noteNewOwner:
I have just been added as a submorph of aMorph
offImage
Return the form to be used for indicating an '<off>' marker
onImage
Return the form to be used for indicating an '<off>' marker
ownerChanged
The receiver's owner, some kind of a pasteup, has changed its
layout.
rightArrow
roundedCorners
Return a list of those corners to round
select:
selectionFillStyle
answer the fill style to use with the receiver is the selected
element
selector
selector:
subMenu
subMenu:
subMenuMarker
private - answer the form to be used as submenu marker
target
target:
Morphs with targets will override. This backstop does nothing.
themeChanged
Also pass on to the submenu if any.
upArrow
updateLayoutInDockingBar
vResizing
Default to #shrinkWrap
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied
at all, but shared. Warning!! Every instance variable defined in
this class must be handled. We must also implement
veryDeepFixupWith:. See DeepCopier class comment.
wantsHaloFromClick
Only if I'm not a lonely submenu
wantsRoundedCorners
Return true if the receiver wants its corners rounded
A MenuLineMorph is xxxxxxxxx.
Instance Variables
drawOn:
initialize
initialize the state of the receiver
minHeight
answer the receiver's minHeight
minWidth
answer the receiver's minWidth
noteNewOwner:
I have just been added as a submorph of aMorph
ownerChanged
The receiver's owner, some kind of a pasteup, has changed its
layout.
updateLayoutInDockingBar
Instance variables:
defaultTarget <Object> The default target for creating menu items
selectedItem <MenuItemMorph> The currently selected item in the receiver
stayUp <Boolean> True if the receiver should stay up after clicks
popUpOwner <MenuItemMorph> The menu item that automatically invoked the receiver, if any.
activeSubMenu <MenuMorph> The currently active submenu.
activate:
Receiver should be activated; e.g., so that control passes correctly.
activatedFromDockingBar:
activeSubmenu:
add:action:
Append a menu item with the given label. If the item is selected, it will send the given selector to the default target object.
add:help:action:
Append a menu item with the given label. If the item is
selected, it will send the given selector to the default target
object.
add:icon:help:subMenu:
Append the given submenu with the given label.
add:icon:subMenu:
Append the given submenu with the given label.
add:selector:argument:
add:subMenu:
Append the given submenu with the given label.
add:subMenu:target:selector:argumentList:
Append the given submenu with the given label.
add:target:action:
add:target:selector:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object.
add:target:selector:argument:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object with the given argument.
add:target:selector:argumentList:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object with the given arguments. If the selector takes one more argument than the number of arguments in the given list, then the triggering event is supplied as as the last argument.
add:target:selector:enabled:icon:
addAllFrom:
addBlankIconsIfNecessary:
If any of my items have an icon, ensure that all do by using
anIcon for those that don't
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addItem
addLine
Append a divider line to this menu. Suppress duplicate lines.
addList:
Add the given items to this menu, where each item is a pair (<string> <actionSelector>).. If an element of the list is simply the symobl $-, add a line to the receiver. The optional third element of each entry, if present, provides balloon help.
addService:for:
Append a menu item with the given service. If the item is selected, it will perform the given service.
addServices2:for:extraLines:
addServices:for:extraLines:
addStayUpIcons
Add the titlebar with buttons.
addStayUpItem
Append a menu item that can be used to toggle this menu's persistence.
addStayUpItemSpecial
Append a menu item that can be used to toggle this menu's persistent.
addSubmenu:enabled:
Append the given submenu with the given label.
addTitle
addTitle:
Add a title line at the top of this menu.
addTitle:icon:
Add a title line at the top of this menu.
addTitle:icon:updatingSelector:updateTarget:
Add a title line at the top of this menu Make aString its initial
contents.
If aSelector is not nil, then periodically obtain fresh values for
its
contents by sending aSelector to aTarget..
addTitle:updatingSelector:updateTarget:
Add a title line at the top of this menu Make aString its initial
contents.
If aSelector is not nil, then periodically obtain fresh values for
its contents by sending aSelector to aTarget..
addToggle:selector:
Append a menu item with the given label. If the item is selected,
it will send the given selector to the default target object.
addToggle:target:selector:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object.
addToggle:target:selector:getStateSelector:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object.
addToggle:target:selector:getStateSelector:argumentList:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object.
addToggle:target:selector:getStateSelector:enablementSelector:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object.
addToggle:target:selector:getStateSelector:enablementSelector:argumentList:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object.
addTranslatedList:
Add the given items to this menu, where each item is a pair (<string> <actionSelector>).. If an element of the list is simply the symobl $-, add a line to the receiver. The optional third element of each entry, if present, provides balloon help.
The first and third items will be translated.
addUpdating:action:
addUpdating:enablement:action:
addUpdating:enablementSelector:target:selector:argumentList:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object with the given arguments. If the selector takes one more argument than the number of arguments in the given list, then the triggering event is supplied as as the last argument. In this variant, the wording of the menu item is obtained by sending the wordingSelector to the target, and the optional enablementSelector determines whether or not the item should be enabled. Answer the item itself.
addUpdating:target:action:
addUpdating:target:selector:argumentList:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object with the given arguments. If the selector takes one more argument than the number of arguments in the given list, then the triggering event is supplied as as the last argument. In this variant, the initial wording of the menu item is obtained by sending the wordingSelector to the target. If the wording prefixed with <yes> or <no>, the on/off state of the menu item will reflect it.
addWithLabel:enablement:action:
addWithLabel:enablementSelector:target:selector:argumentList:
Append a menu item with the given label. If the item is selected, it will send the given selector to the target object with the given arguments. If the selector takes one more argument than the number of arguments in the given list, then the triggering event is supplied as as the last argument. In this variant, the wording of the menu item is constant, and the optional enablementSelector determines whether or not the item should be enabled.
adoptPaneColor:
Change our color.
balloonTextForLastItem:
closeBoxImage
color:
Set the receiver's color. Remember the base color in the case of a gradient background.
commandKeyHandler
Answer the receiver's commandKeyHandler
commandKeyHandler:
Set the receiver's commandKeyHandler. Whatever you set here needs to be prepared to respond to the message #commandKeyTypedIntoMenu:
defaultTarget
defaultTarget:
Set the default target for adding menu items.
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
deleteIfPopUp
Remove this menu from the screen if stayUp is not true. If it is a submenu, also remove its owning menu.
deleteIfPopUp:
Remove this menu from the screen if stayUp is not true. If it is a submenu, also remove its owning menu.
detachSubMenu:
displayAt:during:
Add this menu to the Morphic world during the execution of the given block.
displayFiltered:
doButtonAction
Do the receiver's inherent button action. Makes sense for the kind of MenuMorph that is a wrapper for a single menu-item -- pass it on the the item
drawOn:
Draw the menu. Add keyboard-focus feedback if appropriate
entitled:
example
filterListWith:
fromArray:
handleFocusEvent:
Handle focus events. Valid menu transitions are determined based on the menu currently holding the focus after the mouse went down on one of its children.
handlesKeyboard:
Answer whether the receiver handles the keystroke represented by the event
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
hasItems
Answer if the receiver has menu items
hasSubMenu:
iconNamed:
informUserAt:during:
Add this menu to the Morphic world during the execution of the given
block.
initialize
initialize the state of the receiver
invokeAt:in:
Add this menu to the given world centered at the given point. Wait for the user to make a selection and answer it. The selection value returned is an integer in keeping with PopUpMenu, if the menu is converted from an MVC-style menu.
invokeAt:in:allowKeyboard:
Add this menu to the given world centered at the given point. Wait for the user to make a selection and answer it. The selection value returned is an integer in keeping with PopUpMenu, if the menu is converted from an MVC-style menu.
invokeMetaMenu:
invokeModal
Invoke this menu and don't return until the user has chosen a value.
See example below on how to use modal menu morphs.
invokeModal:
Invoke this menu and don't return until the user has chosen a value. If the allowKeyboarControl boolean is true, permit keyboard control of the menu
invokeModalAt:in:allowKeyboard:
Invoke this menu and don't return until the user has chosen a value.
See senders of this method for finding out how to use modal menu morphs.
isModalInvokationDone
isModalInvokationDone:
itemWithWording:
If any of the receiver's items or submenu items have the given wording (case-blind comparison done), then return it, else return nil.
items
justDroppedInto:event:
This message is sent to a dropped morph after it has been dropped on -- and been accepted by -- a drop-sensitive morph
keyStroke:
Handle keboard item matching.
keyboardFocusChange:
Notify change due to green border for keyboard focus
labels:lines:selections:
This method allows the receiver to accept old-style SelectionMenu creation messages. It should be used only for backward compatibility during the MVC-to-Morphic transition. New code should be written using the other menu construction protocol such as addList:.
lastItem
lastSelection
Return the label of the last selected item or nil.
modalSelection
modalSelection:
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
mouseDown:
Handle a mouse down event.
mouseDownInTitle:
Handle a mouse down event in the title bar.
mouseUp:
Handle a mouse up event.
Note: This might be sent from a modal shell.
moveDown:
moveRightOrDown:
moveSelectionDown:event:
Move the current selection up or down by one, presumably under keyboard control.
direction = +/-1
moveUp:
popUpAdjacentTo:forHand:from:
Present this menu at the given point under control of the given
hand.
popUpAt:forHand:in:
Present this menu at the given point under control of the given hand. Allow keyboard input into the menu.
popUpAt:forHand:in:allowKeyboard:
Present this menu at the given point under control of the given
hand.
popUpEvent:in:
Present this menu in response to the given event.
popUpForHand:in:
Present this menu under control of the given hand.
popUpInWorld
Present this menu in the current World
popUpInWorld:
Present this menu under control of the given hand.
popUpNoKeyboard
Present this menu in the current World, *not* allowing keyboard input into the menu
popUpOwner
Return the current pop-up owner that is the menu item that automatically initiated the receiver.
popUpOwner:
Set the current pop-up owner
positionAt:relativeTo:inWorld:
Note: items may not be laid out yet (I found them all to be at 0@0),
so we have to add up heights of items above the selected item.
pushPinImage
removeMatchString
Remove the matchString, if any.
removeStayUpBox
removeStayUpItems
rootMenu
roundedCorners
Return a list of those corners to round
selectCurrentItem:
selectItem:event:
selectMoreItem:
selectedItem
setDefaultParameters
change the receiver's appareance parameters
setInvokingView:
Re-work every menu item of the form
<target> perform: <selector>
to the form
<target> perform: <selector> orSendTo: <invokingView>.
This supports MVC's vectoring of non-model messages to the editPane.
setTarget:
Set the default target object to be used for add item commands, and re-target all existing items to the new target or the the invoking hand.
setTitleParametersFor:
stayUp
stayUp:
takesKeyboardFocus
Answer whether the receiver can normally take keyboard focus.
target:
Set defaultTarget since thats what we got.
For the sake of targetSighting which assumes #target is a word we know.
themeChanged
Update the colour if specified.
title:
Add a title line at the top of this menu.
toggleStayUp:
Toggle my 'stayUp' flag and adjust the menu item to reflect its new state.
toggleStayUpIgnore:evt:
This variant is resistant to the MVC compatibility in #setInvokingView:
undoGrabCommand
Return an undo command for grabbing the receiver
unfilterOrEscape:
updateColor
Update the color of the menu.
updateItemsWithTarget:orWithHand:
re-target all existing items
veryDeepFixupWith:
If fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals.
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared. Warning!! Every instance variable defined in this class must be handled. We must also implement veryDeepFixupWith:. See DeepCopier class comment.
wantsToBeDroppedInto:
Return true if it's okay to drop the receiver into aMorph. A single-item MenuMorph is in effect a button rather than a menu, and as such should not be reluctant to be dropped into another object.
wasActivatedFromDockingBar
answer true if the receiver was activated from a docking bar
MixedCurveMorph
A MixedCurveMorph is Curve that can be broken up into separately curved segments. It allows for the creation of matching edges( e. g. for jigsaw puzzle pieces).
Instance Variables
slopeClamps: <Array>
slopeClamps
- elements of array are either 0 or nil. Indicating whether slope for the corresponding vertex is 0@0 or unknown and therefore to be calculated. There is one element for each vertex.

clamps
Return a collection of clamps the same size as vertices.
If necessary default to unclamped slopes.
clickVertex:event:fromHandle:
Toggle the state of the clamp.
deleteVertexAt:
This acts as a backstop for MixedCurveMorph.
handleColorAt:
clamped handles are cyan and
unclamped handles are yellow.
initialize
initialize the state of the receiver
insertVertexAt:put:
New vertexs are unclamped.
slopes:
Choose slopes according to state of polygon and preferences
Morph
A Morph (from the Greek "shape" or "form") is an interactive graphical object. General information on the Morphic system can be found at http://minnow.cc.gatech.edu/squeak/30.
Morphs exist in a tree, rooted at a World (generally a PasteUpMorph). The morphs owned by a morph are its submorphs. Morphs are drawn recursively; if a Morph has no owner it never gets drawn. To hide a Morph and its submorphs, set its #visible property to false using the #visible: method.
The World (screen) coordinate system is used for most coordinates, but can be changed if there is a TransformMorph somewhere in the owner chain.
My instance variables have accessor methods (e.g., #bounds, #bounds:). Most users should use the accessor methods instead of using the instance variables directly.
Structure:
instance var Type Description
bounds Rectangle A Rectangle indicating my position and a size that will enclose me.
owner Morph My parent Morph, or nil for the top-level Morph, which is a
or nil world, typically a PasteUpMorph.
submorphs Array My child Morphs.
fullBounds Rectangle A Rectangle minimally enclosing me and my submorphs.
color Color My primary color. Subclasses can use this in different ways.
extension MorphExtension Allows extra properties to be stored without adding a
or nil storage burden to all morphs.
By default, Morphs do not position their submorphs. Morphs may position their submorphs directly or use a LayoutPolicy to automatically control their submorph positioning.
Although Morph has some support for BorderStyle, most users should use BorderedMorph if they want borders.
abandon
Like delete, but we really intend not to use this morph again. Clean up a few things.
aboutToBeGrabbedBy:
The receiver is being grabbed by a hand.
Perform necessary adjustments (if any) and return the actual morph
that should be added to the hand.
acceptDroppingMorph:event:
This message is sent when a morph is dropped onto a morph that has agreed to accept the dropped morph by responding 'true' to the wantsDroppedMorph:Event: message. This default implementation just adds the given morph to the receiver.
actWhen
Answer when the receiver, probably being used as a button, should have its action triggered
actWhen:
Set the receiver's actWhen trait
actionMap
Answer an action map
activate
Mark the receiver and submorphs as active (foreground).
activeHand
adaptToWorld:
The receiver finds itself operating in a possibly-different new world. If any of the receiver's parts are world-dependent (such as a target of a SimpleButtonMorph, etc.), then have them adapt accordingly
addAddHandMenuItemsForHalo:hand:
The former charter of this method was to add halo menu items that pertained specifically to the hand. Over time this charter has withered, and most morphs reimplement this method simply to add their morph-specific menu items. So in the latest round, all other implementors in the standard image have been removed. However, this is left here as a hook for the benefit of existing code in client uses.
addAlarm:after:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAlarm:at:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAlarm:with:after:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAlarm:with:at:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAlarm:with:with:after:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAlarm:with:with:at:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAlarm:withArguments:after:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAlarm:withArguments:at:
Add an alarm (that is an action to be executed once) with the given set of parameters
addAllMorphs:
addAllMorphs:after:
addBorderStyleMenuItems:hand:
Probably one could offer border-style items even if it's not a borderedMorph, so this remains a loose end for the moment
addCellLayoutMenuItems:hand:
Cell (e.g., child) related items
addCustomHaloMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand from the halo. To get started, we defer to the counterpart method used with the option-menu, but in time we can have separate menu choices for halo-menus and for option-menus
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addDebuggingItemsTo:hand:
addDropShadow
addDropShadowMenuItems:hand:
addEmbeddingMenuItemsTo:hand:
Construct a menu offerring embed targets for the receiver. If the incoming menu is is not degenerate, add the constructed menu as a submenu; in any case, answer the embed-target menu
addExportMenuItems:hand:
Add export items to the menu
addFillStyleMenuItems:hand:
Add the items for changing the current fill style of the Morph
addFlexShell
Wrap a rotating and scaling shell around this morph.
addFlexShellIfNecessary
If this morph requires a flex shell to scale or rotate,
then wrap it in one and return it.
Polygons, eg, may override to return themselves.
addHalo
Invoke a halo programatically (e.g., not from a meta gesture)
addHalo:
addHalo:from:
Transfer a halo from the former halo owner to the receiver
addHaloActionsTo:
Add items to aMenu representing actions requestable via halo
addHandlesTo:box:
Add halo handles to the halo. Apply the halo filter if appropriate
addLayoutMenuItems:hand:
addMagicHaloFor:
addMiscExtrasTo:
Add a submenu of miscellaneous extra items to the menu.
addModelYellowButtonItemsTo:event:
Give my models a chance to add their context-menu items to
aCustomMenu.
addMorph:
addMorph:after:
Add the given morph as one of my submorphs, inserting it after anotherMorph
addMorph:asElementNumber:
Add the given morph so that it becomes the aNumber'th element of my submorph list. If aMorph is already one of my submorphs, reposition it
addMorph:behind:
Add a morph to the list of submorphs behind the specified morph
addMorph:fullFrame:
addMorph:inFrontOf:
Add a morph to the list of submorphs in front of the specified morph
addMorphBack:
addMorphCentered:
addMorphFront:
addMorphFront:fromWorldPosition:
addMorphFrontFromWorldPosition:
addMorphInFrontOfLayer:
addMorphInLayer:
addMorphsTo:pianoRoll:eventTime:betweenTime:and:
a hack to allow for abitrary morphs to be dropped into piano roll
addMouseActionIndicatorsWidth:color:
addMouseUpAction
addMouseUpActionWith:
addMyYellowButtonMenuItemsToSubmorphMenus
Answer true if I have items to add to the context menus of my submorphs
addNestedYellowButtonItemsTo:event:
Add items to aMenu starting with me and proceeding down
through my submorph chain,
letting any submorphs that include the event position
contribute their items to the bottom of the menu, separated by
a line.
addOptionalHandlesTo:box:
addPaintingItemsTo:hand:
addSimpleHandlesTo:box:
addStandardHaloMenuItemsTo:hand:
Add standard halo items to the menu
addTableLayoutMenuItems:hand:
addTextAnchorMenuItems:hand:
addTitleForHaloMenu:
addToggleItemsToHaloMenu:
Add standard true/false-checkbox items to the memu
addTransparentSpacerOfSize:
addViewingItemsTo:
Add viewing-related items to the given menu. If any are added, this method is also responsible for adding a line after them
addWorldHandlesTo:box:
addWorldTargetSightingItems:hand:
Use cursor to select a point on screen.
Set target from all possible morphs under cursor sight.
addYellowButtonMenuItemsTo:event:
Populate aMenu with appropriate menu items for a
yellow-button (context menu) click.
addedMorph:
Notify the receiver that the given morph was just added.
adhereToEdge
adhereToEdge:
adjustLayoutBounds
Adjust the receivers bounds depending on the resizing strategy imposed
adjustedCenter
Provides a hook for objects to provide a reference point other than the receiver's center,for the purpose of centering a submorph under special circumstances, such as BalloonMorph
adjustedCenter:
Set the receiver's position based on the #adjustedCenter protocol for adhereToEdge. By default this simply sets the receiver's center. Though there are (at its inception anyway) no other implementors of this method, it is required in use with the #adhereToEdge when the centering of a submorph is to be with reference to a rectangle other than the receiver's center.
adoptPaneColor
Adopt our pane color.
adoptPaneColor:
affiliatedSelector
Answer a selector affiliated with the receiver for the purposes of launching a messenger. Reimplement this to plug into the messenger service
alarmScheduler
Return the scheduler being responsible for triggering alarms
align:with:
Translate by aPoint2 - aPoint1.
allKnownNames
Return a list of all known names based on the scope of the receiver. Does not include the name of the receiver itself. Items in parts bins are excluded. Reimplementors (q.v.) can extend the list
allMenuWordings
allMorphs
Return a collection containing all morphs in this composite morph (including the receiver).
allMorphsDo:
Evaluate the given block for all morphs in this composite morph (including the receiver).
allMorphsInto:
Return a set of all submorphs. Don't forget the hidden ones. Consider only objects that are in memory (see allNonSubmorphMorphs).
allNonSubmorphMorphs
Return a collection containing all morphs in this morph which are not currently in the submorph containment hierarchy
allOwners
Return the owners of the reciever
allOwnersDo:
Evaluate aBlock with all owners of the receiver
allStringsAfter:
return an OrderedCollection of strings of text in my submorphs. If aSubmorph is non-nil, begin with that container.
allSubmorphNamesDo:
Return a list of all known names of submorphs and nested submorphs of the receiver, based on the scope of the receiver. Items in parts bins are excluded
altSpecialCursor1
a star and an arrow
altSpecialCursor3:
a bulls-eye pattern in this color
areasRemainingToFill:
Pushed up from BorderedMorph, all cases tested for there are
supported by basic Morph.
arrangeToStartStepping
Arrange to start getting sent the 'step' message, but don't do that initial #step call that startStepping does
arrangeToStartSteppingIn:
Start getting sent the 'step' message in aWorld. Like startSteppingIn:, but without the initial one to get started'
asDraggableMorph
asHttpResponseTo:
asMIMEDocument
asMIMEDocumentType:
asMorph
Open a morph, as best one can, on the receiver
asNINode
asNumber:
Support for e-toy demo.
asSnapshotThumbnail
assureExtension
creates an extension for the receiver if needed
assureExternalName
assureLayoutProperties
assureTableProperties
attachToResource
Produce a morph from a file -- either a saved .morph file or a graphics file
authoringPrototype
balloonColor
balloonColor:
balloonFont
balloonFont:
balloonHelpAligner
Answer the morph to which the receiver's balloon help should point
balloonHelpDelayTime
Return the number of milliseconds before a balloon help should be put up on the receiver. The balloon help will only be put up if the receiver responds to #wantsBalloon by returning true.
balloonHelpTextForHandle:
Answer a string providing balloon help for the
given halo handle
balloonText
Answer balloon help text or nil, if no help is available.
NB: subclasses may override such that they programatically
construct the text, for economy's sake, such as model phrases in
a Viewer
balloonTextSelector
Answer balloon text selector item in the extension, nil if none
balloonTextSelector:
change the receiver's balloonTextSelector
basicInitialize
Do basic generic initialization of the instance variables:
Set up the receiver, created by a #basicNew and now ready to
be initialized, by placing initial values in the instance variables
as appropriate
beFlap:
Mark the receiver with the #flap property, or unmark it
beSticky
make the receiver sticky
beTransparent
beUnsticky
If the receiver is marked as sticky, make it now be unsticky
becomeModal
blueButtonDown:
Special gestures (cmd-mouse on the Macintosh; Alt-mouse on Windows and Unix) allow a mouse-sensitive morph to be moved or bring up a halo for the morph.
blueButtonUp:
Ignored. Theoretically we should never get here since control is transferred to the halo on #blueButtonDown: but subclasses may implement this differently.
borderColor
borderColor:
Unfortunately, the argument to borderColor could be more than just a color.
It could also be a symbol, in which case it is to be interpreted as a style identifier.
But I might not be able to draw that kind of border, so it may have to be ignored.
Or it could be nil, in which case I should revert to the default border.
borderStyle
borderStyle:
borderStyleForSymbol:
Answer a suitable BorderStyle for me of the type represented by a given symbol
borderWidth
borderWidth:
borderWidthForRounding
bottom
Return the y-coordinate of my bottom side
bottom:
Move me so that my bottom is at the y-coordinate aNumber. My extent (width & height) are unchanged
bottomCenter
bottomLeft
bottomLeft:
Move me so that my bottom left corner is at aPoint. My extent (width & height) are unchanged
bottomRight
bottomRight:
Move me so that my bottom right corner is at aPoint. My extent (width & height) are unchanged
boundingBoxOfSubmorphs
bounds
Return the bounds of this morph.
bounds:
bounds:from:
Return the receiver's bounds as seen by aMorphs coordinate frame
bounds:in:
Return the receiver's bounds as seen by aMorphs coordinate frame
boundsForBalloon
some morphs have bounds that are way too big
boundsIn:
Return the receiver's bounds as seen by aMorphs coordinate frame
boundsInWorld
boundsWithinCorners
Changed to be more realistic...
browserIcon
buildDebugMenu:
Answer a debugging menu for the receiver.
The hand argument is seemingly historical and plays no role presently
buildHandleMenu:
Build the morph menu for the given morph's halo's menu handle. This menu has two sections. The first section contains commands that are interpreted by the hand; the second contains commands provided by the target morph. This method allows the morph to decide which items should be included in the hand's section of the menu.
buildMetaMenu:
Build the morph menu. This menu has two sections. The first section contains commands that are handled by the hand; the second contains commands handled by the argument morph.
buildYellowButtonMenu:
build the morph menu for the yellow button
canDrawAtHigherResolution
canDrawBorder:
Return true if the receiver can be drawn with the given border style.
canHaveFillStyles
Return true if the receiver can have general fill styles; not just colors.
This method is for gradually converting old morphs.
cellInset
Layout specific. This property specifies an extra inset for each cell in the layout.
cellInset:
Layout specific. This property specifies an extra inset for each cell in the layout.
cellPositioning
Layout specific. This property describes how the receiver should be layed out in its owner when the bounds of the cell assigned to the receiver do not exactly match its bounds. Possible values are:
#topLeft, #topRight, #bottomLeft, #bottomRight, #topCenter, #leftCenter, #rightCenter, #bottomCenter, #center
which align the receiver's bounds with the cell at the given point.
cellPositioning:
Layout specific. This property describes how the receiver should be layed out in its owner when the bounds of the cell assigned to the receiver do not exactly match its bounds. Possible values are:
#topLeft, #topRight, #bottomLeft, #bottomRight, #topCenter, #leftCenter, #rightCenter, #bottomCenter, #center
which align the receiver's bounds with the cell at the given point.
cellPositioningString:
cellSpacing
Layout specific. This property describes how the cell size for each element in a list should be computed.
#globalRect - globally equal rectangular cells
#globalSquare - globally equal square cells
#localRect - locally (e.g., per row/column) equal rectangular cells
#localSquare - locally (e.g., per row/column) equal square cells
#none - cells are sized based on available row/column constraints
cellSpacing:
Layout specific. This property describes how the cell size for each element in a list should be computed.
#globalRect - globally equal rectangular cells
#globalSquare - globally equal square cells
#localRect - locally (e.g., per row/column) equal rectangular cells
#localSquare - locally (e.g., per row/column) equal square cells
#none - cells are sized based on available row/column constraints
cellSpacingString:
center
center:
changeAllBorderColorsFrom:to:
Set any occurrence of oldColor as a border color in my entire submorph tree to be newColor
changeCellInset:
changeClipLayoutCells
changeClipSubmorphs
changeColor
Change the color of the receiver -- triggered, e.g. from a menu
changeColorTarget:selector:originalColor:hand:
Put up a color picker for changing some kind of color. May be modal or modeless, depending on #modalColorPickers setting
changeDirectionHandles
changeDisableTableLayout
changeDocumentAnchor
Change the anchor from/to document anchoring
changeDragAndDrop
changeInlineAnchor
Change the anchor from/to line anchoring
changeLayoutInset:
changeListDirection:
changeMaxCellSize:
changeMinCellSize:
changeNoLayout
changeParagraphAnchor
Change the anchor from/to paragraph anchoring
changeProportionalLayout
changeReverseCells
changeRubberBandCells
changeShadowColor
Change the shadow color of the receiver -- triggered, e.g. from a menu
changeTableLayout
changed
Report that the area occupied by this morph should be redrawn.
Fixed to include submorphs outside the outerBounds.
clearArea
Answer the clear area of the receiver. It means the area free
of docking bars.
click
Pretend the user clicked on me.
click:
Handle a single-click event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing.
LC 2/14/2000 08:32 - added: EventHandler notification
clipLayoutCells
Drawing/layout specific. If this property is set, clip the
submorphs of the receiver by its cell bounds.
clipLayoutCells:
Drawing/layout specific. If this property is set, clip the submorphs of the receiver by its cell bounds.
clipSubmorphs
Drawing specific. If this property is set, clip the receiver's
submorphs to the receiver's clipping bounds.
clipSubmorphs:
Drawing specific. If this property is set, clip the receiver's submorphs to the receiver's clipping bounds.
clipText
Copy the text in the receiver or in its submorphs to the clipboard
clippingBounds
Return the bounds to which any submorphs should be clipped if the property is set
collapse
color
color:
Set the receiver's color. Directly set the color if appropriate, else go by way of fillStyle
colorChangedForSubmorph:
The color associated with aSubmorph was changed through the UI; react if needed
colorForInsets
Return the color to be used for shading inset borders. The default is my own color, but it might want to be, eg, my owner's color. Whoever's color ends up prevailing, the color itself gets the last chance to determine, so that when, for example, an InfiniteForm serves as the color, callers won't choke on some non-Color object being returned
colorString:
comeToFront
comeToFrontAndAddHalo
commandHistory
Return the command history for the receiver
completeModificationHash
World completeModificationHash
constructorString
containingWindow
Answer a window that contains the receiver
containsPoint:
containsPoint:event:
Return true if aPoint is considered to be inside the receiver for the given event.
The default implementation treats locked children as integral part of their owners.
convertNovember2000DropShadow:using:
Work hard to eliminate the DropShadow. Inst vars are already
stored into.
copy
Answer another instance just like the receiver. Subclasses typically override postCopy; they typically do not override shallowCopy.
copyToPasteBuffer:
copyWithoutSubmorph:
Needed to get a morph to draw without one of its submorphs.
NOTE: This must be thrown away immediately after use.
cornerStyle
Returns one of the following symbols:
#square
#rounded
according to the current corner style.
cornerStyle:
This method makes it possible to set up desired corner style. aSymbol has to be one of:
#square
#rounded
couldHaveRoundedCorners
creationStamp
Answer the creation stamp stored within the receiver, if any
cursor
vacuous backstop in case it gets sent to a morph that doesn't know what to do with it
cursor:
vacuous backstop in case it gets sent to a morph that doesn't know what to do with it
cursorPoint
decimalPlacesForGetter:
Answer the decimal places I prefer for showing a slot with the given getter, or nil if none
deepCopy
Answer a copy of the receiver with its own copy of each instance
variable.
defaultBalloonColor
defaultBalloonFont
defaultBitmapFillForm
defaultBounds
answer the default bounds for the receiver
defaultColor
answer the default color/fill style for the receiver
defaultEventDispatcher
Return the default event dispatcher to use with events that are directly sent to the receiver
defaultFloatPrecisionFor:
Answer a number indicating the default float precision to be used in a numeric readout for which the receiver provides the data. Individual morphs can override this. Showing fractional values for readouts of getCursor was in response to an explicit request from ack
defaultLabelForInspector
Answer the default label to be used for an Inspector window on the receiver.
defaultTaskbarThumbnailExtent
Answer the default size of a taskbar thumbnail for the receiver.
defersHaloOnClickTo:
If a cmd-click on aSubMorph would make it a preferred recipient of the halo, answer true
defineTempCommand
To use this, comment out what's below here, and substitute your own code.
You will then be able to invoke it from the standard debugging menus. If invoked from the world menu, you'll always get it invoked on behalf of the world, but if invoked from an individual morph's meta-menu, it will be invoked on behalf of that individual morph.
Note that you can indeed reimplement tempCommand in an individual morph's class if you wish
degreesOfFlex
Return any rotation due to flexing
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
deleteAnyMouseActionIndicators
deleteBalloon
If I am showing a balloon, delete it.
deleteDockingBars
Delete the receiver's docking bars
deleteSubmorphsWithProperty:
dialogWindow
Answer the receiver's dialog window.
disableDragNDrop
disableSubmorphFocusForHand:
Check whether this morph or any of its submorph has the Genie focus.
If yes, disable it.
disableTableLayout
Layout specific. Disable laying out the receiver in table layout
disableTableLayout:
Layout specific. Disable laying out the receiver in table layout
dismissMorph
This is called from an explicit halo destroy/delete action.
dismissMorph:
dismissViaHalo
The user has clicked in the delete halo-handle. This provides a hook in case some concomitant action should be taken, or if the particular morph is not one which should be put in the trash can, for example.
doButtonAction
If the receiver has a button-action defined, do it now. The default button action of any morph is, well, to do nothing. Note that there are several ways -- too many ways -- for morphs to have button-like actions. This one refers not to the #mouseUpCodeToRun feature, nor does it refer to the Player-scripting mechanism. Instead it is intended for morph classes whose very nature is to be buttons -- this method provides glue so that arbitrary buttons on the UI can be 'fired' programatticaly from user scripts
doCancel
doLayoutIn:
Compute a new layout based on the given layout bounds.
dockingBars
Answer the receiver's dockingBars
doesBevels
To return true means that this object can show bevelled borders, and
therefore can accept, eg, #raised or #inset as valid borderColors.
Must be overridden by subclasses that do not support bevelled borders.
doesOwnRotation
Some morphs don't want to TransformMorph to rotate their images, but we do
doubleClick:
Handle a double-click event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing.
LC 2/14/2000 08:32 - added: EventHandler notification
doubleClickTimeout:
Handle a double-click timeout event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing.
dragEnabled
Get this morph's ability to add and remove morphs via drag-n-drop.
dragEnabled:
dragNDropEnabled
Note: This method is only useful for dragEnabled == dropEnabled at all times
dragSelectionColor
drawDropHighlightOn:
drawDropShadowOn:
drawErrorOn:
The morph (or one of its submorphs) had an error in its drawing method.
drawKeyboardFocusOn:
Draw the keyboard focus indication.
drawMouseDownHighlightOn:
drawOn:
drawOnCanvas:
drawRolloverBorderOn:
drawSubmorphsOn:
Display submorphs back to front
dropEnabled
Get this morph's ability to add and remove morphs via drag-n-drop.
dropEnabled:
dropFiles:
Handle a number of files dropped from the OS
dropHighlightColor
dropSuccessColor
duplicate
Make and return a duplicate of the receiver
duplicateMorph:
Make and return a duplicate of the receiver's argument
duplicateMorphCollection:
Make and return a duplicate of the receiver
duplicateMorphImage:
Make and return a imageMorph of the receiver's argument imageForm
editBalloonHelpContent:
editBalloonHelpText
Modify the receiver's balloon help text.
embedInWindow
embedInto:
Embed the receiver into some other morph
embeddedInMorphicWindowLabeled:
enableDrag:
enableDragNDrop
enableDragNDrop:
Set both properties at once
enableDrop:
enabled
Answer whether the receiver is enabled.
encounteredAtTime:inScorePlayer:atIndex:inEventTrack:secsPerTick:
a hack to allow for abitrary morphs to be dropped into piano roll
eventHandler
answer the receiver's eventHandler
eventHandler:
Note that morphs can share eventHandlers and all is OK.
expandFullBoundsForDropShadow:
Return an expanded rectangle for an eventual drop shadow.
expandFullBoundsForRolloverBorder:
exportAsBMP
exportAsGIF
exportAsJPEG
Export the receiver's image as a JPEG
exportAsPNG
extension
answer the recevier's extension
extent
extent:
externalName
Answer an external name by which the receiver is known. Generic implementation here is a transitional backstop. probably
fileReaderServicesForFile:suffix:
fillStyle
Return the current fillStyle of the receiver.
fillStyle:
Set the current fillStyle of the receiver.
Optimized for no change.
fillWithRamp:oriented:
findA:
Return the first submorph of the receiver that is descended from the given class. Return nil if there is no such submorph. Clients of this code should always check for a nil return value so that the code will be robust if the user takes the morph apart.
findDeepSubmorphThat:ifAbsent:
findDeeplyA:
Return a morph in the submorph tree of the receiver that is descended from the given class. Return nil if there is no such morph. Clients of this code should always check for a nil return value so that the code will be robust if the user takes the morph apart.
findSubmorphBinary:
Use binary search for finding a specific submorph of the receiver. Caller must be certain that the ordering holds for the submorphs.
fire
If the receiver has any kind of button-action defined, fire that action now. Any morph can have special, personal mouseUpCodeToRun, and that will be triggered by this. Additionally, some morphs have specific buttonness, and these get sent the #doButtonAction message to carry out their firing. Finally, some morphs have mouse behaviors associated with one or more Player scripts.
For the present, we'll try out doing *all* the firings this object can do.
firedMouseUpCode
If the user has special mouseUpCodeToRun, then fire it once right now and return true, else return false
firstClickTimedOut:
Useful for double-click candidates who want to know whether or not the click is a single or double. In this case, ignore the #click: and wait for either this or #doubleClick:
firstOwnerSuchThat:
firstSubmorph
flash
Do nothing.
flashBounds
Flash the receiver's bounds -- does not use the receiver's color, thus works with StringMorphs and SketchMorphs, etc., for which #flash is useless. No senders initially, but useful to send this from a debugger or inspector
focusBounds
Answer the bounds for drawing the focus indication.
focusChanged
Report that the area occupied by the morph's focus indicator should be redrawn.
Optimized for border-only (no fill).
focusColor
Answer the keyboard focus indication color.
focusIndicatorCornerRadius
Answer the corner radius preferred for the focus indicator
for the receiver for themes that support this.
focusIndicatorMorph
Answer the focus indicator morph for the receiver.
formerOwner
formerOwner:
formerPosition
formerPosition:
forwardDirection
Return the receiver's forward direction (in eToy terms)
forwardDirection:
Set the receiver's forward direction (in eToy terms)
fromFileName:
fullBounds
Return the bounding box of the receiver and all its children. Recompute the layout if necessary.
fullBoundsInWorld
fullContainsPoint:
fullCopy
Deprecated, but maintained for backward compatibility with existing code (no senders in the base 3.0 image). Calls are revectored to #veryDeepCopy, but note that #veryDeepCopy does not do exactly the same thing that the original #fullCopy did, so beware!
fullDrawOn:
Draw the full Morphic structure on the given Canvas
fullLoadCachedState
Load the cached state of the receiver and its full submorph tree.
fullPrintOn:
fullReleaseCachedState
Release the cached state of the receiver and its full submorph tree.
getCharacters
obtain a string value from the receiver. The default generic response is simply the name of the object.
getNumericValue
Only certain kinds of morphs know how to deal with this frontally; here we provide support for a numeric property of any morph
globalPointToLocal:
goBehind
goHome
grabMorph:
grabTransform
Return the transform for the receiver which should be applied during grabbing
gridFormOrigin:grid:background:line:
gridPoint:
griddedPoint:
hResizing
Layout specific. This property describes how the receiver should be resized with respect to its owner and its children. Possible values are:
#rigid - do not resize the receiver
#spaceFill - resize to fill owner's available space
#shrinkWrap - resize to fit children
hResizing:
Layout specific. This property describes how the receiver should be resized with respect to its owner and its children. Possible values are:
#rigid - do not resize the receiver
#spaceFill - resize to fill owner's available space
#shrinkWrap - resize to fit children
hResizingString:
halo
haloClass
Answer the name of the desired kind of HaloMorph to launch on behalf of the receiver
haloDelayTime
Return the number of milliseconds before a halo should be put up on the receiver. The halo will only be put up if the receiver responds to #wantsHalo by returning true.
handleDropFiles:
Handle a drop from the OS.
handleDropMorph:
Handle a dropping morph.
handleEvent:
Handle the given event
handleFocusEvent:
Handle the given event. This message is sent if the receiver currently has the focus and is therefore receiving events directly from some hand.
handleKeyDown:
System level event handling.
handleKeyUp:
System level event handling.
handleKeystroke:
System level event handling.
handleListenEvent:
Handle the given event. This message is sent if the receiver is a registered listener for the given event.
handleMouseDown:
System level event handling.
handleMouseEnter:
System level event handling.
handleMouseLeave:
System level event handling.
handleMouseMove:
System level event handling.
handleMouseOver:
System level event handling.
handleMouseStillDown:
Called from the stepping mechanism for morphs wanting continuously repeated 'yes the mouse is still down, yes it is still down, yes it has not changed yet, no the mouse is still not up, yes the button is down' etc messages
handleMouseUp:
System level event handling.
handleMouseWheel:
System level event handling.
handleUnknownEvent:
An event of an unknown type was sent to the receiver. What shall we do?!
handlerForBlueButtonDown:
Return the (prospective) handler for a mouse down event. The handler is temporarily installed and can be used for morphs further down the hierarchy to negotiate whether the inner or the outer morph should finally handle the event.
Note: Halos handle blue button events themselves so we will only be asked if there is currently no halo on top of us.
Check whtehr halods are enabled (for deployment).
handlerForMetaMenu:
Return the prospective handler for invoking the meta menu. By default, the top-most morph in the innermost world gets this menu
handlerForMouseDown:
Return the (prospective) handler for a mouse down event. The handler is temporarily
installed and can be used for morphs further down the hierarchy to negotiate whether
the inner or the outer morph should finally handle the event.
handlerForYellowButtonDown:
Return the (prospective) handler for a mouse down event with the yellow button pressed.
The handler is temporarily installed and can be used for morphs further
down the hierarchy to negotiate whether the inner or the outer
morph should finally handle the event.
handlesDropShadowInHand
Answer whether the receiver will handle drop shadow drawing when picked up in the hand.
handlesKeyboard:
Return true if the receiver wishes to handle the given keyboard event
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesMouseOver:
Do I want to receive mouseEnter: and mouseLeave: when the button is up and the hand is empty? The default response is false, except if you have added sensitivity to mouseEnter: or mouseLeave:, using the on:send:to: mechanism.
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
handlesMouseStillDown:
Return true if the receiver wants to get repeated #mouseStillDown: messages between #mouseDown: and #mouseUp
handlesMouseWheel:
Do I want to receive mouseWheel events?.
hasClipLayoutCellsString
hasClipSubmorphsString
Answer a string that represents the clip-submophs checkbox
hasDirectionHandlesString
hasDisableTableLayoutString
hasDocumentAnchorString
hasDragAndDropEnabledString
Answer a string to characterize the drag & drop status of the
receiver
hasDropShadow
answer whether the receiver has DropShadow
hasDropShadow:
hasDropShadowString
hasExtension
answer whether the receiver has extention
hasFocus
hasHalo
hasHalo:
hasInlineAnchorString
hasKeyboardFocus
Answer whether the receiver has keyboard focus.
hasNoLayoutString
hasOwner:
Return true if the receiver has aMorph in its owner chain
hasParagraphAnchorString
hasProperty:
Answer whether the receiver has the property named aSymbol
hasProportionalLayoutString
hasReverseCellsString
hasRolloverBorder
answer whether the receiver has RolloverBorder
hasRolloverBorder:
hasRubberBandCellsString
hasSubmorphWithProperty:
hasSubmorphs
hasTableLayoutString
hasTranslucentColor
Answer true if this any of this morph is translucent but not transparent.
hasYellowButtonMenu
Answer true if I have any items at all for a context (yellow
button) menu.
heading
Return the receiver's heading (in eToy terms)
heading:
Set the receiver's heading (in eToy terms)
height
height:
Set my height; my position (top-left corner) and width will remain the same
helpButton
Answer a button whose action would be to put up help concerning the receiver
hide
highlight
The receiver is being asked to appear in a highlighted state. Mostly used for textual morphs
highlightColor
highlightColor:
highlightForDrop
highlightForDrop:
highlightForMouseDown
highlightForMouseDown:
highlightedForDrop
highlightedForMouseDown
holdsSeparateDataForEachInstance
Answer whether the receiver is currently behaving as a 'background field', i.e., whether it is marked as shared (viz. occurring on the background of a stack) *and* is marked as holding separate data for each instance
icon
Answer a form with an icon to represent the receiver
iconOrThumbnail
Answer an appropiate form to represent the receiver
iconOrThumbnailOfSize:
Answer an appropiate form to represent the receiver
imageForm
imageForm:backgroundColor:forRectangle:
imageForm:forRectangle:
imageFormDepth:
imageFormForRectangle:
inPartsBin
includeInNewMorphMenu
indexOfMorphAbove:
Return index of lowest morph whose bottom is above aPoint.
Will return 0 if the first morph is not above aPoint.
initialColorInSystemWindow:
Answer the colour the receiver should be when added to a SystemWindow.
initialExtent
Answer the desired extent for the receiver when a view on it is first opened on the screen.
5/22/96 sw: in the absence of any override, obtain from RealEstateAgent
initialize
initialize the state of the receiver
initializeExtension
private - initializes the receiver's extension
initializeToStandAlone
Set up the receiver, created by a #basicNew and now ready to be initialized, as a fully-formed morph suitable for providing a graphic for a parts bin surrogate, and, when such a parts-bin surrogate is clicked on, for attaching to the hand as a viable stand-alone morph. Because of historical precedent, #initialize has been expected to handle this burden, though a great number of morphs actually cannot stand alone. In any case, by default we call the historical #initialize, though unhappily, so that all existing morphs will work no worse than before when using this protocol.
initializedInstance
innerBounds
Return the inner rectangle enclosed by the bounds of this morph excluding the space taken by its borders. For an unbordered morph, this is just its bounds.
innocuousName
Choose an innocuous name for the receiver -- one that does not end in the word Morph
insetColor
inspectAt:event:
inspectInMorphic
inspectInMorphic:
inspectOwnerChain
intersects:
Answer whether aRectangle, which is in World coordinates, intersects me.
intoWorld:
The receiver has just appeared in a new world. Note:
* aWorld can be nil (due to optimizations in other places)
* owner is already set
* owner's submorphs may not include receiver yet.
Important: Keep this method fast - it is run whenever morphs are added.
invalidRect:
invalidRect:from:
invokeMetaMenu:
invokeMetaMenuAt:event:
isAlignmentMorph
isBalloonHelp
isDockingBar
Return true if the receiver is a docking bar
isFlap
Answer whether the receiver claims to be a flap
isFlapOrTab
isFlapTab
isFlexMorph
isFlexed
Return true if the receiver is currently flexed
isFullOnScreen
Answer if the receiver is full contained in the owner visible
area.
isHandMorph
isInDockingBar
answer if the receiver is in a menu bar
isInSystemWindow
answer if the receiver is in a system window
isInWorld
Return true if this morph is in a world.
isLikelyRecipientForMouseOverHalos
isLineMorph
isLocked
answer whether the receiver is Locked
isMorph
isPartsBin
isPartsDonor
answer whether the receiver is PartsDonor
isPartsDonor:
change the receiver's isPartDonor property
isPlayfieldLike
isRenderer
A *renderer* morph transforms the appearance of its submorph in some manner. For example, it might supply a drop shadow or scale and rotate the morph it encases. Answer true if this morph acts as a renderer. This default implementation returns false.
isShared
Answer whether the receiver has the #shared property. This property allows it to be treated as a 'background' item
isStepping
Return true if the receiver is currently stepping in its world
isSteppingSelector:
Return true if the receiver is currently stepping in its world
isSticky
answer whether the receiver is Sticky
isTaskbar
Answer false in the general case.
isTextMorph
isWorldMorph
isWorldOrHandMorph
justDroppedInto:event:
This message is sent to a dropped morph after it has been dropped on -- and been accepted by -- a drop-sensitive morph
justDroppedIntoPianoRoll:event:
justGrabbedFrom:
The receiver was just grabbed from its former owner and is now attached to the hand. By default, we pass this message on if we're a renderer.
keepsTransform
Return true if the receiver will keep it's transform while being grabbed by a hand.
keyDown:
Handle a key down event. The default response is to do nothing.
keyStroke:
Handle a keystroke event. The default response is to let my eventHandler, if any, handle it.
keyUp:
Handle a key up event. The default response is to do nothing.
keyboardFocusChange:
The message is sent to a morph when its keyboard focus change. The given argument indicates that the receiver is gaining keyboard focus (versus losing) the keyboard focus. Morphs that accept keystrokes should change their appearance in some way when they are the current keyboard focus. This default implementation does nothing.
knownName
answer a name by which the receiver is known, or nil if none
lastSubmorph
lastSubmorphRecursive
Answer recursive last submorph of the receiver.
layoutBounds
Return the bounds for laying out children of the receiver
layoutBounds:
Set the bounds for laying out children of the receiver.
Note: written so that #layoutBounds can be changed without touching this method
layoutChanged
Fixed to always flush layout cache - finally tracked down
layout anomalies due to cached extents in layout
policies not being flushed, the previous (incorrect) assumption being
that it did not matter if layout was to be recomputed (fullBounds being nil).
Recomputing of the layout apparently does not flush so must be done here.
layoutFrame
Layout specific. Return the layout frame describing where the
receiver should appear in a proportional layout
layoutFrame:
Layout specific. Return the layout frame describing where the receiver should appear in a proportional layout
layoutInBounds:
Layout specific. Apply the given bounds to the receiver after being layed out in its owner.
layoutInset
Return the extra inset for layouts
layoutInset:
Return the extra inset for layouts
layoutMenuPropertyString:from:
layoutPolicy
Layout specific. Return the layout policy describing how children
of the receiver should appear.
layoutPolicy:
Layout specific. Return the layout policy describing how children of the receiver should appear.
layoutProperties
Return the current layout properties associated with the
receiver
layoutProperties:
Return the current layout properties associated with the receiver
layoutProportionallyIn:
Layout specific. Apply the given bounds to the receiver.
left
Return the x-coordinate of my left side
left:
Move me so that my left side is at the x-coordinate aNumber. My extent (width & height) are unchanged
leftCenter
listCentering
Layout specific. This property describes how the rows/columns in a list-like layout should be centered.
#topLeft - center at start of primary direction
#bottomRight - center at end of primary direction
#center - center in the middle of primary direction
#justified - insert extra space inbetween rows/columns
listCentering:
Layout specific. This property describes how the rows/columns in a list-like layout should be centered.
#topLeft - center at start of primary direction
#bottomRight - center at end of primary direction
#center - center in the middle of primary direction
#justified - insert extra space inbetween rows/columns
listCenteringString:
listDirection
Layout specific. This property describes the direction in which a list-like layout should be applied. Possible values are:
#leftToRight
#rightToLeft
#topToBottom
#bottomToTop
indicating the direction in which any layout should take place
listDirection:
Layout specific. This property describes the direction in which a list-like layout should be applied. Possible values are:
#leftToRight
#rightToLeft
#topToBottom
#bottomToTop
indicating the direction in which any layout should take place
listDirectionString:
listSpacing
Layout specific. This property describes how the heights for different rows in a table layout should be handled.
#equal - all rows have the same height
#none - all rows may have different heights
listSpacing:
Layout specific. This property describes how the heights for different rows in a table layout should be handled.
#equal - all rows have the same height
#none - all rows may have different heights
listSpacingString:
loadCachedState
Load the cached state of this morph. This method may be called to pre-load the cached state of a morph to avoid delays when it is first used. (Cached state can always be recompued on demand, so a morph should not rely on this method being called.) Implementations of this method should do 'super loadCachedState'. This default implementation does nothing.
localPointToGlobal:
lock
lock:
change the receiver's lock property
lockUnlockMorph
If the receiver is locked, unlock it; if unlocked, lock it
lockedString
Answer the string to be shown in a menu to represent the
'locked' status
mainDockingBars
Answer the receiver's main dockingBars
makeGraphPaper
makeGraphPaperGrid:background:line:
markAsPartsDonor
Mark the receiver specially so that mouse actions on it are interpreted as 'tearing off a copy'
maxCellSize
Layout specific. This property specifies the maximum size of a table cell.
maxCellSize:
Layout specific. This property specifies the maximum size of a table cell.
maybeAddCollapseItemTo:
If appropriate, add a collapse item to the given menu
maybeDuplicateMorph
Maybe duplicate the morph
maybeDuplicateMorph:
menuButtonMouseEnter:
The mouse entered a menu-button area; show the menu cursor temporarily
menuButtonMouseLeave:
The mouse left a menu-button area; restore standard cursor
menuItemAfter:
menuItemBefore:
minCellSize
Layout specific. This property specifies the minimal size of a table cell.
minCellSize:
Layout specific. This property specifies the minimal size of a table cell.
minExtent
Layout specific. Return the minimum size the receiver can be represented in.
Implementation note: When this message is sent from an owner trying to lay out its children it will traverse down the morph tree and recompute the minimal arrangement of the morphs based on which the minimal extent is returned. When a morph with some layout strategy is encountered, the morph will ask its strategy to compute the new arrangement. However, since the final size given to the receiver is unknown at the point of the query, the assumption is made that the current bounds of the receiver are the base on which the layout should be computed. This scheme prevents strange layout changes when for instance, a table is contained in another table. Unless the inner table has been resized manually (which means its bounds are already enlarged) the arrangement of the inner table will not change here. Thus the entire layout computation is basically an iterative process which may have different results depending on the incremental changes applied.
Fixed for shrinkWrap.
minHeight
answer the receiver's minHeight
minHeight:
minWidth
answer the receiver's minWidth
minWidth:
minimumExtent
This returns the minimum extent that the morph may be shrunk to. Not honored in too many places yet, but respected by the resizeToFit feature, at least. copied up from SystemWindow 6/00
minimumExtent:
Remember a minimumExtent, for possible future use
modalLockTo:
Lock the receiver as a modal owner of the given window.
modalUnlockFrom:
Unlock the receiver as a modal owner of the given window.
model
modelOrNil
models
Answer a collection of whatever models I may have.
modificationHash
morphPreceding:
Answer the morph immediately preceding aSubmorph, or nil if none
morphRepresented
If the receiver is an alias, answer the morph it represents; else answer self
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
morphicLayerNumberWithin:
Helpful for insuring some morphs always appear in front of or behind others.
Smaller numbers are in front.
Fixed here to call #morphicLayerNumber rather than access property directly.
morphsAt:
Return a collection of all morphs in this morph structure that contain the given point, possibly including the receiver itself. The order is deepest embedding first.
morphsAt:behind:unlocked:
Return all morphs at aPoint that are behind frontMorph; if aBool is true return only unlocked, visible morphs.
morphsAt:unlocked:
Return a collection of all morphs in this morph structure that contain the given point, possibly including the receiver itself. The order is deepest embedding first.
morphsAt:unlocked:do:
Evaluate aBlock with all the morphs starting at the receiver which appear at aPoint. If aBool is true take only visible, unlocked morphs into account.
morphsInFrontOf:overlapping:do:
Evaluate aBlock with all top-level morphs in front of someMorph that overlap with the given rectangle. someMorph is either an immediate child of the receiver or nil (in which case all submorphs of the receiver are enumerated).
morphsInFrontOverlapping:
Return all top-level morphs in front of someMorph that overlap with the given rectangle.
morphsInFrontOverlapping:do:
Evaluate aBlock with all top-level morphs in front of someMorph that overlap with the given rectangle.
morphsUnknownToTheirOwners
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseDownOnHelpHandle:
The mouse went down in the show-balloon handle
mouseDownPriority
Return the default mouse down priority for the receiver
mouseEnter:
Handle a mouseEnter event, meaning the mouse just entered my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseEnterDragging:
Handle a mouseEnterDragging event, meaning the mouse just entered my bounds with a button pressed or laden with submorphs. The default response is to let my eventHandler, if any, handle it, or else to do nothing.
mouseLeave:
Handle a mouseLeave event, meaning the mouse just left my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseLeaveDragging:
Handle a mouseLeaveLaden event, meaning the mouse just left my bounds with a button pressed or laden with submorphs. The default response is to let my eventHandler, if any, handle it; else to do nothing.
mouseMove:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseStillDown:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseStillDownStepRate
At what rate do I want to receive #mouseStillDown: notifications?
mouseStillDownThreshold
Return the number of milliseconds after which mouseStillDown: should be sent
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
mouseUpCodeOrNil
If the receiver has a mouseUpCodeToRun, return it, else return nil
mouseWheel:
Handle a mouseWheel event.
moveOrResizeFromKeystroke:
move or resize the receiver based on a keystroke
myDependents
Improved performance dependents.
myDependents:
Improved performance dependents.
name:
nameForFindWindowFeature
Answer the name to show in a list of windows-and-morphs to represent the receiver
nameForUndoWording
Return wording appropriate to the receiver for use in an undo-related menu item (and perhaps elsewhere)
navigateFocusBackward
Change the keyboard focus to the previous morph.
navigateFocusForward
Change the keyboard focus to the next morph.
navigationKey:
Check for tab key activity and change focus as appropriate.
Check for menu key to do popup.
nearestOwnerThat:
Return the first enclosing morph for which aBlock evaluates to true, or nil if none
newBounds:
newBounds:color:
newStandAlone
newSticky
newTransformationMorph
nextMorphAcrossInWindow
Answer the next morph in the window. Traverse
from the receiver to its next sibling or owner's next sibling etc.
nextMorphInWindow
Answer the next morph in the window. Traverse
from the receiver to its first child or next sibling or owner's next sibling etc.
nextMorphWantingFocus
Answer the next morph that wants keyboard focus.
niActions
niConfiguration
niFlash
niIcon
noHelpString
noteDecimalPlaces:forGetter:
Make a mental note of the user's preference for a particular number of decimal places to be associated with the slot with the given getter
noteNewOwner:
I have just been added as a submorph of aMorph
objectForDataStream:
I am being written out on an object file
obtainArrowheadFor:defaultValue:
okayToAddDismissHandle
Answer whether a halo on the receiver should offer a dismiss handle. This provides a hook for making it harder to disassemble some strucures even momentarily
okayToAddGrabHandle
Answer whether a halo on the receiver should offer a grab handle. This provides a hook for making it harder to deconstruct some strucures even momentarily
okayToBrownDragEasily
Answer whether it it okay for the receiver to be brown-dragged easily -- i.e. repositioned within its container without extracting it. At present this is just a hook -- nobody declines.
okayToDuplicate
Formerly this protocol was used to guard against awkward situations when there were anonymous scripts in the etoy system. Nowadays we just always allow duplication
okayToResizeEasily
Answer whether it is appropriate to have the receiver be easily resized by the user from the halo
okayToRotateEasily
Answer whether it is appropriate for a rotation handle to be shown for the receiver. This is a hook -- at present nobody declines.
on:send:to:
on:send:to:withValue:
NOTE: selector must take 3 arguments, of which value will be the *** FIRST ***
openCenteredInWorld
openInHand
Attach the receiver to the current hand in the current morphic world
openInWindow
openInWindowLabeled:
openInWindowLabeled:inWorld:
Changed to include the inset margin in the bound calculation.
openInWorld
Add this morph to the world.
openInWorld:
Add this morph to the requested World.
openModal:
Open the given window locking the receiver until it is dismissed.
Answer the system window.
Restore the original keyboard focus when closed.
optimalExtent
Answer the submorphBounds extent plus twice our border width.
otherProperties
answer the receiver's otherProperties
outOfWorld:
The receiver has just appeared in a new world. Notes:
* aWorld can be nil (due to optimizations in other places)
* owner is still valid
Important: Keep this method fast - it is run whenever morphs are removed.
outerBounds
Return the 'outer' bounds of the receiver, e.g., the bounds that need to be invalidated when the receiver changes.
outermostMorphThat:
Return the outermost containing morph for which aBlock is true, or nil if none
outermostOwnerWithYellowButtonMenu
Answer me or my outermost owner that is willing to contribute menu items to a context menu.
Don't include the world.
outermostWorldMorph
overlapsShadowForm:bounds:
Answer true if itsShadow and my shadow overlap at all
owner
Returns the owner of this morph, which may be nil.
ownerChain
Answer a list of objects representing the receiver and all of its owners. The first element is the receiver, and the last one is typically the world in which the receiver resides
ownerChanged
The receiver's owner, some kind of a pasteup, has changed its layout.
ownerThatIsA:
Return the first enclosing morph that is a kind of aClass, or nil if none
pagesHandledAutomatically
paneColor
Answer the window's pane color or our color otherwise.
paneColor:
Explicitly set the pane color for the reveiver.
paneColorOrNil
Answer the window's pane color or nil otherwise.
partRepresented
passivate
Mark the receiver and submorphs as passive (background).
pasteUpMorph
Answer the closest containing morph that is a PasteUp morph
pasteUpMorphHandlingTabAmongFields
Answer the nearest PasteUpMorph in my owner chain that has the tabAmongFields property, or nil if none
pauseFrom:
subclasses should take five
permitsThumbnailing
playSoundNamed:
Play the sound with the given name.
Does nothing if this image lacks sound playing facilities.
player
answer the receiver's player
point:from:
point:in:
pointFromWorld:
pointInWorld:
position
position:
Change the position of this morph and and all of its
submorphs.
positionInWorld
positionSubmorphs
postLoad
when I'm read from a file
potentialEmbeddingTargets
Return the potential targets for embedding the receiver
potentialTargets
Return the potential targets for the receiver.
This is derived from Morph>>potentialEmbeddingTargets.
potentialTargetsAt:
Return the potential targets for the receiver.
This is derived from Morph>>potentialEmbeddingTargets.
preferredButtonCornerStyle
Answer the preferred button corner style
for submorphs. Answer nil for no preference.
preferredCornerStyle
Answer the preferred corner style.
preferredDuplicationHandleSelector
Answer the selector, either #addMakeSiblingHandle: or addDupHandle:, to be offered as the default in a halo open on me
preferredKeyboardBounds
preferredKeyboardPosition
prepareToBeSaved
Prepare this morph to be saved to disk. Subclasses should nil out any instance variables that holds state that should not be saved, such as cached Forms. Note that this operation may take more drastic measures than releaseCachedState; for example, it might discard the transcript of an interactive chat session.
presentHelp
Present a help message if there is one available
presenter
Answer the presenter object associated with the receiver. For morphs, there is in effect a clear containment hierarchy of presenters (accessed via their association with PasteUpMorphs); for arbitrary objects the hook is simply via the current world, at least at present.
previousMorphInWindow
Answer the next morph in the window. Traverse
from the receiver to its previous sibling's last submorph (recursive)
or owner's previous sibling's last submorph (recursive) etc.
previousMorphWantingFocus
Answer the previous morph that wants keyboard focus.
primaryHand
printConstructorOn:indent:
printConstructorOn:indent:nodeDict:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
printStructureOn:indent:
privateAddAllMorphs:atIndex:
Private. Add aCollection of morphs to the receiver
privateAddMorph:atIndex:
privateBounds:
Private! Use position: and/or extent: instead.
privateColor:
privateDelete
Remove the receiver as a submorph of its owner
privateDeleteWithAbsolutelyNoSideEffects
Private! Should only be used by methods that maintain the ower/submorph invariant.
privateExtension:
private - change the receiver's extension
privateFullBounds
Private. Compute the actual full bounds of the receiver
privateFullBounds:
Private! Computed automatically.
privateFullMoveBy:
Private! Relocate me and all of my subMorphs by recursion. Subclasses that implement different coordinate systems may override this method.
privateInvalidateMorph:
Private. Invalidate the given morph after adding or removing.
This method is private because a) we're invalidating the morph 'remotely'
and b) it forces a fullBounds computation which should not be necessary
for a general morph c) the morph may or may not actually invalidate
anything (if it's not in the world nothing will happen) and d) the entire
mechanism should be rewritten.
privateMoveBy:
Private! Use 'position:' instead.
privateOwner:
Private! Should only be used by methods that maintain the ower/submorph invariant.
privateRemove:
Private! Should only be used by methods that maintain the ower/submorph invariant.
privateRemoveMorphWithAbsolutelyNoSideEffects:
Private! Should only be used by methods that maintain the ower/submorph invariant.
privateSubmorphs
Private! Use 'submorphs' instead.
privateSubmorphs:
Private! Should only be used by methods that maintain the ower/submorph invariant.
processEvent:
Process the given event using the default event dispatcher.
processEvent:using:
This is the central entry for dispatching events in morphic. Given some event and a default dispatch strategy, find the right receiver and let him handle it.
WARNING: This is a powerful hook. If you want to use a different event dispatcher from the default, here is the place to hook it in. Depending on how the dispatcher is written (e.g., whether it calls simply #processEvent: or #processEvent:using:) you can change the dispatch strategy for entire trees of morphs. Similarly, you can disable entire trees of morphs from receiving any events whatsoever. Read the documentation in class MorphicEventDispatcher before playing with it.
programmedMouseDown:for:
programmedMouseEnter:for:
programmedMouseLeave:for:
programmedMouseUp:for:
raisedColor
Return the color to be used for shading raised borders. The
default is my own color, but it might want to be, eg, my
owner's color. Whoever's color ends up prevailing, the color
itself gets the last chance to determine, so that when, for
example, an InfiniteForm serves as the color, callers won't choke
on some non-Color object being returned
readoutForField:
Provide a readout that will show the value of the slot/pseudoslot of the receiver generated by sending fieldSym to the receiver
referencePosition
Return the current reference position of the receiver
referencePosition:
Move the receiver to match its reference position with aPosition
referencePositionInWorld
referencePositionInWorld:
refreshWorld
regularColor
regularColor:
rejectDropEvent:
This hook allows the receiver to repel a drop operation currently executed. The method is called prior to checking children so the receiver must validate that the event was really designated for it.
Note that the ordering of the tests below is designed to avoid a (possibly expensive) #fullContainsPoint: test. If the receiver doesn't want to repel the morph anyways we don't need to check after all.
rejectDropMorphEvent:
The receiver has been rejected, and must be put back somewhere. There are three cases:
(1) It remembers its former owner and position, and goes right back there
(2) It remembers its former position only, in which case it was torn off from a parts bin, and the UI is that it floats back to its donor position and then vanishes.
(3) Neither former owner nor position is remembered, in which case it is whisked to the Trash
rejectsEvent:
Return true to reject the given event.
Rejecting an event means neither the receiver nor any of it's submorphs will be given any chance to handle it.
If the event is a mouse wheel event then only reject if the receiver is not visible.
relativeTextAnchorPosition
relativeTextAnchorPosition:
releaseActionMap
Release the action map
releaseCachedState
Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.
rememberedColor
Answer a rememberedColor, or nil if none
rememberedColor:
Place aColor in a property so I can retrieve it later. A tortuous but expedient flow of data
removeAlarm:
Remove the given alarm
removeAlarm:at:
Remove the given alarm
removeAllButFirstSubmorph
Remove all of the receiver's submorphs other than the first one.
removeAllMorphs
removeAllMorphsIn:
greatly speeds up the removal of *lots* of submorphs
removeDropShadow
removeFlexShell
removeHalo
remove the surrounding halo (if any)
removeLink:
removeMorph:
Remove the given morph from my submorphs
removeMouseUpAction
removeProperty:
removes the property named aSymbol if it exists
removedMorph:
Notify the receiver that aMorph was just removed from its children
renameInternal:
Change the internal name (because of a conflict) but leave the external name unchanged. Change Player class name, but do not change the names that appear in tiles. When coming in from disk, and have name conflict, References will already have the new name.
renameTo:
Set The morph name.
renderedMorph
This now gets overridden by rendering morphs.
repelsMorph:event:
replaceSubmorph:by:
reportableSize
Answer a size worth reporting as the receiver's size in a list view
requestor
returns the focused window's requestor
resetExtension
reset the extension slot if it is not needed
resetForwardDirection
resetFrom:
subclasses should revert to their initial state
resetHighlightForDrop
resistsRemoval
Answer whether the receiver is marked as resisting removal
resistsRemoval:
Set the receiver's resistsRemoval property as indicated
resistsRemovalString
Answer the string to be shown in a menu to represent the
'resistsRemoval' status
resizeFromMenu
Commence an interaction that will resize the receiver
resizeMorph:
resourceJustLoaded
In case resource relates to me
restoreSuspendedEventHandler
resumeAfterDrawError
resumeAfterStepError
Resume stepping after an error has occured.
resumeFrom:
subclasses should continue from their current position
reverseTableCells
Layout specific. This property describes if the cells should be treated in reverse order of submorphs.
reverseTableCells:
Layout specific. This property describes if the cells should be treated in reverse order of submorphs.
right
Return the x-coordinate of my right side
right:
Move me so that my right side is at the x-coordinate aNumber. My extent (width & height) are unchanged
rightCenter
root
Return the root of the composite morph containing the receiver. The owner of the root is either nil, a WorldMorph, or a HandMorph. If the receiver's owner is nil, the root is the receiver itself. This method always returns a morph.
rootAt:
Just return myself, unless I am a WorldWindow.
If so, then return the appropriate root in that world
rootMorphsAt:
Return the list of root morphs containing the given point, excluding the receiver.
ar 11/8/1999: Moved into morph for an incredibly ugly hack in 3D worlds
rootMorphsAtGlobal:
Return the list of root morphs containing the given point, excluding the receiver.
ar 11/8/1999: Moved into morph for an incredibly ugly hack in 3D worlds
rotationCenter
Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationCenter:
Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationDegrees
Default implementation.
rotationStyle
Return the 'rotation style' of the receiver
rotationStyle:
Set the 'rotation style' of the receiver; this is ignored for non-sketches
roundUpStrays
roundedCorners
Return a list of those corners to round.
1-4
| |
2-3
Returned array contains `codes' of those corners, which should be rounded.
1 denotes top-left corner
2 denotes bottom-left corner
3 denotes bottom-right corner
4 denotes top-right corner.
Thus, if this method returned #(2 3) that would mean that bottom (left and right)
corners would be rounded whereas top (left and right) corners wouldn't be rounded.
This method returns #(1 2 3 4) and that means that all the corners should be rounded.
roundedCorners:
Set the corners to round.
roundedCornersString
Answer the string to put in a menu that will invite the user to
switch to the opposite corner-rounding mode
rubberBandCells
Layout specific. This property describes if a parent that is #shrinkWrapped around its children should ignore any #spaceFill children. E.g., when #rubberBandCells is true, the compound layout will always stay at the smallest available size, even though some child may be able to grow.
rubberBandCells:
Layout specific. This property describes if a parent that is #shrinkWrapped around its children should ignore any #spaceFill children. E.g., when #rubberBandCells is true, the compound layout will always stay at the smallest available size, even though some child may be able to grow.
saveAsPrototype
saveAsResource
saveDocPane
saveOnFile
Ask the user for a filename and save myself on a SmartReferenceStream file. Writes out the version and class structure. The file is fileIn-able. UniClasses will be filed out.
scale:
Backstop for morphs that don't have to do something special to set their scale
scaleFactor
scaleFactor:
Backstop for morphs that don't have to do something special to set their
scale
screenLocation
For compatibility only
screenRectangle
For compatibility only
selectedObject
answer the selected object for the hand or nil is none
separateDragAndDrop
Conversion only. Separate the old #dragNDropEnabled into #dragEnabled and #dropEnabled and remove the old property.
serviceLoadMorphFromFile
services
setArrowheads
Let the user edit the size of arrowheads for this object
setBalloonText:
Set receiver's balloon help text. Pass nil to remove the help.
setBalloonText:maxLineLength:
Set receiver's balloon help text. Pass nil to remove the help.
setBorderStyle:
Set the border style of my costume
setCenteredBalloonText:
setConstrainedPosition:hangOut:
Change the position of this morph and and all of its submorphs to aPoint, but don't let me go outside my owner's bounds. Let me go within two pixels of completely outside if partiallyOutside is true.
setDirectionFrom:
setExtentFromHalo:
The user has dragged the grow box such that the receiver's extent would be anExtent. Do what's needed
setFlexExtentFromHalo:
The user has dragged the grow box such that the receiver's extent would be anExtent. Do what's needed. Set the extent of the top renderer as indicated.
setNamePropertyTo:
change the receiver's externalName
setNameTo:
setProperties:
Set many properties at once from a list of prop, value, prop, value
setProperty:toValue:
change the receiver's property named aSymbol to anObject
setRotationCenter
setRotationCenterFrom:
setShadowOffset:
setStandardTexture
setToAdhereToEdge:
shadowColor
shadowColor:
shadowForm
Return a form representing the 'shadow' of the receiver - e.g., all pixels that are occupied by the receiver are one, all others are zero.
shadowOffset
Return the current shadow offset
shadowOffset:
Set the current shadow offset
shadowOffsetRectangle
Answer a rectangle describing the offsets to the
receiver's bounds for a drop shadow.
shadowPoint:
shiftSubmorphsOtherThan:by:
shouldDropOnMouseUp
shouldGetStepsFrom:
show
Make sure this morph is on-stage.
showActions
Put up a message list browser of all the code that this morph
would run for mouseUp, mouseDown, mouseMove, mouseEnter,
mouseLeave, and
mouseLinger. tk 9/13/97
showBalloon:
Pop up a balloon containing the given string,
first removing any existing BalloonMorphs in the world.
showBalloon:hand:
Pop up a balloon containing the given string,
first removing any existing BalloonMorphs in the world.
showHiders
shuffleSubmorphs
Randomly shuffle the order of my submorphs. Don't call this method lightly!
sightTargets:
Return the potential targets for the receiver.
This is derived from Morph>>potentialEmbeddingTargets.
sightWorldTargets:
Return the potential targets for the receiver.
This is derived from Morph>>potentialEmbeddingTargets.
simplySetVisible:
Set the receiver's visibility property. This mild circumlocution is because my TransfomationMorph #visible: method would also set the visibility flag of my flexee, which in this case is pointless because it's the flexee that calls this.
This appears in morph as a backstop for morphs that don't inherit from TFMorph
slideBackToFormerSituation:
slideToTrash:
Morph do not slide to trash anymore.
snapToEdgeIfAppropriate
spaceFillWeight
Layout specific. This property describes the relative weight that
should be given to the receiver when extra space is distributed
between different #spaceFill cells.
spaceFillWeight:
Layout specific. This property describes the relative weight that should be given to the receiver when extra space is distributed between different #spaceFill cells.
sqkPage
standardPalette
Answer a standard palette forced by some level of enclosing presenter, or nil if none
start
Start running my script. For ordinary morphs, this means start stepping.
startDrag:
Handle a double-click event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing.
startDrag:with:
startStepping
Start getting sent the 'step' message.
startStepping:at:arguments:stepTime:
Start stepping the receiver
startSteppingIn:
Start getting sent the 'step' message in aWorld
startSteppingSelector:
Start getting sent the 'step' message.
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepAt:
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message.
The millisecondClockValue parameter gives the value of the millisecond clock at the moment of dispatch.
Default is to dispatch to the parameterless step method for the morph, but this protocol makes it possible for some morphs to do differing things depending on the clock value
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
stickinessString
Answer the string to be shown in a menu to represent the
stickiness status
sticky:
change the receiver's sticky property
stop
Stop running my script. For ordinary morphs, this means stop stepping.
stopStepping
Stop getting sent the 'step' message.
stopSteppingSelector:
Stop getting sent the given message.
stopSteppingSelfAndSubmorphs
storeDataOn:
Let all Morphs be written out. All owners are weak references. They only go out if the owner is in the tree being written.
structureString
Return a string that showing this morph and all its submorphs in an indented list that reflects its structure.
subclassMorph
Create a new subclass of this morph's class and make this morph be an instance of it.
submorphAfter
Return the submorph after (behind) me, or nil
submorphBefore
Return the submorph after (behind) me, or nil
submorphBounds
Private. Compute the actual full bounds of the receiver
submorphCount
submorphIndexOf:
Assuming aMorph to be one of my submorphs, answer where it occurs in my submorph list
submorphNamed:
submorphNamed:ifNone:
Find the first submorph with this name, or a button with an action selector of that name
submorphThat:ifNone:
submorphWithProperty:
submorphs
This method returns my actual submorphs collection. Modifying the collection directly could be dangerous; make a copy if you need to alter it.
submorphsBehind:do:
submorphsDo:
submorphsInFrontOf:do:
submorphsReverseDo:
submorphsSatisfying:
suspendEventHandler
tabAmongFields
tabHitWithEvent:
The tab key was hit. The keyboard focus has referred this event to me, though this perhaps seems rather backwards. Anyway, the assumption is that I have the property #tabAmongFields, so now the task is to tab to the next field.
tabKey:
Check for tab key activity and change focus as appropriate.
takeKeyboardFocus
Make the receiver the keyboard focus for the active hand.
takesKeyboardFocus
Answer whether the receiver can normally take keyboard focus.
target:
Morphs with targets will override. This backstop does nothing.
targetFromMenu:
Some other morph become target of the receiver
targetFromMenu:popupAt:
Some other morph become target of the receiver
targetWith:
Some other morph become target of the receiver
taskThumbnailOfSize:
Answer a new task thumbnail for the receiver.
taskbarButtonFor:
Answer a new task bar button for the receiver.
Answer nil if not required.
taskbarTask
Answer a new taskbar task for the receiver.
Answer nil if not required.
taskbarThumbnail
Answer a new taskbar thumbnail for the receiver.
taskbarThumbnailExtent
Answer the size of a taskbar thumbnail for the receiver.
taskbars
Answer the receiver's taskbars.
tempCommand
Generic backstop. If you care to, you can comment out what's below here, and substitute your own code, though the intention of design of the feature is that you leave this method as it is, and instead reimplement tempCommand in the class of whatever individual morph you care to. In any case, once you have your own #tempCommand in place, you will then be able to invoke it from the standard debugging menus.
textAnchorType
textAnchorType:
textureParameters
Answer a triplet giving the preferred grid size, background color, and line color. The choices here are as suggested by Alan, 9/13/97
theme
Answer the current theme for the receiver.
theme:
Set the current theme for the receiver.
themeChanged
The current theme has changed.
Update any dependent visual aspects.
toggleCornerRounding
toggleDragNDrop
Toggle this morph's ability to add and remove morphs via drag-n-drop.
toggleDropShadow
toggleLocked
toggleResistsRemoval
Toggle the resistsRemoval property
toggleStickiness
togle the receiver's Stickiness
toggleVisible
Toggle the visibility of the receiver.
toggleVisibleAndRaise
Toggle the visibility of the receiver, brining to
the front if becoming visible.
top
Return the y-coordinate of my top side
top:
Move me so that my top is at the y-coordinate aNumber. My extent (width & height) are unchanged
topCenter
topLeft
topLeft:
Move me so that my top left corner is at aPoint. My extent (width & height) are unchanged
topPasteUp
If the receiver is in a world, return that; otherwise return the outermost pasteup morph
topRendererOrSelf
Answer the topmost renderer for this morph, or this morph itself if it has no renderer. See the comment in Morph>isRenderer.
topRight
topRight:
Move me so that my top right corner is at aPoint. My extent (width & height) are unchanged
transferHalo:from:
Progressively transfer the halo to the next likely recipient
transferStateToRenderer:
Transfer knownName, and visible over to aRenderer, which is being imposed above me as a transformation shell
transformFrom:
Return a transform to be used to map coordinates in a morph above me into my childrens coordinates, or vice-versa. This is used to support scrolling, scaling, and/or rotation. This default implementation just returns my owner's transform or the identity transform if my owner is nil.
Note: This method cannot be used to map into the receiver's coordinate system!
transformFromOutermostWorld
Return a transform to map world coordinates into my local coordinates
transformFromWorld
Return a transform to map world coordinates into my local coordinates
transformedBy:
transformedFrom:
Return a transform to map coordinates of uberMorph, a morph above me in my owner chain, into the coordinates of MYSELF not any of my children.
transparentSpacerOfSize:
transportedMorph
triggerActionFromPianoRoll
a hack to allow for abitrary morphs to be dropped into piano roll
unHighlight
uncollapseSketch
undoGrabCommand
Return an undo command for grabbing the receiver
undoMove:redo:owner:bounds:predecessor:
Handle undo and redo of move commands in morphic
unload
unlock
unlockContents
updateAllFromResources
updateCachedThumbnail
If I have a cached thumbnail, then update it. Copied up from Dan's original version in PasteUpMorph so it can be used by all morphs.
updateFromResource
updateableActionMap
Answer an updateable action map, saving it in my #actionMap property
url
If I have been assigned a url, return it. For PasteUpMorphs mostly.
useBitmapFill
Make receiver use a solid fill style (e.g., a simple color)
useDefaultFill
Make receiver use a solid fill style (e.g., a simple color)
useGradientFill
Make receiver use a solid fill style (e.g., a simple color)
useSolidFill
Make receiver use a solid fill style (e.g., a simple color)
userSelectedColor:
The user, via the UI, chose aColor to be the color for the receiver; set it, and tell my owner in case he wishes to react
userString
Do I have a text string to be searched on?
vResizeToFit:
vResizing
Layout specific. This property describes how the receiver should be resized with respect to its owner and its children. Possible values are:
#rigid - do not resize the receiver
#spaceFill - resize to fill owner's available space
#shrinkWrap - resize to fit children
vResizing:
Layout specific. This property describes how the receiver should be resized with respect to its owner and its children. Possible values are:
#rigid - do not resize the receiver
#spaceFill - resize to fill owner's available space
#shrinkWrap - resize to fit children
vResizingString:
valueOfProperty:
answer the value of the receiver's property named aSymbol
valueOfProperty:ifAbsent:
if the receiver possesses a property of the given name, answer
its value. If not then evaluate aBlock and answer the result of
this block evaluation
valueOfProperty:ifAbsentPut:
If the receiver possesses a property of the given name, answer
its value. If not, then create a property of the given name, give
it the value obtained by evaluating aBlock, then answer that
value
valueOfProperty:ifPresentDo:
If the receiver has a property of the given name, evaluate
aBlock on behalf of the value of that property
vanishAfterSlidingTo:event:
veryDeepCopyWith:
Copy me and the entire tree of objects I point to. An object in the tree twice is copied once, and both references point to him. deepCopier holds a dictionary of objects we have seen. See veryDeepInner:, veryDeepFixupWith:
veryDeepFixupWith:
If some fields were weakly copied, fix new copy here.
veryDeepInner:
The inner loop, so it can be overridden when a field should not
be traced.
viewBox
visible
answer whether the receiver is visible
visible:
set the 'visible' attribute of the receiver to aBoolean.
Must update owner layout since its full bounds may depend
on the receiver extending beyond its bounds.
visibleClearArea
Answer the receiver visible clear area. The intersection
between the clear area and the viewbox.
wantsBalloon
Answer true if receiver wants to show a balloon help text is a few moments.
wantsDirectionHandles
wantsDirectionHandles:
wantsDropFiles:
Return true if the receiver wants files dropped from the OS.
wantsDroppedMorph:event:
Return true if the receiver wishes to accept the given morph, which is being dropped by a hand in response to the given event. Note that for a successful drop operation both parties need to agree. The symmetric check is done automatically via aMorph wantsToBeDroppedInto: self.
wantsEveryMouseMove
Unless overridden, this method allows processing to skip mouse move events
when processing is lagging. No 'significant' event (down/up, etc) will be skipped.
wantsHalo
wantsHaloFor:
wantsHaloFromClick
wantsHaloHandleWithSelector:inHalo:
Answer whether the receiver would like to offer the halo handle with the given selector (e.g. #addCollapseHandle:)
wantsKeyboardFocus
Answer whether the receiver would like keyboard focus
in the general case (mouse action normally).
wantsKeyboardFocusFor:
Answer whether a plain mouse click on aSubmorph, a text-edit-capable thing, should result in a text selection there
wantsKeyboardFocusNavigation
Answer whether the receiver would like keyboard focus
when navigated to by keyboard.
wantsRecolorHandle
Answer whether the receiver would like a recoloring halo handle to be put up. Since this handle also presently affords access to the property-sheet, it is presently always allowed, even though SketchMorphs don't like regular recoloring
wantsRoundedCorners
Return true if the receiver wants its corners rounded
wantsSimpleSketchMorphHandles
Answer true if my halo's simple handles should include the simple sketch morph handles.
wantsSteps
Return true if the receiver overrides the default Morph step method.
wantsToBeCachedByHand
Return true if the receiver wants to be cached by the hand when it is dragged around.
Note: The default implementation queries all submorphs since subclasses may have shapes that do not fill the receiver's bounds completely.
wantsToBeDroppedInto:
Return true if it's okay to drop the receiver into aMorph. This check is symmetric to #wantsDroppedMorph:event: to give both parties a chance of figuring out whether they like each other.
wantsToBeOpenedInWorld
Return true if the receiver wants to be put into the World directly,
rather than allowing the user to place it (e.g., prevent attaching me
to the hand after choosing 'new morph' in the world menu)
wantsToBeTopmost
Answer if the receiver want to be one of the topmost objects in its owner
wantsYellowButtonMenu
Answer true if the receiver wants a yellow button menu
wantsYellowButtonMenu:
Change the receiver to wants or not a yellow button menu
width
width:
Set my width; my position (top-left corner) and height will remain the same
willingToBeDiscarded
window
Answer the receiver's window.
withAllOwners
Return the receiver and all its owners
withAllOwnersDo:
Evaluate aBlock with the receiver and all of its owners
world
worldBounds
worldBoundsForHalo
Answer the rectangle to be used as the inner dimension of my halos.
Allow for showing either bounds or fullBounds, and compensate for the optional bounds rectangle.
wouldAcceptKeyboardFocus
Answer whether a plain mouse click on the receiver should result in a text selection there
wouldAcceptKeyboardFocusUponTab
Answer whether the receiver is in the running as the new keyboard focus if the tab key were hit at a meta level. This provides the leverage for tabbing among fields of a card, for example.
wrapCentering
Layout specific. This property describes how the rows/columns in a list-like layout should be centered.
#topLeft - center at start of secondary direction
#bottomRight - center at end of secondary direction
#center - center in the middle of secondary direction
#justified - insert extra space inbetween rows/columns
wrapCentering:
Layout specific. This property describes how the rows/columns in a list-like layout should be centered.
#topLeft - center at start of secondary direction
#bottomRight - center at end of secondary direction
#center - center in the middle of secondary direction
#justified - insert extra space inbetween rows/columns
wrapCenteringString:
wrapDirection
Layout specific. This property describes the direction along which a list-like layout should be wrapped. Possible values are:
#leftToRight
#rightToLeft
#topToBottom
#bottomToTop
#none
indicating in which direction wrapping should occur. This direction must be orthogonal to the list direction, that is if listDirection is #leftToRight or #rightToLeft then wrapDirection must be #topToBottom or #bottomToTop and vice versa.
wrapDirection:
Layout specific. This property describes the direction along which a list-like layout should be wrapped. Possible values are:
#leftToRight
#rightToLeft
#topToBottom
#bottomToTop
#none
indicating in which direction wrapping should occur. This direction must be orthogonal to the list direction, that is if listDirection is #leftToRight or #rightToLeft then wrapDirection must be #topToBottom or #bottomToTop and vice versa.
wrapDirectionString:
wrappedInWindow:
wrappedInWindowWithTitle:
yellowButtonActivity:
Find me or my outermost owner that has items to add to a
yellow button menu.
shiftState is true if the shift was pressed.
Otherwise, build a menu that contains the contributions from
myself and my interested submorphs,
and present it to the user.
MorphExtension
MorphExtension provides access to extra instance state that is not required in most simple morphs. This allows simple morphs to remain relatively lightweight while still admitting more complex structures as necessary. The otherProperties field takes this policy to the extreme of allowing any number of additional named attributes, albeit at a certain cost in speed and space.
assureOtherProperties
creates an otherProperties for the receiver if needed
balloonText
balloonText:
balloonTextSelector
balloonTextSelector:
change the receiver's balloonTextSelector
comeFullyUpOnReload:
inst vars have default booplean values.
convertProperty:toValue:
These special cases move old properties into named fields of the
extension
copyWeakly
list of names of properties whose values should be weak-copied when veryDeepCopying a morph. See DeepCopier.
eventHandler
answer the receiver's eventHandler
eventHandler:
externalName
Answer an external name by which the receiver is known. Generic implementation here is a transitional backstop. probably
externalName:
change the receiver's externalName
hasProperty:
Answer whether the receiver has the property named aSymbol
initialize
Init all booleans to default values
initializeOtherProperties
private - initializes the receiver's otherProperties
inspectElement
Create and schedule an Inspector on the otherProperties and the
named properties.
isDefault
Return true if the receiver is a default and can be omitted
isPartsDonor
answer whether the receiver is PartsDonor
isPartsDonor:
change the receiver's isPartDonor property
layoutFrame
layoutFrame:
layoutPolicy
layoutPolicy:
layoutProperties
layoutProperties:
Return the current layout properties associated with the receiver
locked
answer whether the receiver is Locked
locked:
change the receiver's locked property
otherProperties
answer the receiver's otherProperties
player
We no longer have players
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
propertyNamesNotCopied
list of names of properties whose values should be deleted when veryDeepCopying a morph.
See DeepCopier.
removeOtherProperties
Remove the 'other' properties
removeProperty:
removes the property named aSymbol if it exists
setProperty:toValue:
change the receiver's property named aSymbol to anObject
sortedPropertyNames
answer the receiver's property names in a sorted way
sticky
sticky:
change the receiver's sticky property
valueOfProperty:
answer the value of the receiver's property named aSymbol
valueOfProperty:ifAbsent:
if the receiver possesses a property of the given name, answer
its value. If not then evaluate aBlock and answer the result of
this block evaluation
valueOfProperty:ifAbsentPut:
If the receiver possesses a property of the given name, answer
its value. If not, then create a property of the given name, give
it the value obtained by evaluating aBlock, then answer that
value
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here.
If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables.
Some otherProperties need to be not copied at all, but shared. Their names are given by copyWeakly.
Some otherProperties should not be copied or shared. Their names are given by propertyNamesNotCopied.
This is special code for the dictionary. See DeepCopier, and veryDeepFixupWith:.
visible
answer whether the receiver is visible
visible:
MorphHierarchy
A MorphHierarchy is xxxxxxxxx.
Instance Variables
asMorph
Answer the morph version of the receiver
openOrDelete
roots
Answer the roots for the Object Hierarchy, that means answer the World
selected:
Change the selected object
MorphHierarchyListMorph
A MorphHierarchyListMorph is xxxxxxxxx.
Instance Variables
createContainer
Private - Create a container
inAContainer
Answer the receiver contained in a proper container
on:list:selected:changeSelected:menu:keystroke:
setSelectedMorph:
MorphListItemWrapper
A MorphListItemWrapper is xxxxxxxxx.
Instance Variables
asString
Answer the string representation of the receiver
contents
Answer the receiver's contents
icon
Answer a form to be used as icon
MorphWithSubmorphsWrapper
Display a morph in a SimpleHierarchicalListMorph, and arrange to recursively display the morph's submorphs. The "item" that is wrapped is the morph to display.
contents
MorphicAlarm
A MorphicAlarm is xxxxxxxxx.
Instance Variables
numArgs: <Object>
scheduledTime: <Object>
numArgs
- xxxxx
scheduledTime
- xxxxx
scheduledAt:receiver:selector:arguments:
scheduledTime
Return the time (in milliseconds) that the receiver is scheduled to be executed
scheduledTime:
Set the time (in milliseconds) that the receiver is scheduled to be executed
value:
MorphicEvent
This class represents the base for all events.
Instance variables:
stamp <Integer> The millisecond clock time stamp (based on Time millisecondClock)
source <Hand | nil> If non-nil the hand that generated the event.
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
convertOctober2000:using:
ar 10/25/2000: This method is used to convert OLD MorphicEvents into new ones.
copyHandlerState:
Copy the handler state from anEvent. Used for quickly transferring handler information between transformed events.
cursorPoint
Backward compatibility. Use #position instead
hand
Return the source that generated the event
hash
Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define =
isDraggingEvent
isDropEvent
isKeyboard
isKeystroke
isMorphicEvent
isMouse
isMouseOver
isMove
isWindowEvent
position
Since cursorPoint is defined and refers to position it should be defined
here as well
readFrom:
readFromObsolete:
resetHandlerFields
Reset anything that is used to cross-communicate between two eventual handlers during event dispatch
sentTo:
Dispatch the receiver into anObject
setHand:
setTimeStamp:
timeStamp
Return the millisecond clock value at which the event was generated
transformedBy:
Return the receiver transformed by the given transform into a local coordinate system.
type
Return a symbol indicating the type this event.
type:readFrom:
Read a MorphicEvent from the given stream.
wasHandled
Return true if this event was handled. May be ignored for some types of events.
wasHandled:
Determine if this event was handled. May be ignored for some types of events.
windowIndex
windowIndex:
MorphicEventDispatcher
The class represents a strategy for dispatching events to some immediate child of a morph. It is used by morphs to delegate the somewhat complex action of dispatching events accurately.
dispatchDefault:with:
Dispatch the given event. The event will be passed to the front-most visible submorph that contains the position wrt. to the event.
dispatchDropEvent:with:
Find the appropriate receiver for the event and let it handle it. The dispatch is similar to the default dispatch with one difference: Morphs are given the chance to reject an entire drop operation. If the operation is rejected, no drop will be executed.
dispatchEvent:with:
Dispatch the given event for a morph that has chosen the receiver to dispatch its events. The method implements a shortcut for repeated dispatches of events using the same dispatcher.
dispatchMouseDown:with:
Find the appropriate receiver for the event and let it handle it. Default rules:
* The top-most chain of visible, unlocked morphs containing the event position will get a chance to handle the event.
* When travelling down the hierarchy a prospective handler for the event is installed. This prospective handler can be used by submorphs wishing to handle the mouse down for negotiating who the receiver is.
* When travelling up, the prospective handler is always executed. The handler needs to check if the event was handled before as well as checking if somebody else's handler has been installed.
* If another handler has been installed but the event was not handled it means that somebody up in the hierarchy wants to handle the event.
MorphicModel
MorphicModels are used to represent structures with state and behavior as well as graphical structure. A morphicModel is usually the root of a morphic tree depicting its appearance. The tree is constructed concretely by adding its consituent morphs to a world.
When a part is named in a world, it is given a new slot in the model. When a part is sensitized, it is named, and a set of mouse-driven methods is also generated in the model. These may be edited to induce particular behavior. When a variable is added through the morphic world, it is given a slot in the model, along with a set of access methods.
In addition for public variables (and this is the default for now), methods are generated and called in any outer model in which this model gets embedded, thus propagating variable changes outward.
acceptsLoggingOfCompilation
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addPartNameLike:withValue:
categoryForSubclasses
chooseNewName
closeToEdits
Disable this morph's ability to add and remove morphs via drag-n-drop.
compileAccessorsFor:
compilePropagationForVarName:slotName:
defaultBorderColor
answer the default border color/fill style for the receiver
defaultBounds
answer the default bounds for the receiver
defaultColor
answer the default color/fill style for the receiver
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
hasPrototype
includeInNewMorphMenu
initialize
initialize the state of the receiver
isMorphicModel
Return true if the receiver is a morphic model
isOpen
Support drag/drop and other edits.
model
model:
Set my model and make me me a dependent of the given object.
model:slotName:
modelOrNil
nameFor:
Return the name of the slot containing the given morph or nil if that morph has not been named.
new
newBounds:
newBounds:model:slotName:
newSubclass
officialClass
openToEdits
Enable this morph's ability to add and remove morphs via drag-n-drop.
prototype
prototype:
releaseCachedState
Release cached state of the receiver
removeAll
Clear out all script methods and subpart instance variables in me. Start over.
removeUninstantiatedModels
use:orMakeModelSelectorFor:in:
wantsChangeSetLogging
MorphicUnknownEvent
A MorphicUnknownEvent is xxxxxxxxx.
Instance Variables
argument: <Object>
type: <Object>
argument
- xxxxx
type
- xxxxx
argument
argument:
position
Since cursorPoint is defined and refers to position it should be defined
here as well
setType:argument:
setType:argument:hand:stamp:
storeOn:
Append to the argument aStream a sequence of characters that is an
expression whose evaluation creates an object similar to the receiver.
type
Return a symbol indicating the type this event.
type:readFrom:
Read a MorphicEvent from the given stream.
MouseButtonEvent
A MouseButtonEvent is xxxxxxxxx.
Instance Variables
whichButton: <Object>
whichButton
- xxxxx
blueButtonChanged
Answer true if the blue mouse button has changed. This is the third mouse button or cmd+click on the Mac.
redButtonChanged
Answer true if the red mouse button has changed. This is the first mouse button.
sentTo:
Dispatch the receiver into anObject
setType:position:which:buttons:hand:stamp:
storeOn:
Append to the argument aStream a sequence of characters that is an
expression whose evaluation creates an object similar to the receiver.
type:readFrom:
Read a MorphicEvent from the given stream.
whichButton
yellowButtonChanged
Answer true if the yellow mouse button has changed. This is the second mouse button or option+click on the Mac.
MouseClickState
MouseClickState is a simple class managing the distinction between clicks, double clicks, and drag operations. It has been factored out of HandMorph due to the many instVars.
Instance variables:
clickClient <Morph> The client wishing to receive #click:, #dblClick:, or #drag messages
clickState <Symbol> The internal state of handling the last event (#firstClickDown, #firstClickUp, #firstClickTimedOut)
firstClickDown <MorphicEvent> The #mouseDown event after which the client wished to receive #click: or similar messages
firstClickUp <MorphicEvent> The first mouse up event which came in before the double click time out was exceeded (it is sent if there is a timout after the first mouse up event occured)
firstClickTime <Integer> The millisecond clock value of the first event
clickSelector <Symbol> The selector to use for sending #click: messages
dblClickSelector <Symbol> The selector to use for sending #doubleClick: messages
dblClickTime <Integer> Timout in milliseconds for a double click operation
dragSelector <Symbol> The selector to use for sending #drag: messages
dragThreshold <Integer> Threshold used for determining if a #drag: message is sent (pixels!)
click
client:click:dblClick:dblClickTime:dblClickTimeout:drag:threshold:event:
doubleClick
doubleClickTimeout
drag:
handleEvent:from:
Process the given mouse event to detect a click, double-click, or drag.
Return true if the event should be processed by the sender, false if it shouldn't.
NOTE: This method heavily relies on getting *all* mouse button events.
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
MouseEvent
A MouseEvent is xxxxxxxxx.
Instance Variables
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
anyButton
anyButtonPressed
Answer true if any mouse button is being pressed.
asMouseEnter
asMouseLeave
asMouseMove
Convert the receiver into a mouse move
asMouseOver
Convert the receiver into a mouse over event
blueButton
blueButtonPressed
Answer true if the blue mouse button is being pressed. This is the third mouse button or cmd+click on the Mac.
cursorPoint
Answer the location of the cursor's hotspot when this event occured.
hash
Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define =
isDraggingEvent
isMouse
isMouseDown
isMouseEnter
isMouseLeave
isMouseMove
isMouseUp
isMouseWheel
Answer whether the receiver is a mouse wheel event.
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
redButton
redButtonPressed
Answer true if the red mouse button is being pressed. This is the first mouse button.
sentTo:
Dispatch the receiver into anObject
setType:
For quick conversion between event types
setType:position:buttons:hand:
storeOn:
Append to the argument aStream a sequence of characters that is an
expression whose evaluation creates an object similar to the receiver.
targetPoint
Answer the location of the cursor's hotspot, adjusted by the offset
of the last mouseDown relative to the recipient morph.
type:readFrom:
Read a MorphicEvent from the given stream.
yellowButton
yellowButtonPressed
Answer true if the yellow mouse button is being pressed. This is the second mouse button or option+click on the Mac.
MouseMoveEvent
A MouseMoveEvent is xxxxxxxxx.
Instance Variables
startPoint: <Object>
trail: <Object>
startPoint
- xxxxx
trail
- xxxxx
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
endPoint
Return the point where the movement ended.
hash
Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define =
isMove
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
sentTo:
Dispatch the receiver into anObject
setType:startPoint:endPoint:trail:buttons:hand:stamp:
startPoint
Return the point where the movement started.
storeOn:
Append to the argument aStream a sequence of characters that is an
expression whose evaluation creates an object similar to the receiver.
trail
Return any immediate points that have been assembled along the move
transformBy:
Transform the receiver into a local coordinate system.
translateBy:
add delta to cursorPoint, and return the new event
type:readFrom:
Read a MorphicEvent from the given stream.
MouseOverHandler
A MouseOverHandler is xxxxxxxxx.
Instance Variables
enteredMorphs: <Object>
leftMorphs: <Object>
mouseOverMorphs: <Object>
overMorphs: <Object>
enteredMorphs
- xxxxx
leftMorphs
- xxxxx
mouseOverMorphs
- xxxxx
overMorphs
- xxxxx
handleAsMouseEnter:
handleAsMouseLeave:
handleAsMouseOver:
hasLeftMorphsChanged
inform:to:originatedFrom:ifNotFocusedDo:
informMouseLeaveToLeftMorphsUsing:
initialize
Subclasses should redefine this method to perform initializations on instance creation
initializeProcessMouseOver
initializeTrackedMorphs
is:withFocusOver:
keepLeftMorphsOrder
noticeMouseOver:event:
Remember that the mouse is currently over some morph
processMouseOver:
rememberOverList
transform:from:andSendTo:
MovieMorph
A MovieMorph is xxxxxxxxx.
Instance Variables
currentFrameIndex: <Object>
dwellCount: <Object>
frameList: <Object>
msecsPerFrame: <Object>
playMode: <Object>
rotationDegrees: <Object>
scalePoint: <Object>
currentFrameIndex
- xxxxx
dwellCount
- xxxxx
frameList
- xxxxx
msecsPerFrame
- xxxxx
playMode
- xxxxx
rotationDegrees
- xxxxx
scalePoint
- xxxxx
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
advanceFrame
containsPoint:
currentFrame
defaultColor
answer the default color/fill style for the receiver
drawOn:
editDrawing
extractFrame:
form
initialize
initialize the state of the receiver
insertFrames:
Insert the given collection of frames into this movie just after the currentrame.
insertIntoMovie:
nextFrame
playLoop
playOnce
previousFrame
rotationDegrees
Default implementation.
scalePoint
scalePoint:
setFrame:
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
stopPlaying
MultiCanvas
A canvas which forwards drawing commands to sub-canvases.
addCanvas:
allocateForm:
Allocate a new form which is similar to the receiver and can be used for accelerated blts
apply:
evaluate aBlock with a canvas to do a drawing command on. See implementors for examples
clipRect
Return the currently active clipping rectangle
contentsOfArea:into:
Return the contents of the given area
depth
depth:
set the extent to be used with this canvas
extent
Return the physical extent of the output device
extent:
set the extent to be used with this canvas
initialize
Subclasses should redefine this method to perform initializations on instance creation
removeCanvas:
MulticolumnLazyListMorph
A variant of LazyListMorph that can display multi-column lists.
display:atRow:on:
display the specified item, which is on the specified row; for Multicolumn
lists, items will be a list of strings
drawOn:
getListItem:
grab a list item directly from the model
hUnadjustedScrollRange
multi column list morphs don't use hScrollbars
listChanged
set newList to be the list of strings to display
setColumnWidthsFor:
set columnWidths for drawing on the specified canvas
widthToDisplayItem:
NameStringInHalo
Shows the name of the morph in the halo.
cancelEdits
drawOn:
interimContents:
The receiver is under edit and aString represents the string the user sees as she edits, which typically will not have been accepted and indeed may be abandoned
placeContents
NewHandleMorph
A NewHandleMorph is xxxxxxxxx.
Instance Variables
hand: <Object>
waitingForClickInside: <Object>
hand
- xxxxx
waitingForClickInside
- xxxxx
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
followHand:forEachPointDo:lastPointDo:
followHand:forEachPointDo:lastPointDo:withCursor:
includeInNewMorphMenu
initialize
initialize the state of the receiver
justDroppedInto:event:
No dropping behavior because stepping will delete me.
Moreover it needs to be done that way to evaluate lastPointBlock
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
sensorMode
If our client is still addressing the Sensor directly, we need to do so as well
sensorMode:
If our client is still addressing the Sensor directly, we need to do so as well
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
undoGrabCommand
Return an undo command for grabbing the receiver
NewParagraph
A Paragraph represents text that has been laid out, or composed, in some container.
text A Text with encoded per-character emphasis.
textStyle A TextStyle with font set, line height and horizontal alignment.
firstCharacterIndex The starting index in text for this paragraph, allowing
composition of a long text into a number of containers.
container A Rectangle or TextContainer that determines where text can go.
lines An Array of TextLines comprising the final layout of the text
after it has been composed within its container.
positionWhenComposed As its name implies. Allows display at new locations
without the need to recompose the text.
Lines are ordered vertically. However, for a given y, there may be several lines in left to right order. Lines must never be empty, even if text is empty.
Notes on yet another hack - 5 Feb 2001
We really need to clean up #composeLinesFrom:to:delta:into:priorLines:atY:!!!
I added one more habdful of code to correct:
This is an annoying bug that's been around for a couple of years, but I finally figured out how to duplicate the problem, so I figured I'd just report it now. (It doesn't necessarily have to be fixed for 3.0 if it looks messy, but if it's a simple fix, it would be worth it.)
In Morphic, if you have the following text in a workspace:
This is line 1
This is line 2
**and** you have a return character after line 2, you will normally be able to click the mouse two times below line 2 in order to select all the text. If you edit line 2 (e.g. so that it reads "line number 2"), you can still select all the text by clicking below the second line. However, if you edit line 1, you will not be able to select all the text from the bottom in the same way. Things get messed up such that the last return character seems to be gone. In this state, if you position the cursor immediately after the 2, and press the right arrow, the cursor jumps to the beginning of line 2... oof. (report by Doug Way)
While I don't have a very deep understanding of the above mentioned method, I was able to determine that text ending in a CR worked better in the editor when the last entry in <lines> had a start of text size + 1 and a stop of text size. I have accordingly added code near the end to ensure this. It seems to have fixed the problem, but we do need to clean this baby up some day. - Bob
OLDcomposeLinesFrom:to:delta:into:priorLines:atY:
While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values
adjustLineIndicesBy:
adjustRightX
adjustedFirstCharacterIndex
Return the index in the text where this paragraph WOULD begin if nothing had changed, except the size of the text -- ie if there have only been an insertion of deletion in the preceding morphs
asParagraphForPostscript
caretRect
The rectangle in which the caret was last drawn,
or nil if the last drawing drew a range-selection rather than insertion point.
caretWidth
centered
characterBlockAtPoint:
Answer a CharacterBlock for the character in the text at aPoint.
characterBlockForIndex:
Answer a CharacterBlock for the character in text at index.
clickAt:for:controller:
Give sensitive text a chance to fire. Display flash: (100@100 extent: 100@100).
compose:style:from:in:
composeAll
composeAllStartingAt:
composeLinesFrom:to:delta:into:priorLines:atY:
While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values
compositionRectangle
containsPoint:
deepCopy
Don't want to copy the container (etc) or fonts in the TextStyle.
defaultCharacterBlock
displayOn:using:at:
Send all visible lines to the displayScanner for display
displaySelectionInLine:on:
extent
fastFindFirstLineSuchThat:
Perform a binary search of the lines array and return the index
of the first element for which lineBlock evaluates as true.
This assumes the condition is one that goes from false to true for
increasing line numbers (as, eg, yval > somey or start char > somex).
If lineBlock is not true for any element, return size+1.
firstCharacterIndex
fixLastWithHeight:
This awful bit is to ensure that if we have scanned all the text and the last character is a CR that there is a null line at the end of lines. Sometimes this was not happening which caused anomalous selections when selecting all the text. This is implemented as a post-composition fixup because I coul;dn't figure out where to put it in the main logic.
focused
focused:
indentationOfLineIndex:ifBlank:
Answer the number of leading tabs in the line at lineIndex. If there are
no visible characters, pass the number of tabs to aBlock and return its value.
If the line is word-wrap overflow, back up a line and recur.
initialize
Subclasses should redefine this method to perform initializations on instance creation
insertionPointColor
justified
lastCharacterIndex
leftFlush
lineIndexForCharacter:
Answer the index of the line in which to select the character at index.
lineIndexForPoint:
Answer the index of the line in which to select the character nearest to aPoint.
lineIndexOfCharacterIndex:
Answer the line index for a given characterIndex.
lines
moveBy:
multiComposeLinesFrom:to:delta:into:priorLines:atY:
While the section from start to stop has changed, composition may ripple all the way to the end of the text. However in a rectangular container, if we ever find a line beginning with the same character as before (ie corresponding to delta in the old lines), then we can just copy the old lines from there to the end of the container, with adjusted indices and y-values
numberOfLines
positionWhenComposed:
recomposeFrom:to:delta:
Recompose this paragraph. The altered portion is between start and stop.
Recomposition may continue to the end of the text, due to a ripple effect.
Delta is the amount by which the current text is longer than it was
when its current lines were composed.
replaceFrom:to:with:displaying:
Edit the text, and then recompose the lines.
rightFlush
selectionColor
selectionRects
Return an array of rectangles representing the selection region.
selectionRectsFrom:to:
Return an array of rectangles representing the area between the two character blocks given as arguments.
selectionStart:selectionStop:
showCaret
showCaret:
string
testNewComposeAll
testNewComposeAll2
testNewComposeAll3
text
textOwner:
See TextOnCurve
textStyle
textStyle:
Set the style by which the receiver should display its text.
textStyle:lines:text:
Private -- just a service for deepCopy
wantsColumnBreaks
wantsColumnBreaks:
NullCanvas
A canvas which ignores all drawing commands.
clipBy:during:
do this in order that timing runs work better
clipRect
Return the currently active clipping rectangle
copyClipRect:
who cares what the clipping rectangle is?
extent
Return the physical extent of the output device
form
origin
Return the current origin for drawing operations
transformBy:clippingTo:during:smoothing:
do this in order that timing runs work better
translateBy:during:
do this in order that timing runs work better
NullEncoder
A NullEncoder is xxxxxxxxx.
Instance Variables
filterSelector: <Object>
target: <Object>
filterSelector
- xxxxx
target
- xxxxx
close
contents
defaultTarget
filterSelector
forward:
initWithTarget:
process:
stream
stream:
streamOn:
streamOnFile:
target
write:
writeObject:
ObjectExplorerWrapper
Contributed by Bob Arning as part of the ObjectExplorer package.
asString
Answer a string that represents the receiver.
canBeDragged
contents
hasContents
icon
Answer a form to be used as icon
itemName
parent
parent:
refresh
hack to refresh item given an object and a string that is either an index or an instance variable name.
selector
setItem:name:model:
setItem:name:model:parent:
with:name:model:
with:name:model:parent:
PaintBoxColorPicker
A pop-up, 32-bit color palette used as part of a PaintBoxMorph.
beStatic
an aid for Nebraska: make the color chart a static image to reduce traffic
currentColor
currentColor:
Force me to select the given color.
drawOn:
Image plus circles for currently selected color.
endColorSelection:
Update current color and report it to paint box.
initMouseHandlers
initialize
initialize the state of the receiver
ringColor
Choose a color that contrasts with my current color. If that color isn't redish, return red. Otherwise, return green
selectColor:
Update the receiver from the given event. Constrain locOfCurrent's center to lie within the color selection area. If it is partially in the transparent area, snap it entirely into it vertically.
startColorSelection:
Start color selection. Make me stay up as long as the mouse is down.
PaintBoxMorph
A PaintBoxMorph is xxxxxxxxx.
Instance Variables
action: <Object>
brushes: <Object>
colorMemory: <Object>
colorMemoryThin: <Object>
colorPatch: <Object>
currentBrush: <Object>
currentColor: <Object>
currentCursor: <Object>
focusMorph: <Object>
recentColors: <Object>
rotationTabForm: <Object>
scaleTabForm: <Object>
stampHolder: <Object>
thumbnail: <Object>
tool: <Object>
weakDependents: <Object>
action
- xxxxx
brushes
- xxxxx
colorMemory
- xxxxx
colorMemoryThin
- xxxxx
colorPatch
- xxxxx
currentBrush
- xxxxx
currentColor
- xxxxx
currentCursor
- xxxxx
focusMorph
- xxxxx
recentColors
- xxxxx
rotationTabForm
- xxxxx
scaleTabForm
- xxxxx
stampHolder
- xxxxx
thumbnail
- xxxxx
tool
- xxxxx
weakDependents
- xxxxx
action
actionCursor
Return the cursor to use with this painting action/tool. Offset of the form must be set.
addCustomMenuItems:hand:
super addCustomMenuItems: aCustomMenu hand: aHandMorph.
addGraphicLabels
translate button labels
addLabels
addTextualLabels
translate button labels
addWeakDependent:
beStatic
brush:action:nib:evt:
Set the current tool and action for the paintBox.
brushable
Return true if the current tool uses a brush.
clear:with:evt:
colorMemory
colorMemory:
colorPatch
colorable
Return true if the current tool uses a color.
createButtons
Create buttons one at a time and let the user place them over the background. Later can move them again by turning on AuthorModeOwner in ThreePhaseButtonMorph.
self createButtons.
currentColor:evt:
Accept a color from the outside. (my colorMemoryMorph must call takeColorEvt: evt from: colorPicker instead)
cursorFor:oldCursor:currentNib:color:
Return the cursor to use with this painting action/tool. Offset of the
form must be set.
deleteCurrentStamp:
The trash is telling us to delete the currently selected stamp
eyedropper:action:cursor:evt:
Take total control and pick up a color!!
fixUpColorPicker
fixUpPrototype
fixUpRecentColors
fixupButtons
focusMorph
Note: For backward compatibility we search the world for a SketchEditorMorph if the current focus morph is nil
focusMorph:
Set the new focus morph
getColor
getNib
getSpecial
grabFromScreen:
Allow the user to grab a picture from the screen OUTSIDE THE PAINTING AREA and install it in a blank stamp. To get a stamp in the painting area, click on the stamp tool in a blank stamp.
indicateColorUnderMouse
Track the mouse with the special eyedropper cursor, and accept whatever color is under the mouse as the currently-chosen color; reflect that choice in the feedback box, and return that color.
init3
Just a record of how we loaded in the latest paintbox button images
init4
Just a record of how Ted loaded in the paintbox button images, Feb 98
initialize
initialize the state of the receiver
initializeColorChart
keep:with:evt:
Showing of the corrent palette (viewer or noPalette) is done by the block submitted to the SketchMorphEditor, see (EToyHand makeNewDrawing) and (SketchMorph editDrawingInWorld:forBackground:).
loadColorChooser
Load Forms for ColorMemoryMorph.
loadCursors
Display the form containing the cursors. Transparent is (Color r: 1.0 g: 0 b: 1.0). Grab the forms one at a time, and they are stored away.
self loadCursors.
loadJapanesePaintBoxBitmaps
PaintBoxMorph new loadJapanesePaintBoxBitmaps.
loadOffForm:
Prototype loadOffForm: (Smalltalk imageImports at: #offPaletteJapanese)
loadOnImage:
Read in and convert the image for the paintBox with the buttons
on. A .bmp 24-bit image. For each button, cut that chunk out and save it.
loadPressedForm:
Prototype loadPressedForm: (Smalltalk imageImports at: #pressedPaletteJapanese)
loadPressedImage:
Read in and convert the image for the paintBox with the buttons
on. A .bmp 24-bit image. For each button, cut that chunk out and save it.
loadoffImage:
Read in and convert the background image for the paintBox. All
buttons off. A .bmp 24-bit image.
localeChanged
maxBounds
fullBounds if all flop-out parts of the paintBox were showing.
mouseDownRecent:with:
mouseStillDownRecent:with:
mouseUpBalk:
A button I own got a mouseDown, but the user moved out before letting up. Prevent this for the current tool. Some tool must stay selected.
mouseUpRecent:with:
moveButtons
Move buttons one at a time and let the user place them over the background. Later can move them again by turning on AuthorModeOwner in ThreePhaseButtonMorph.
self createButtons.
new
noVeneer
For a palette with a background (off) image, clear that image.
But first, for each button, cut that chunk out and save it in the offImage
part.
notCurrentlyPainting
notifyWeakDependentsWith:
offsetFromMaxBounds
location of normal PaintBox within maxBounds.
pickup:action:cursor:evt:
Special version for pickup: and stamp:, because of these tests
pickupForm:
Install the new picture in this stamp
pickupForm:evt:
Install the new picture in this stamp
plainCursor
Return the cursor to use with this painting action/tool. Offset of the form must be set.
plainCursor:event:
Set the cursor to use with this painting action/tool. Offset of the form must be set.
prototype
recentColor:
Remember the color as one of our recent colors
ringColor
Choose a color that contrasts with my current color. If that color isn't redish, return red. Otherwise, return green
ringColorFor:
Choose a color that contrasts with my current color. If that color isn't redish, return red. Otherwise, return green
rotationTabForm
scaleTabForm
scrollStamps:action:evt:
Move the stamps over
setAction:evt:
Find this button and turn it on. Does not work for stamps or pickups
showColor
Display the current color in all brushes, both on and off.
showColorPalette:
stampCursorBeCursorFor:
User just chose a stamp. Take that stamp picture and make it be the cursor for the tool named.
stampDeEmphasize
Turn off an emphasized stamp. Was turned on in pickup:action:cursor:
stampForm
Return the selected stamp
stampHolder
stampHolder:
takeColor:event:
Accept the given color programmatically
takeColorEvt:from:
Accept a new color from the colorMemory. Programs use currentColor: instead. Do not do this before the picker has a chance to set its own color!
toggleShapes
The sub panel that has the shape tools on it. Rect, line...
toggleStamps
The sub panel that has the stamps in it. For saving and moving parts of an image.
tool
tool:action:cursor:evt:
Set the current tool and action for the paintBox.
toss:with:evt:
Reject the painting. Showing noPalette is done by the block submitted to the SketchEditorMorph
undo:with:evt:
PasteUpMorph
A morph whose submorphs comprise a paste-up of rectangular subparts which "show through". Anything called a 'Playfield' is a PasteUpMorph.
Facilities commonly needed on pages of graphical presentations and on simulation playfields, such as the painting of new objects, turtle trails, gradient fills, background paintings, parts-bin behavior, collision-detection, etc., are (or will be) provided.
A World, the entire Smalltalk screen, is a PasteUpMorph. A World responds true to isWorld.
presenter A Presenter in charge of stopButton stepButton and goButton,
mouseOverHalosEnabled soundsEnabled fenceEnabled coloredTilesEnabled.
model <not used>
cursor ??
padding ??
backgroundMorph A Form that covers the background.
turtleTrailsForm Moving submorphs may leave trails on this form.
turtlePen Draws the trails.
lastTurtlePositions A Dictionary of (aPlayer -> aPoint) so turtle trails can be drawn
only once each step cycle. The point is the start of the current stroke.
isPartsBin If true, every object dragged out is copied.
autoLineLayout ??
indicateCursor ??
resizeToFit ??
wantsMouseOverHalos If true, simply moving the cursor over a submorph brings up its halo.
worldState If I am also a World, keeps the hands, damageRecorder, stepList etc.
griddingOn If true, submorphs are on a grid
MinCycleLapse:
abandonAllHalos
acceptDroppingMorph:event:
The supplied morph, known to be acceptable to the receiver, is now to be assimilated; the precipitating event is supplied
accommodateFlap:
Shift submorphs over, if appropriate
activeHand
activeHand:
temporarily retained for old main event loops
adaptedToWorld:
If I refer to a world or a hand, return the corresponding items in the new world.
addAlarm:withArguments:for:at:
Add a new alarm with the given set of parameters
addAllMorphs:
addCenteredAtBottom:offset:
Add aMorph beneath all other morphs currently in the receiver, centered horizontally, with the vertical offset from the bottom of the previous morph given by anOffset
addCustomMenuItems:hand:
Add morph-specific menu itemns to the menu for the hand
addGlobalFlaps
Must make global flaps adapt to world. Do this even if not shown, so the old world will not be pointed at by the flaps.
addHand:
Add the given hand to the list of hands for this world.
addMorph:centeredNear:
Add the given morph to this world, attempting to keep its center as close to the given point possible while also keeping the it entirely within the bounds of this world.
addMorphFront:
addMorphInLayer:
addMorphsAndModel:
Dump in submorphs, model, and stepList from aMorphOrList. Used to bring a world, paste-up, or other morph in from an object file.
addScalingMenuItems:hand:
addUndoItemsTo:
Add undo-related items to the given menu. Will add zero, one or two items, depending on the settings of the #useUndo and #infiniteUndo preferences
addViewingItemsTo:
Add viewing-related items to the given menu. If any are added, this method is also responsible for adding a line after them
addWorldHaloMenuItemsTo:hand:
Add standard halo items to the menu, given that the receiver is a World
addWorldToggleItemsToHaloMenu:
Add toggle items for the world to the halo menu
allMorphsDo:
Enumerate all morphs in the world, including those held in hands.
allNonFlapRelatedSubmorphs
Answer all non-window submorphs that are not flap-related
alwaysShowThumbnail
assureFlapTabsFitOnScreen
assureFlapWidth:
assureNotPaintingElse:
If painting is already underway in the receiver, put up an informer to that effect and evalute aBlock
assureNotPaintingEvent:
If painting is already underway
in the receiver, put up an informer to that effect and evalute aBlock
assuredCanvas
authoringPrototype
autoLineLayout
autoLineLayout:
Make the receiver be viewed with auto-line-layout, which means that its submorphs will be laid out left-to-right and then top-to-bottom in the manner of a word processor, or (if aBoolean is false,) cease applying auto-line-layout
autoLineLayoutString
Answer the string to be shown in a menu to represent the
auto-line-layout status
automaticPhraseExpansion
backgroundForm
backgroundSketch
beWorldForProject:
becomeActiveDuring:
Make the receiver the ActiveWorld during the evaluation of aBlock.
Note that this method does deliberately *not* use #ensure: to prevent
re-installation of the world on project switches.
becomeLikeAHolder
behaveLikeAHolderString
Answer a string to be displayed in a menu to characterize
whether the receiver is currently behaving like a holder
behaveLikeHolder
behaveLikeHolder:
Change the receiver's viewing properties such that they conform to what we commonly call a Holder, viz: resize-to-fit, do auto-line-layout, and indicate the 'cursor'
behavingLikeAHolder
Answer whether the receiver is currently behaving like a Holder
bringTopmostsToFront
bringWindowsFullOnscreen
Make ever SystemWindow on the desktop be totally on-screen, whenever possible.
buildWorldMenu:
cachedOrNewThumbnailFrom:
If I have a cached thumbnail, and it is of the desired extent, then ruturn it.
Otherwise produce one in newThumbnail and return it (after caching).
This code parallels what happens in page: to match resultant extent.
canHaveFillStyles
Return true if the receiver can have general fill styles; not just colors.
This method is for gradually converting old morphs.
canvas
checkCurrentHandForObjectToPaste
checkCurrentHandForObjectToPaste2
chooseClickTarget
cleanseStepList
Remove morphs from the step list that are not in this World. Often were in a flap that has moved on to another world.
clearCommandHistory
closeUnchangedWindows
Present a menu of window titles for all windows with changes,
and activate the one that gets chosen.
collapseAll
Collapse all windows
collapseNonWindows
colorAt:belowMorph:
Return the color of the pixel immediately behind the given morph at the given point.
NOTE: due to some bounds wobble in flexing, we take the middle of 3x3 rect.
commandHistory
Return the command history for the receiver
commandKeySelectors
Answer my command-key table
convertAlignment
correspondingFlapTab
If there is a flap tab whose referent is me, return it, else return nil
createCustomModel
Create a model object for this world if it does not yet have one. A model object is an initially empty subclass of MorphicModel. As the user names parts and adds behavior, instance variables and methods are added to this class.
currentWindow
Answer the top window.
cursor
vacuous backstop in case it gets sent to a morph that doesn't know what to do with it
cursor:
for backward compatibility
cursorWrapped:
Set the cursor to the given number, modulo the number of items I
contain. Fractional cursor values are allowed.
defaultBorderColor
answer the default border color/fill style for the receiver
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
defaultDesktopCommandKeyTriplets
Answer a list of triplets of the form
<key> <receiver> <selector> [+ optional fourth element, a <description> for use in desktop-command-key-help]
that will provide the default desktop command key handlers. If the selector takes an argument, that argument will be the command-key event
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver
defersHaloOnClickTo:
If a cmd-click on aSubMorph would make it a preferred recipient of the halo, answer true
defineApplicationView
defineFactoryView
delayedInvokeWorldMenu:
deleteAllHalos
deleteBackgroundPainting
deleteBalloonTarget:
Delete the balloon help targeting the given morph
deleteGlobalFlapArtifacts
Delete all flap-related detritus from the world
deleteNonWindows
disableDeferredUpdates
disableDeferredUpdates:
disconnectRemoteUser
Prompt for the initials of the remote user, then remove the remote hand with those initials, breaking its connection.
dispatchCommandKeyInWorld:event:
Dispatch the desktop command key if possible. Answer whether handled
displayWorld
displayWorldAsTwoTone
Display the world in living black-and-white. (This is typically done to save space.)
displayWorldNonIncrementally
Display the morph world non-incrementally. Used for testing.
displayWorldSafely
doOneCycle
see the comment in doOneCycleFor:
doOneCycleNow
see the comment in doOneCycleNowFor:
doOneSubCycle
Like doOneCycle, but preserves activeHand.
dragThroughOnDesktop:
Draw out a selection rectangle
drawOn:
Draw in order:
- background color
- grid, if any
- background sketch, if any
- Update and draw the turtleTrails form. See the comment in updateTrailsForm.
- cursor box if any
Later (in drawSubmorphsOn:) I will skip drawing the background sketch.
drawSubmorphsOn:
Display submorphs back to front, but skip my background sketch.
drawingClass
dropEnabled
Get this morph's ability to add and remove morphs via drag-n-drop.
dropFiles:
Handle a number of dropped files from the OS.
TODO:
- use a more general mechanism for figuring out what to do with the file (perhaps even offering a choice from a menu)
- remember the resource location or (when in browser) even the actual file handle
embeddedProjectDisplayMode
#naked - the embedded project/world is just a pasteup in the outer p/w
#window - the embedded p/w is in a system window in the outer p/w
#frame - the embedded p/w is in a green frame and clipped
#scaled - the embedded p/w is in a green frame and scaled to fit
enableGlobalFlaps
Restore saved global flaps, or obtain brand-new system defaults if necessary
endDrawing:
If painting is already underway
in the receiver, finish and save it.
exit
expandAll
Expand all windows
extent:
extractScreenRegion:andPutSketchInHand:
The user has specified a polygonal area of the Display.
Now capture the pixels from that region, and put in the hand as a Sketch.
findAChangeSorter:
Locate a change sorter, open it, and bring it to the front. Create one if necessary
findAFileList:
Locate a file list, open it, and bring it to the front.
Create one if necessary, respecting the Preference.
findAMessageNamesWindow:
Locate a MessageNames tool, open it, and bring it to the front. Create one if necessary
findATranscript:
Locate a transcript, open it, and bring it to the front. Create one if necessary
findAWindowSatisfying:orMakeOneUsing:
Locate a window satisfying a block, open it, and bring it to the front. Create one if necessary, by using the makeBlock
findDirtyBrowsers:
Present a menu of window titles for browsers with changes,
and activate the one that gets chosen.
findDirtyWindows:
Present a menu of window titles for all windows with changes,
and activate the one that gets chosen.
findWindow:
Present a menu names of windows and naked morphs, and activate the one that gets chosen. Collapsed windows appear below line, expand if chosen; naked morphs appear below second line; if any of them has been given an explicit name, that is what's shown, else the class-name of the morph shows; if a naked morph is chosen, bring it to front and have it don a halo.
firstHand
fixUponLoad:seg:
We are in an old project that is being loaded from disk.
Fix up conventions that have changed.
flapTab
flapTabs
flashRects:color:
For testing. Flashes the given list of rectangles on the Display so you can watch incremental redisplay at work.
fullContainsPoint:
The world clips its children
fullRepaintNeeded
getCharacters
obtain a string value from the receiver
getWorldMenu:
goBack
grabDrawingFromScreen:
Allow the user to specify a rectangular area of the Display, capture the pixels from that area, and use them to create a new drawing morph. Attach the result to the hand.
grabFloodFromScreen:
Allow the user to plant a flood seed on the Display, and create a new drawing morph from the resulting region. Attach the result to the hand.
grabLassoFromScreen:
Allow the user to specify a polygonal area of the Display, capture the pixels from that area, and use them to create a new drawing morph. Attach the result to the hand.
grabRubberBandFromScreen:
Allow the user to specify a polygonal area of the Display, capture the pixels from that area, and use them to create a new drawing morph. Attach the result to the hand.
gradientFillColor:
For backwards compatibility with GradientFillMorph
gridModulus
gridModulus:
gridOrigin
gridOrigin:
gridPoint:
gridSpec
Gridding rectangle provides origin and modulus
gridSpecPut:
Gridding rectangle provides origin and modulus
gridVisible
gridVisibleOnOff
gridVisibleString
Answer a string to be used in a menu offering the opportunity
to show or hide the grid
griddingOn
griddingOnOff
griddingString
Answer a string to use in a menu offering the user the
opportunity to start or stop using gridding
haloMorphs
handleFatalDrawingError:
Handle a fatal drawing error.
handlerForMouseDown:
If we have a modal dialog then answer nil otherwise as usual..
handlesKeyboard:
Return true if the receiver wishes to handle the given keyboard event
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
hands
handsDo:
handsReverseDo:
heightForThumbnails
hideFlapsOtherThan:ifClingingTo:
Hide flaps on the given edge unless they are the given one
icon
Answer a form with an icon to represent the receiver
indicateCursor
indicateCursor:
indicateCursorString
Answer the string to be shown in a menu to represent the
whether-to-indicate-cursor status
initForProject:
initialize
initialize the state of the receiver
initializeDesktopCommandKeySelectors
Provide the starting settings for desktop command key selectors. Answer the dictionary.
initializeToStandAlone
Answer an instance of the receiver suitable for placing in a parts bin for authors
innocuousName
Choose an innocuous name for the receiver -- one that does not end in the word Morph
install
installFlaps
Get flaps installed within the bounds of the receiver
invalidRect:from:
Clip damage reports to my bounds, since drawing is clipped to my bounds.
invokeWorldMenu:
Put up the world menu, triggered by the passed-in event.
isEasySelecting
This is to isolate easySelection predicate.
Selectors in holders make no sense so we are limiting easy selection to the worldMorph.
It would also make sense in playfield so feel free to adjust this predicate. Selection can always be forced by using the shift before mouse down.
isOpenForDragNDropString
Answer the string to be shown in a menu to represent the
open-to-drag-n-drop status
isPartsBin
isPartsBin:
isPartsBinString
Answer the string to be shown in a menu to represent the
parts-bin status
isPlayfieldLike
isStepping:
isStepping:selector:
isWorldMorph
justDroppedInto:event:
This message is sent to a dropped morph after it has been dropped on--and been accepted by--a drop-sensitive morph
keyStroke:
A keystroke has been made. Service event handlers and, if it's a keystroke presented to the world, dispatch it to #unfocusedKeystroke:
keyboardNavigationHandler
Answer the receiver's existing keyboardNavigationHandler, or nil if none.
keyboardNavigationHandler:
Set the receiver's keyboard navigation handler as indicated. A nil argument means to remove the handler
keystrokeInWorld:
A keystroke was hit when no keyboard focus was set, so it is sent here to the world instead.
lastKeystroke
Answer the last keystroke fielded by the receiver
lastKeystroke:
Remember the last keystroke fielded by the receiver
laySubpartsOutInOneRow
layoutChanged
The receiver's layout changed; inform above and below
listOfSteppingMorphs
localFlapTabs
Answer a list of local flap tabs in the current project
maxHeightToAvoidThumbnailing
maximumThumbnailWidth
modalLockTo:
Don't lock the world! Lock the submorphs.
The modal window gets opened afterwards so is OK.
modalUnlockFrom:
Don't unlock the world! Unlock the submorphs
that were not originally locked.
modalWindow:
model
Return the model object for this world. If the world has no model, then create one.
modelOrNil
Return the model object for this world, or nil if it doesn't have one.
modelWakeUp
I am the model of a SystemWindow, that has just been activated
morphToDropFrom:
Given a morph being carried by the hand, which the hand is about to drop, answer the actual morph to be deposited. Normally this would be just the morph itself, but several unusual cases arise, which this method is designed to service.
morphToGrab:
Return the morph to grab from a mouse down event. If none, return nil.
morphicLayerNumber
helpful for insuring some morphs always appear in front of or behind others.
smaller numbers are in front
morphsInFrontOf:overlapping:do:
Include hands if the receiver is the World
mouseDown:
Handle a mouse down event.
mouseOverHalosString
Answer the string to be shown in a menu to represent the
mouse-over-halos status
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
nameForCopyIfAlreadyNamed:
Answer a name to set for a copy of aMorph if aMorph itself is named, else nil
navigateVisibleWindowForward
Change the active window to the next visible and
not collapsed window.
navigateWindowBackward
Change the active window to the previous window.
navigateWindowForward
Change the active window to the next window.
navigationKey:
Check for active window navigation.
newResourceLoaded
Some resource has just been loaded. Notify all morphs in case somebody wants to update accordingly.
newWorldForProject:
newWorldTesting
nextPage
backstop for smart next-page buttons that look up the containment hierarchy until they find somone who is willing to field this command. If we get here, the 'next' button was not embedded in a book, so we can do nothing useful
nextVisibleWindow
Answer the next (visible) window to navigate to.
nextWindow
Answer the next window to navigate to.
numberAtCursor
Answer the number represented by the object at my current cursor position
offsetForAccommodating:onEdge:
Answer a delta to be applied to my submorphs in order tfor anExtent to be slid inboard on the indicated edge
onceAgainDismiss:
Occasioned by a redo of a dismiss-via-halo
openModal:
Open the given window locking the receiver until it is dismissed.
Set the pane color to match the current theme.
Answer the system window.
openRecentSubmissionsBrowser:
Locate a recent-submissions browser, open it, and bring it to the front. Create one if necessary. Only works in morphic
openWorldMenu
optimumExtentFromAuthor
originAtCenter
originAtCenterString
Answer the string to be shown in a menu to represent the
origin-at-center status
padding:
paintArea
What rectangle should the user be allowed to create a new painting in??
An area beside the paintBox. Allow playArea to override with its own
bounds!
paintAreaFor:
Answer the area to comprise the onion-skinned canvas for painting/repainting aSketchMorph
paintBox
Return the painting controls widget (PaintBoxMorph) to be used for painting in this world. If there is not already a PaintBox morph, or if it has been deleted from this world, create a new one.
paintBoxOrNil
Return the painting controls widget (PaintBoxMorph) to be used for painting in this world. If there is not already a PaintBox morph return nil
paintingBoundsAround:
Return a rectangle for painting centered on the given point. Both the argument point and the result rectangle are in world coordinates.
paintingFlapTab
If the receiver has a flap which has a paintbox, return it, else return nil
patchAt:without:andNothingAbove:
Return a complete rendering of this patch of the display screen
without stopMorph, and possibly without anything above it.
pauseEventRecorder
Suspend any event recorder, and return it if found
playfieldOptionsMenu
Answer an auxiliary menu with options specific to playfields -- too many to be housed in the main menu
position:
Prevent moving a world (e.g. via HandMorph>>specialGesture:)
positionNear:forExtent:adjustmentSuggestion:
Compute a plausible positioning for adding a subpart of size anExtent, somewhere near aPoint, using adjustmentPoint as the unit of adjustment
prepareToPaint
We're about to start painting. Do a few preparations that make the system more responsive.
prepareToPaint:
We're about to start painting. Do a few preparations that make the system more responsive.
presentPlayfieldMenu
presentViewMenu
Answer an auxiliary menu with options specific to viewing playfields -- this is put up from the provisional 'view' halo handle, on pasteup morphs only.
presenter
Normally only the world will have a presenter, but the architecture supports individual localized presenters as well
previousPage
backstop for smartprev-page buttons that look up the containment hierarchy until they find somone who is willing to field this command. If we get here, the button was not embedded in a book, so we can do nothing useful
previousWindow
Answer the previous window to navigate to.
printOn:
Reimplemented to add a tag showing that the receiver is currently functioning as a 'world', if it is
privateFullMoveBy:
Private. Overridden to prevent drawing turtle trails when a playfield is moved
privateMoveBy:
Private! Use 'position:' instead.
privateOuterDisplayWorld
privateRemoveMorph:
processEvent:using:
Reimplemented to install the receiver as the new ActiveWorld if it is one
project
Find the project that owns me. Not efficient to call this.
putUpWorldMenu:
Put up a menu in response to a click on the desktop, triggered by evt.
putUpWorldMenuFromEscapeKey
reasonablePaintingExtent
rectifyCursor
reformulateUpdatingMenus
Give any updating menu morphs in the receiver a fresh kiss of life
reintroduceIntoWorld:
The given morph is being raised from the dead. Bring it back to life.
releaseCachedState
Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.
releaseViewers
In preparation for saving, make the flapTabs release their viewers.
removeAccommodationForFlap:
Shift submorphs over, if appropriate
removeAlarm:for:
Remove the alarm with the given selector
removeHand:
Remove the given hand from the list of hands for this world.
removeModalWindow
repelsMorph:event:
reportLocalAddress
Report the local host address of this computer.
repositionFlapsAfterScreenSizeChange
Reposition flaps after screen size change
requestor
returns the focused window's requestor
resizeToFit
resizeToFitString
Answer a string, to be used in a self-updating menu, to
represent whether the receiver is currently using resize-to-fit
or not
respondToCommand:bySending:to:
Respond to the command-key use of the given character by sending the given selector to the given receiver. If the selector is nil, retract any prior such setting
restartWorldCycleWithEvent:
RAA 27 Nov 99 - redispatch that click picked up from our inner world
restoreBoundsOfSubmorphs
restores the saved xy-positions and extents
restoreDisplay
restoreFlapsDisplay
Restore the display of flaps
restoreMainDockingBarDisplay
Restore the display of docking bars
restoreMorphicDisplay
runLocalStepMethods
runStepMethods
saveAsWorld
saveBoundsOfSubmorphs
store the current xy-positions and extents of submorphs for future use
saveOnFile
Ask the user for a filename and save myself on a SmartReferenceStream file. Writes out the version and class structure. The file is fileIn-able. UniClasses will be filed out.
selectedRect
Return a rectangle enclosing the morph at the current cursor. Note that the cursor may be a float and may be out of range, so pick the nearest morph. Assume there is at least one submorph.
setGradientColor:
For backwards compatibility with GradientFillMorph
setGridSpec
Gridding rectangle provides origin and modulus
setModel:
Set the model for this world. Methods for sensitized morphs will be compiled into the class for this model.
setPartsBinStatusTo:
shouldGetStepsFrom:
showApplicationView
showExpandedView
the transform
showFactoryView
showFullView
showReducedView
showThumbnailString
Answer the string to be shown in a menu to represent the
show-thumbnails status
showWorldMainDockingBarString
showingListView
Answer whether the receiver is currently showing a list view
shutDown
sketchEditorOrNil
Return a SketchEditorMorph found in the world, if any, else nil
sleep
someHalo
Return some halo that's currently visible in the world
sortSubmorphsBy:
Sort the receiver's submorphs by the criterion indicated in the provided symbol
specialNameInModelFor:
standardPlayerHit
startStepping:
Add the given morph to the step list. Do nothing if it is already being stepped.
startStepping:at:selector:arguments:stepTime:
startSteppingSubmorphsOf:
Ensure that all submorphs of the given morph that want to be stepped are added to the step list. Typically used after adding a morph to the world.
startUp
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepListSize
stepListSummary
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
steppingMorphsNotInWorld
stopStepping:
Remove the given morph from the step list.
stopStepping:selector:
Remove the given morph from the step list.
systemWindows
Answer the system windows in the world.
themeChanged
The theme has changed.
Update the desktop wallpaper if appropriate.
toggleAutoLineLayout
Toggle the auto-line-layout setting
toggleBehaveLikeAHolder
Toggle whether or not the receiver is currently behaving like a holder
toggleIndicateCursor
toggleIsPartsBin
Not entirely happy with the openToDragNDrop not being directly manipulable etc, but still living with it for now.
toggleMouseOverHalos
toggleOriginAtCenter
toggleResizeToFit
Toggle whether the receiver is set to resize-to-fit
toggleShowWorldMainDockingBar
topRequestor
returns the focused window's requestor
transformToShow:
undoOrRedoCommand
Undo or redo the last command recorded in the world
unhideHiddenObjects
unusedMorphNameLike:
Answer a suitable name for a morph in this world, based on the stem provided
useRoundedCorners
Somewhat special cased because we do have to fill Display for this
validateMouseEvent:
valueAtCursor
Answer the submorph of mine indexed by the value of my 'cursor' slot
valueAtCursor:
veryDeepCopyWith:
See storeDataOn:
viewBox
This tortured workaround arises from a situation encountered
in which a PasteUpMorph was directliy lodged as a submorph
of another PasteUpMorph of identical size, with the former
bearing flaps but the latter being the world
viewBox:
I am now displayed within newViewBox; react.
viewByIcon
The receiver has been being viewed in some constrained layout view; now restore it to its normal x-y-layout view
viewNonOverlapping
Make the receiver show its contents as full-size morphs laid out left-to-right and top-to-bottom to be non-overlapping.
viewingByIconString
Answer a string to show in a menu representing whether the
receiver is currently viewing its subparts by icon or not
viewingBySizeString
Answer a string to show in a menu representing whether the
receiver is currently viewing its subparts by size or not
viewingNonOverlappingString
Answer a string to show in a menu representing whether the
receiver is currently viewing its subparts by
non-overlapping-icon (aka auto-line-layout)
viewingNormally
Answer whether the receiver is being viewed normally, viz not in list-view or auto-line-layout
visibleSystemWindows
Answer the visible system windows in the world.
wantsDirectionHandles
wantsDropFiles:
Return true if the receiver wants files dropped from the OS.
wantsDroppedMorph:event:
Return true if the receiver wishes to accept the given morph, which is being dropped by a hand in response to the given event. Note that for a successful drop operation both parties need to agree. The symmetric check is done automatically via aMorph wantsToBeDroppedInto: self.
wantsEasySelection
Answer if the receiver want easy selection mode
wantsHaloFor:
Answer whether the receiver wishes for a mouse-over halo to be produced for aSubMorph
wantsHaloFromClick
wantsKeyboardFocusFor:
Answer whether a plain mouse click on aSubmorph, a text-edit-capable thing, should result in a text selection there
wantsMouseOverHalos
wantsMouseOverHalos:
windowsSatisfying:
world
worldMenu
PluggableButtonMorph
A PluggableButtonMorph is a combination of an indicator for a boolean value stored in its model and an action button. The action of a button is often, but not always, to toggle the boolean value that it shows. Its pluggable selectors are:
getStateSelector fetch a boolean value from the model
actionSelector invoke this button's action on the model
getLabelSelector fetch this button's lable from the model
getMenuSelector fetch a pop-up menu for this button from the model
Any of the above selectors can be nil, meaning that the model does not supply behavior for the given action, and the default behavior should be used. For example, if getStateSelector is nil, then this button shows the state of a read-only boolean that is always false.
The model informs its view(s) of changes by sending #changed: to itself with getStateSelector as a parameter. The view tells the model when the button is pressed by sending actionSelector.
If the actionSelector takes one or more arguments, then the following are relevant:
arguments A list of arguments to provide when the actionSelector is called.
argumentsProvider The object that is sent the argumentSelector to obtain arguments, if dynamic
argumentsSelector The message sent to the argumentProvider to obtain the arguments.
Options:
askBeforeChanging have model ask user before allowing a change that could lose edits
triggerOnMouseDown do this button's action on mouse down (vs. up) transition
shortcutCharacter a place to record an optional shortcut key
action
Answer the action selector.
action:
Set actionSelector to be the action defined by aSymbol.
actionSelector
Answer the receiver's actionSelector
actionSelector:
Set actionSelector to be the action defined by aSymbol.
SimpleButtonMorph cross-compatibility
adoptColor:
Go through paneColorChanged instead.
adoptPaneColor:
arguments
Answer the static arguments.
SimpleButtonMorph cross-compatibility.
arguments:
If the receiver takes argument(s) that are static, they can be filled by calling this. If its argument(s) are to be dynamically determined, then use an argumentProvider and argumentSelector instead
argumentsProvider:argumentsSelector:
Set the argument provider and selector
askBeforeChanging
askBeforeChanging:
If this preference is turned on, then give the model an opportunity to ask the user before accepting a change that might cause unaccepted edits to be lost.
borderStyleToUse
Return the borderStyle to use for the receiver.
changed
Update the fillStyle here.
color:
Check to avoid repeats of the same color.
colorToUse
Answer the color we should use.
containsMousePoint
Answer whether the mouse is in the receiver and our window is active.
Not ideal, but no easy way of determining if a mouse over would be sent
to the receiver.
contentHolder
Answer the alignment morph for extra control.
cornerStyle:
Adjust the layout inset.
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
disabledBorderStyle
Return the disabled borderStyle of the receiver.
disabledFillStyle
Return the disabled fillStyle of the receiver.
drawOn:
Avoid the selection feedback.
drawSubmorphsOn:
Display submorphs back to front.
Draw the focus here since we are using inset bounds
for the focus rectangle.
extent:
Set the receiver's extent to value provided.
Update the gradient fills.
feedbackColor:
Set the color of this button's selection feedback border.
fillStyleToUse
Return the fillStyle to use for the receiver.
focusBounds
Answer the bounds for drawing the focus indication.
focusColor
Answer the keyboard focus indication color.
focusIndicatorCornerRadius
Answer the corner radius preferred for the focus indicator
for the receiver for themes that support this.
getMenu:
Answer the menu for this button, supplying an empty menu to be filled in. If the menu selector takes an extra argument, pass in the current state of the shift key.
getMenuSelector:
Set the menu selector.
getModelState
Answer the result of sending the receiver's model the getStateSelector message.
If the selector expects arguments then supply as for the actionSelector.
handlesKeyboard:
Answer true, we'll handle spacebar for pressing plus the usual
tab navigation.
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesMouseOver:
Do I want to receive mouseEnter: and mouseLeave: when the button is up and the hand is empty? The default response is false, except if you have added sensitivity to mouseEnter: or mouseLeave:, using the on:send:to: mechanism.
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
indicateModalChild
Flash the button border.
initialize
Initialize the state of the receiver.
invokeMenu:
Invoke my menu in response to the given event.
isDefault
Answer whether the button is considered to be a default one.
isDefault:
Set whether the button is to be considered default.
isOn
keyStroke:
Process spacebar for action and tab keys for navigation.
keyboardFocusChange:
The message is sent to a morph when its keyboard focus changes.
Update for focus feedback.
label
Answer the DisplayObject used as this button's label.
label:
Label this button with the given string or morph.
label:font:
Label this button with the given string or morph.
labelMorph
Answer the actual label morph.
layoutBounds:
Set the bounds for laying out children of the receiver.
Update the fillstyle since it may depend on the bounds.
minHeight
Consult the theme also.
minWidth
Consult the theme also.
model
Answer the receiver's model.
model:
Set my model and make me me a dependent of the given object.
mouseDown:
Details: If this button is triggered on mouse down or the event is the menu gesture, handle it immediately. Otherwise, make a list of buttons (including the receiver) for mouseMove feedback. This allows a simple radio-button effect among the button submorphs of a given morph.
mouseEnter:
Update the appearance.
mouseLeave:
Update the appearance.
mouseLeaveDragging:
Handle a mouseLeaveLaden event, meaning the mouse just left my bounds with a button pressed or laden with submorphs. The default response is to let my eventHandler, if any, handle it; else to do nothing.
mouseMove:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseOverBorderStyle
Return the mouse over borderStyle of the receiver.
mouseOverFillStyle
Return the mouse over fillStyle of the receiver.
mouseUp:
Perform the button action if the mouse pointer is in a button in the group.
Optimised feedback updates.
newLabel
Answer a new label for the receiver.
newLabel:
Answer a new label for the receiver with the given font.
normalBorderStyle
Return the normal borderStyle of the receiver.
normalColor
Return the normal colour for the receiver.
normalFillStyle
Return the normal fillStyle of the receiver.
offColor
offColor:
Set the fill colors to be used when this button is off.
on:
on:getState:action:
on:getState:action:label:
on:getState:action:label:menu:
Set up the pluggable parameters.
Update label and state.
onColor
Answer the on color.
onColor:offColor:
Set the fill colors to be used when this button is on/off.
paneColorChanged
Update the fillStyle here.
Optimised to not send #changed if no changes.
performAction
Inform the model that this button has been pressed. Sent by the controller when this button is pressed. If the button's actionSelector takes any arguments, they are obtained dynamically by sending the argumentSelector to the argumentsProvider
pressedBorderStyle
Return the pressed borderStyle of the receiver.
pressedFillStyle
Return the pressed fillStyle of the receiver.
roundedCorners:
Adjust the layout inset if necessary.
selectedBorderStyle
Return the selected borderStyle of the receiver.
selectedDisabledBorderStyle
Return the selected disabled borderStyle of the receiver.
selectedDisabledFillStyle
Return the selected disabled fillStyle of the receiver.
selectedFillStyle
Return the selected fillStyle of the receiver.
selectedMouseOverBorderStyle
Return the selected mouse over borderStyle of the receiver.
selectedMouseOverFillStyle
Return the selected mouse over fillStyle of the receiver.
selectedPressedBorderStyle
Return the selected pressed borderStyle of the receiver.
selectedPressedFillStyle
Return the selected pressed fillStyle of the receiver.
shortcutCharacter
Return the Character to be used as a shortcut to turn on this switch, or nil if this switch doesn't have a keyboard shortcut.
shortcutCharacter:
Set the character to be used as a keyboard shortcut for turning on this switch.
showSelectionFeedback
Answer whether the feedback should be shown for being pressed.
showSelectionFeedback:
Set the feedback.
styleWith:
takesKeyboardFocus
Answer whether the receiver can normally take keyboard focus.
themeChanged
Set the border style to thin gray in the case of going to StandardSqueak.
triggerOnMouseDown
triggerOnMouseDown:
If this preference is turned on, then trigger my action immediately when the mouse goes down.
update:
Receive a change notice from an object of whom the receiver is a
dependent. The default behavior is to do nothing; a subclass might want
to change itself in some way.
updateFeedbackForEvt:
veryDeepFixupWith:
If fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared. Warning!! Every instance variable defined in this class must be handled. We must also implement veryDeepFixupWith:. See DeepCopier class comment.
wantsKeyboardFocusNavigation
Answer whether the receiver would like keyboard focus
when navigated to by keyboard.
PluggableCanvas
An abstract canvas which modifies the behavior of an underlying canvas in some way. Subclasses should implement apply:, which takes a one argument block and an actual canvas to draw on. See apply: for the specific definition.
apply:
evaluate aBlock with a canvas to do a drawing command on. See implementors for examples
balloonFillOval:fillStyle:borderWidth:borderColor:
balloonFillRectangle:fillStyle:
clipBy:during:
Set a clipping rectangle active only during the execution of aBlock.
Note: In the future we may want to have more general clip shapes - not just rectangles
clipRect
Return the currently active clipping rectangle
contentsOfArea:into:
Return the contents of the given area
drawPolygon:color:borderWidth:borderColor:
Draw the given polygon.
drawString:from:to:in:font:color:
drawString:from:to:in:font:color:underline:underlineColor:strikethrough:strikethroughColor:
extent
Return the physical extent of the output device
fillOval:color:borderWidth:borderColor:
Fill the given oval.
fillOval:fillStyle:borderWidth:borderColor:
Fill the given oval.
fillRectangle:basicFillStyle:
Fill the given rectangle with the given, non-composite, fill style.
fillRectangle:fillStyle:
Fill the given rectangle. Double-dispatched via the fill style.
flush
flushDisplay
Dummy .
forceToScreen:
dummy
frameAndFillRectangle:fillColor:borderWidth:borderColor:
Draw the rectangle using the given attributes
image:at:sourceRect:rule:
Note: The public use of this protocol is deprecated. It will become private. Nobody in the outside world must assume that a thing like a combination rule has any specific effect.
infiniteFillRectangle:fillStyle:
line:to:brushForm:
Obsolete - will be removed in the future
line:to:width:color:
Draw a line using the given width and color
origin
Return the current origin for drawing operations
paintImage:at:
Draw the given Form, which is assumed to be a Form or ColorForm following the convention that zero is the transparent pixel value.
paintImage:at:sourceRect:
Draw the given Form, which is assumed to be a Form or ColorForm following the convention that zero is the transparent pixel value.
paragraph:bounds:color:
Draw the given paragraph
render:
Do some 3D operations with the object if possible
roundCornersOf:in:during:
shadowColor:
Set a shadow color. If set this color overrides any client-supplied color.
showAt:invalidRects:
stencil:at:sourceRect:color:
Flood this canvas with aColor wherever stencilForm has non-zero pixels
transformBy:clippingTo:during:smoothing:
Transform the receiver by the given display transformation during the execution of aBlock. The given clip rectangle defines the *global* (e.g., outer) rectangle against which the receiver should clip (which would be equivalent to 'self clipRect: aClipRect; transformBy: aDisplayTransform').
translateBy:clippingTo:during:
translateBy:during:
Set a translation only during the execution of aBlock.
PluggableListItemWrapper
luggableListItemWrapper makes it more easy for clients to use hierarchical lists. Rather than having to write a subclass of ListItemWrapper, a PluggableListItemWrapper can be used to provide the appropriate information straight from the model:
string - an explicit string representation (contrary to the 'item' which contains any kind of object)
getStringSelector - a message invoked to retrieve the sting representation of its item dynamically from its model (when a constant representation is undesirable)
hasContentsSelector - a message invoked in the model to answer whether the item has any children or not.
getContentsSelector - a message invoked in the model to retrieve the contents for its item.
All callback selectors can have zero, one or two arguments with the item and the wrapper as first and second argument.
asString
Answer a string that represents the receiver.
contents
getContentsSelector
getContentsSelector:
getStringSelector
getStringSelector:
hasContents
hasContentsSelector
hasContentsSelector:
item
Answer the item. It is useful!
item:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
sendToModel:
string
string:
validateSelector:
PluggableListMorph
...
When a PluggableListMorph is in focus, type in a letter (or several
letters quickly) to go to the next item that begins with that letter.
Special keys (up, down, home, etc.) are also supported.
acceptDroppingMorph:event:
This message is sent when a morph is dropped onto a morph that has
agreed to accept the dropped morph by responding 'true' to the
wantsDroppedMorph:Event: message. The default implementation just
adds the given morph to the receiver.
addCustomMenuItems:hand:
Add halo menu items to be handled by the invoking hand. The halo menu is invoked by clicking on the menu-handle of the receiver's halo.
adoptPaneColor:
Pass on to the border too.
allSubmorphNamesDo:
Assume list morphs do not have named parts -- saves MUCH time
autoDeselect:
Enable/disable autoDeselect (see class comment)
basicKeyPressed:
borderStyleToUse
Answer the borderStyle that should be used for the receiver.
changeModelSelection:
Change the model's selected item index to be anInteger.
commandKeyTypedIntoMenu:
The user typed a command-key into a menu which has me as its command-key handler
copyListToClipboard
Copy my items to the clipboard as a multi-line string
copySelectionToClipboard
Copy my selected item to the clipboard as a string
deriveHScrollRange
disable
Disable the receiver.
doubleClick:
Handle a double-click event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing.
LC 2/14/2000 08:32 - added: EventHandler notification
doubleClick:onItem:
doubleClickSelector:
drawSubmorphsOn:
Display submorphs back to front.
Draw the focus here since we are using inset bounds
for the focus rectangle.
enable
Enable the receiver.
enabled
Answer the enablement state of the receiver.
enabled:
Set the enablement state of the receiver.
extent:
fillStyleToUse
Answer the fillStyle that should be used for the receiver.
focusBounds
Answer the bounds for drawing the focus indication.
font
font:
getCurrentSelectionIndex
Answer the index of the current selection.
getEnabledSelector
Answer the value of getEnabledSelector
getEnabledSelector:
Set the value of getEnabledSelector
getList
Answer the list to be displayed. Caches the returned list in the 'list' ivar
getListDelicately
getListElementSelector:
specify a selector that can be used to obtain a single element in the underlying list
getListItem:
get the index-th item in the displayed list
getListObtrusively
getListSelector
getListSelector:
Set the receiver's getListSelector as indicated, and trigger a recomputation of the list
getListSize
return the current number of items in the displayed list
getListSizeSelector:
specify a selector that can be used to specify the list's size
getMenu:
Answer the menu for this text view, supplying an empty menu to be filled in. If the menu selector takes an extra argument, pass in the current state of the shift key.
hExtraScrollRange
Return the amount of extra blank space to include to the right of the scroll content.
hTotalScrollRange
Return the entire scrolling range.
Avoid using the hScrollRangeCache as it is not always correct.
hUnadjustedScrollRange
Return the entire scrolling range.
handleBasicKeys:
set whether the list morph should handle basic keys like arrow keys, or whether everything should be passed to the model
handleFocusEvent:
Handle the given event. This message is sent if the receiver currently has the focus and is therefore receiving events directly from some hand.
handleMouseMove:
Reimplemented because we really want #mouseMove when a morph is dragged around
handlesBasicKeys
if ya don't want the list to automatically handle non-modifier key
(excluding shift key) input, return false
handlesKeyboard:
Return true if the receiver wishes to handle the given keyboard event
handlesMouseOverDragging:
Yes, for mouse down highlight.
highlightSelection
initForKeystrokes
itemFromPoint:
Return the list element (morph) at the given point or nil if outside
itemSelectedAmongMultiple:
return whether the index-th row is selected. Always false in PluggableListMorph, but sometimes true in PluggableListMorphOfMany
keyStroke:
Process keys
specialKeys are things like up, down, etc. ALWAYS HANDLED
modifierKeys are regular characters either 1) accompanied with ctrl,
cmd or 2) any character if the list doesn't want to handle basic
keys (handlesBasicKeys returns false)
basicKeys are any characters
keyboardFocusChange:
The message is sent to a morph when its keyboard focus changes.
Update for focus feedback.
keystrokeActionSelector:
Set the keystroke action selector as specified
listItemHeight
This should be cleaned up. The list should get spaced by this parameter.
listMorph
listMorphClass
maximumSelection
minimumSelection
modifierKeyPressed:
mouseDown:
Changed to only take focus if wanted.
mouseDown:onItem:
mouseDownRow
Answer the mouse down row or nil if none.
mouseDownRow:
Set the mouse down row or nil if none.
mouseEnter:
Changed to take mouseClickForKeyboardFocus preference into account.
mouseEnterDragging:
The mouse has entered with a button down.
Workaround for apparent flaw in MouseOverHandler constantly
sending this message when dragging.
Do nothing if disabled.
mouseEnterDragging:onItem:
mouseLeave:
Handle a mouseLeave event, meaning the mouse just left my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseLeaveDragging:
The mouse has left with a button down.
mouseLeaveDragging:onItem:
mouseMove:
The mouse has moved with a button down.
Do nothing if disabled.
mouseUp:
The mouse came up within the list; take appropriate action
mouseUp:onItem:
numSelectionsInView
Answer the scroller's height based on the average number of submorphs.
on:list:selected:changeSelected:
on:list:selected:changeSelected:menu:
on:list:selected:changeSelected:menu:keystroke:
optimalExtent
Answer the extent of the list morph.
potentialDropItem
return the item that the most recent drop hovered over, or nil if there is no potential drop target
potentialDropRow
return the row of the item that the most recent drop hovered over, or 0 if there is no potential drop target
removeObsoleteEventHandlers
resetHScrollRange
resetHScrollRangeIfNecessary
resetPotentialDropRow
resizeScrollBars
Fixed to not use deferred message that incorrectly
sets scroll deltas/interval.
rowAtLocation:
Return the row at the given point or 0 if outside
scrollDeltaHeight
Return the increment in pixels which this pane should be scrolled.
scrollDeltaWidth
A guess -- assume that the width of a char is approx 1/2 the height of the font
scrollSelectionIntoView
make sure that the current selection is visible
selectedMorph
this doesn't work with the LargeLists patch! Use #selectionIndex and #selection instead.
selectedMorph:
this shouldn't be used any longer
selection
selection:
Called from outside to request setting a new selection.
selectionColor
Answer the colour to use for selected items.
selectionColor:
Set the colour for selected items.
selectionColorToUse
Answer the colour to use for selected items.
selectionColorToUse:
Set the colour for selected items.
selectionIndex
return the index we have currently selected, or 0 if none
selectionIndex:
Called internally to select the index-th item.
setGetListSelector:
Set the the receiver's getListSelector as indicated. For access via scripting
setListFont
set the font for the list
setSelectedMorph:
specialKeyPressed:
A special key with the given ascii-value was pressed; dispatch it
startDrag:
Handle a double-click event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing.
startDrag:onItem:
superDrawOn:
takesKeyboardFocus
Answer whether the receiver can normally take keyboard focus.
textColor
Answer my default text color.
textColor:
Set my default text color.
textHighlightColor
Answer my default text highlight color.
textHighlightColor:
Set my default text highlight color.
themeChanged
Update the selection colour.
unhighlightSelection
update:
Refer to the comment in View|update:.
updateEnabled
Update the enablement state.
updateList
the list has changed -- update from the model
userString
Do I have a text string to be searched on?
vExtraScrollRange
Return the amount of extra blank space to include below the bottom of the scroll content.
vUnadjustedScrollRange
Return the height extent of the receiver's submorphs.
verifyContents
Verify the contents of the receiver, reconstituting if necessary. Called whenever window is reactivated, to react to possible structural changes. Also called periodically in morphic if the smartUpdating preference is true
wantsDroppedMorph:event:
Return true if the receiver wishes to accept the given morph, which is being dropped by a hand in response to the given event. Note that for a successful drop operation both parties need to agree. The symmetric check is done automatically via aMorph wantsToBeDroppedInto: self.
PluggableListMorphByItem
A PluggableListMorphByItem is xxxxxxxxx.
Instance Variables
itemList: <Object>
itemList
- xxxxx
changeModelSelection:
Change the model's selected item to be the one at the given index.
getCurrentSelectionIndex
Answer the index of the current selection.
getList
cache the raw items in itemList
PluggableListMorphOfMany
A variant of its superclass that allows multiple items to be selected simultaneously. There is still a distinguished element which is selected, but each other element in the list may be flagged on or off.
itemSelectedAmongMultiple:
return whether the index-th row is selected. Always false in PluggableListMorph, but sometimes true in PluggableListMorphOfMany
listSelectionAt:
listSelectionAt:put:
mouseDown:
Grab keyboard focus and set mouseDownRow.
mouseMove:
The mouse has moved, as characterized by the event provided. Adjust the scrollbar, and alter the selection as appropriate
mouseUp:
Reset the mouseDownRow.
on:list:primarySelection:changePrimarySelection:listSelection:changeListSelection:menu:
on:list:primarySelection:changePrimarySelection:listSelection:changeListSelection:menu:keystroke:
setup a whole load of pluggability options
update:
Refer to the comment in View|update:.
PluggableMessageCategoryListMorph
A variant of PluggableListMorph designed specially for efficient handling of the --all-- feature in message-list panes. In order to be able *quickly* to check whether there has been an external change to the list, we cache the raw list for identity comparison (the actual list is a combination of the --all-- element and the the actual list).
getList
Differs from the generic in that here we obtain and cache the raw list, then cons it together with the special '-- all --' item to produce the list to be used in the browser. This special handling is done in order to avoid excessive and unnecessary reformulation of the list in the step method
on:list:selected:changeSelected:menu:keystroke:getRawListSelector:
verifyContents
Verify the contents of the receiver, reconstituting if necessary. Called whenever window is reactivated, to react to possible structural changes. Also called periodically in morphic if the smartUpdating preference is true
PluggableMultiColumnListMorph
This morph can be used to show a list having multiple columns, The columns are self width sized to make the largest entry in each list fit. In some cases the pane may then be too narrow.
Use it like a regular PluggableListMorph except pass in an array of lists instead of a single list.
There are base assumptions made here that each list in the array of lists is the same size.
Also, the highlight color for the selection is easy to modify in the #highlightSelection method. I used blue
when testing just to see it work.
basicKeyPressed:
net supported for multi-column lists; which column should be used?! The issue is that the base class implementation uses getList expecting a single collectino to come back instead of several of them
calculateColumnOffsetsFrom:
calculateColumnWidthsFrom:
createMorphicListsFrom:
getList
fetch and answer the lists to be displayed
getListRow:
return the strings that should appear in the requested row
getListSize
return the current number of items in the displayed list
highlightSelection
itemFromPoint:
Return the list element (morph) at the given point or nil if outside
layoutMorphicLists:
listMorphClass
unhighlightSelection
PluggableMultiColumnListMorphByItem
A PluggableMultiColumnListMorphByItem is xxxxxxxxx.
Instance Variables
changeModelSelection:
Change the model's selected item to be the one at the given index.
getCurrentSelectionIndex
Answer the index of the current selection.
PluggableTabBarMorph
This morph manages a set of PluggableTabButtonMorphs. Each tab should be added in the left to right order that they should be displayed. Each tab will be evenly sized to fit the available space. This morph intercepts mouse clicks, figures out which tab was clicked, pops up the new tab as the active tab and triggers the registered event. See PluggableTabButtonMorph for information on what a tab can consist of.
Example:
(PluggableTabBarMorph on: nil)
addTab: (Text fromString: 'Test') withAction: [Transcript show: 'Test'; cr];
addTab: (Text fromString: 'Another') withAction: [Transcript show: 'Another'; cr];
width: 200;
openInHand
activeTab
activeTab:
addTab:withAction:
Add a new tab. The tab will be added onto the end of the list and displayed on the far right of previously added tabs. The first argument can be a simple String, a Text, or any Morph. The second argument is the action to be performed when the tab is selected. It can either be a symbol for a unary method on the target object or a block. Each tab is stored as an Association with the created tab as the key and the selector as the value.
color:
Set the receiver's color. Directly set the color if appropriate, else go by way of fillStyle
drawOn:
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
layoutChanged
Fix up our tabs bounds
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
on:
performActiveTabAction
Look up the Symbol or Block associated with the currently active tab, and perform it.
tabs
target
target:
Morphs with targets will override. This backstop does nothing.
PluggableTabButtonMorph
This is a specialized pluggable button morph that is meant to represent a tab in a set of tabs arranged horizontally. Each tab will overlap slightly when drawn. All but one tab will be drawn in left to right order in the specified color, but lighter. The active tab will be drawn last in the full color and slightly taller to indicate that it is selected. Clicking the active tab has no effect but clicking any other tab will change the active tab to the clicked tab.
This morph does not itself accept any events. The parent tab set will grab the mouse clicks and handle notifying the appropriate tabs that they have been activated or deactivated.
There is a single selector which provides the text for the button label and affects the width of the tab. When the width changes the tab will inform its parent that it has changed and that the layout needs to be updated. The model for the text selector of course should be the client for the tab set.
The button label can be a String, Text, or Morph. Texts work better than plain Strings.
active
active:
arcLengths
arcLengths:
calculateArcLengths
cornerRadius
drawOn:
drawSubMorphOn:
drawTabOn:
innerExtent:
Set the extent based on the primary visible part of the tab. In other words add twice the cornerRadius to this extent
model
model:
on:label:
outerGap
The horizontal distance of the outer left and right edges of the tab excluding the inner visible part
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
subMorph
subMorph:
textSelector
textSelector:
toggle
topInactiveGap
update:
Receive a change notice from an object of whom the receiver is a
dependent. The default behavior is to do nothing; a subclass might want
to change itself in some way.
wantsSteps
Return true if the receiver overrides the default Morph step method.
PluggableTextMorph
A PluggableTextMorph is xxxxxxxxx.
Instance Variables
askBeforeDiscardingEdits: <Object>
getSelectionSelector: <Object>
getTextSelector: <Object>
hasEditingConflicts: <Object>
hasUnacceptedEdits: <Object>
selectionInterval: <Object>
setTextSelector: <Object>
textMorph: <Object>
askBeforeDiscardingEdits
- xxxxx
getSelectionSelector
- xxxxx
getTextSelector
- xxxxx
hasEditingConflicts
- xxxxx
hasUnacceptedEdits
- xxxxx
selectionInterval
- xxxxx
setTextSelector
- xxxxx
textMorph
- xxxxx
accept
Inform the model of text to be accepted, and return true if OK.
acceptDroppingMorph:event:
This message is sent when a morph is dropped onto a morph that has
agreed to accept the dropped morph by responding 'true' to the
wantsDroppedMorph:Event: message. The default implementation just
adds the given morph to the receiver.
acceptOnCR:
acceptTextInModel
Inform the model that the receiver's textMorph's text should be accepted.
Answer true if the model accepted ok, false otherwise
adoptPaneColor:
Pass on to the border too.
again
appendEntry
Append the text in the model's writeStream to the editable text.
appendText:
Append the given text to the receiver.
appendTextEtoy:
Append the text in the model's writeStream to the editable text.
askBeforeDiscardingEdits:
Set the flag that determines whether the user should be asked before discarding unaccepted edits.
browseChangeSetsWithSelector
Help the user track down which change sets mention a particular selector
browseIt
bsText
canDiscardEdits
Return true if this view either has no text changes or does not care.
cancel
changeStyle
changeText:
The paragraph to be edited is changed to aText.
chooseAlignment
classCommentsContainingIt
classNamesContainingIt
copySelection
correctFrom:to:with:
correctSelectionWithString:
I can't tell if this is a hack or if it's the right thing to do.
cut
debugIt
deselect
doIt
drawOn:
Indicate unaccepted edits, conflicts etc.
drawSubmorphsOn:
Display submorphs back to front.
Draw the focus here since the drawOn: method is so horrible.
eToyGetMainFont
editString:
Jam some text in. This is treated as clean text by default.
exploreIt
extent:
The inner bounds may have changed due to scrollbar visibility.
extraScrollRange
Return the amount of extra blank space to include below the bottom of the scroll content.
fileItIn
find
findAgain
focusBounds
Answer the bounds for drawing the focus indication
(when externalFocusForPluggableText is enabled).
font:
getSelection
Answer the model's selection interval.
getText
Retrieve the current model text
getTextSelector
hUnadjustedScrollRange
Return the width of the widest item in the list
handleEdit:
handlesKeyboard:
Return true if the receiver wishes to handle the given keyboard event
hasEditingConflicts
Return true if a conflicting edit to the same code (typically) is known to have occurred after the current contents started getting edited
hasEditingConflicts:
hasKeyboardFocus
Answer whether the receiver has keyboard focus.
hasUnacceptedEdits
Return true if this view has unaccepted edits.
hasUnacceptedEdits:
Set the hasUnacceptedEdits flag to the given value.
implementorsOfIt
initialize
initialize the state of the receiver
inspectIt
keyStroke:
A keystroke was hit while the receiver had keyboard focus. Pass the keywtroke on to my textMorph, and and also, if I have an event handler, pass it on to that handler
keyboardFocusChange:
Pass on to text morph.
layoutBounds:
Set the bounds for laying out children of the receiver.
Note: written so that #layoutBounds can be changed without touching this method
methodNamesContainingIt
methodSourceContainingIt
methodStringsContainingit
minHeight
Implemented here since extent: overriden.
minWidth
Implemented here since extent: overriden.
mouseEnter:
Changed to take mouseClickForKeyboardFocus preference into account.
mouseLeave:
The mouse has left the area of the receiver
navigationKey:
Check for tab key activity and change focus as appropriate.
Must override here rather than in #tabKey: otherwise
the tab will get passed to the window and change the focus.
nextTokenFrom:direction:
notify:at:in:
offerFontMenu
on:text:accept:
on:text:accept:readSelection:menu:
onKeyStrokeSend:to:
paste
pasteRecent
Paste an item chosen from RecentClippings.
prettyPrint
printIt
printerSetup
promptForCancel
Ask if it is OK to cancel changes to text
referencesToIt
replaceSelectionWith:
resetExtent
Reset the extent while maintaining the current selection. Needed when resizing while the editor is active (when inside the pane).
scrollBarMenuButtonPressed:
The menu button in the scrollbar was pressed; put up the menu
scrollDeltaHeight
Return the increment in pixels which this pane should be scrolled.
scrollSelectionIntoView
Scroll my text into view if necessary and return true, else return false
scrollSelectionIntoView:
Scroll my text into view if necessary and return true, else return false
select
selectAll
Tell my textMorph's editor to select all
selectFrom:to:
selectInvisiblyFrom:to:
selectionInterval
selectionInterval:
sendersOfIt
setSearchString
setSelection:
setText:
setTextColor:
Set the color of my text to the given color
setTextMorphToSelectAllOnMouseEnter
Tell my textMorph's editor to select all when the mouse enters
showBytecodes
takesKeyboardFocus
Answer whether the receiver can normally take keyboard focus.
tallyIt
text
textMorph
textMorphClass
Answer the class used to create the receiver's textMorph
toggleAnnotationPaneSize
undo
update:
Receive a change notice from an object of whom the receiver is a
dependent. The default behavior is to do nothing; a subclass might want
to change itself in some way.
wantsDroppedMorph:event:
Return true if the receiver wishes to accept the given morph, which is being dropped by a hand in response to the given event. Note that for a successful drop operation both parties need to agree. The symmetric check is done automatically via aMorph wantsToBeDroppedInto: self.
wantsFrameAdornments
Answer whether the receiver wishes to have red borders, etc.,
used to show editing state
wantsFrameAdornments:
wantsKeyboardFocus
Answer whether the receiver would like keyboard focus
in the general case (mouse action normally). Even if disabled
we allow for text morphs since can potentially copy text.
watchIt
wrapFlag:
yellowButtonActivity
Called when the shifted-menu's 'more' item is chosen
yellowButtonActivity:
Called when the shifted-menu's 'more' item is chosen
PluggableTextMorphWithModel
A PluggableTextMorphWithModel is xxxxxxxxx.
Instance Variables
myContents: <Object>
myContents
- xxxxx
authoringPrototype
delete
Delete the receiver. Since I have myself as a dependent, I need to remove it. which is odd in itself. Also, the release of dependents will seemingly not be done if the *container* of the receiver is deleted rather than the receiver itself, a further problem
getMyText
initialize
initialize the state of the receiver
setMyText:
PolygonMorph
This class implements a morph which can behave as four different objects depending on the the following two facts:
- is it OPEN or CLOSED?
- is it SEGMENTED or SMOOTHED.
1. The OPEN and SEGMENTED variant looks like polyline.
2. The OPEN and SMOOTHED variant looks like spline (kind of curve)
3. The CLOSED and SEGMENTED variant looks like polygon. This is actually what you get when you do
PolygonMorph new openInWorld
You get a triangle. See below how to manipulate these objects...
4. The CLOSED and SMOOTHED variant looks like blob (???)
Prototypes of this morph can also be found in "Object Catalog". Several (different variants) of this object are among "Basic" morphs.
Explore the assiciated morph-menu. It enables you
- to toggle showing of "handles". They make it possible to
- reposition already existing vertices (by moving yellow handles)
- create new vertices (by moving green handles)
- delete already existing vertices (by dragging and dropping one yellow handle closely
nearby the adjacent yellow handle
Handles can be made visible/hidden by shift+leftclicking the morph. This way it is possible
to quickly show handles, adjust vertices and then again hide handles.
- making closed polygon open, i.e. converting it to a curve (and vice versa)
- toggle smoothed/segmented line/outline
- set up custom dashing (for line, curves or borders of closed polygons
- set up custom arrow-heads (for lines resp. curves)
------------------------------------------------------------------------------------------
Implementation notes:
This class combines the old Polygon and Curve classes.
The 1-bit fillForm to make display and containment tests reasonably fast. However, this functionality is in the process of being supplanted by balloon capabilities, which should eventually provide anti-aliasing as well.
wiz 7/18/2004 21:26
s have made some changes to this class to
1) correct some bugs associated with one vertex polygons.
2) prepare for some enhancements with new curves.
3) add shaping items to menu.
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addFlexShellIfNecessary
When scaling or rotating from a halo, I can do this without a flex shell
addHandles
Put moving handles at the vertices. Put adding handles at
edge midpoints.
Moving over adjacent vertex and dropping will delete a
vertex.
addPolyArrowMenuItems:hand:
addPolyLIneCurveMenuItems:hand:
addPolyShapingMenuItems:hand:
areasRemainingToFill:
Could be improved by quick check of inner rectangle
arrowBoundsAt:from:
Answer a triangle oriented along the line from priorPoint to endPoint.
arrowForms
ArrowForms are computed only upon demand
arrowLength:
Assumes that I have exactly two vertices
arrowPrototype
arrowSpec:
Specify a custom arrow for this line.
specPt x abs gives the length of the arrow (point to base) in terms of borderWidth.
If specPt x is negative, then the base of the arrow will be concave.
specPt y abs gives the width of the arrow.
The standard arrow is equivalent to arrowSpec: 5@4.
See arrowBoundsAt:From: for details.
arrows
arrowsContainPoint:
Answer an Array of two Booleans that indicate whether the given point is inside either arrow
beSmoothCurve
beStraightSegments
borderColor:
Unfortunately, the argument to borderColor could be more than just a color.
It could also be a symbol, in which case it is to be interpreted as a style identifier.
But I might not be able to draw that kind of border, so it may have to be ignored.
Or it could be nil, in which case I should revert to the default border.
borderDashOffset
borderForm
A form must be created for drawing the border whenever the borderColor is translucent.
borderWidth:
bounds:
This method has to be reimplemented since self extent: will also change self bounds origin,
super bounds would leave me in wrong position when container is growing.
Always change extent first then position
boundsSignatureHash
canHaveFillStyles
Return true if the receiver can have general fill styles; not just colors.
This method is for gradually converting old morphs.
clickVertex:event:fromHandle:
Backstop for MixedCurveMorph
closestPointTo:
account for round corners. Still has a couple of glitches at upper left and right corners
closestSegmentTo:
Answer the starting index of my (big) segment nearest to aPoint
coefficients
Compute an array for the coefficients.
computeArrowFormAt:from:
Compute a triangle oriented along the line from priorPoint to
endPoint. Then draw those lines in a form and return that
form, with appropriate offset
computeBounds
computeNextToEndPoints
containsPoint:
cornerStyle:
Set the receiver's corner style. But, in this case, do *not*
couldHaveRoundedCorners
curveBounds
Compute the bounds from actual curve traversal, with
leeway for borderWidth.
Also note the next-to-first and next-to-last points for arrow
directions.
customizeArrows:
dashedBorder
dashedBorder:
A dash spec is a 3- or 5-element array with
{ length of normal border color.
length of alternate border color.
alternate border color.
starting offset.
amount to add to offset at each step }
Starting offset is usually = 0, but changing it moves the dashes along the curve.
defaultAttachmentPointSpecs
defaultBorderColor
answer the default border color/fill style for the receiver
defaultColor
answer the default color/fill style for the receiver
deleteVertexAt:
This acts as a backstop for MixedCurveMorph.
derivs:first:second:third:
Compute the first, second and third derivitives (in coeffs) from
the Points in this Path (coeffs at: 1 and coeffs at: 5).
diamondOval
Set my vertices to an array of edge midpoint vertices.
Order of vertices is in the tradion of warpblt quads.
dragVertex:event:fromHandle:
dragVertex:fromHandle:vertIndex:
Reorder the arguments for existing event handlers
drawArrowOn:at:from:
Draw a triangle oriented along the line from priorPoint to
endPoint. Answer the wingBase.
drawArrowsOn:
Answer (possibly modified) endpoints for border drawing
drawBorderOn:
drawBorderOn:usingEnds:
Display my border on the canvas.
drawClippedBorderOn:usingEnds:
drawDashedBorderOn:
drawDashedBorderOn:usingEnds:
Display my border on the canvas. NOTE: mostly copied from
drawBorderOn:
drawOn:
Display the receiver, a spline curve, approximated by straight
line segments.
drawOnFormCanvas:
Display the receiver, a spline curve, approximated by straight line segments.
dropVertex:event:fromHandle:
Leave vertex in new position. If dropped ontop another vertex delete this one.
Check for too few vertices before deleting. The alternative
is not pretty -wiz
dropVertex:fromHandle:vertIndex:
Reorder the arguments for existing event handlers
endShapeColor:
endShapeWidth:
extent:
Not really advisable, but we can preserve most of the geometry if we don't
shrink things too small.
fillStyle
Return the current fillStyle of the receiver.
fillStyle:
Set the current fillStyle of the receiver.
Optimized for no change.
filledForm
Note: The filled form is actually 2 pixels bigger than bounds, and the point corresponding to this morphs' position is at 1@1 in the form. This is due to the details of the fillig routines, at least one of which requires an extra 1-pixel margin around the outside. Computation of the filled form is done only on demand.
firstVertex
flipHAroundX:
Flip me horizontally around the center. If centerX is nil, compute my center of gravity.
flipVAroundY:
Flip me vertically around the center. If centerY is nil, compute my center of gravity.
fromHand:
fromHandFreehand:
getVertices
handleColorAt:
This is a backstop for MixedCurveMorph
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesShowingPhrase
hasArrows
Are all the conditions meet for having arrows?
heading:
Set the receiver's heading (in eToy terms).
Note that polygons never use flex shells.
includesHandle:
initialize
initialize the state of the receiver
insertVertexAt:put:
This serves as a hook and a backstop for MixedCurveMorph.
intersectionWithLineSegmentFromCenterTo:
account for round corners. Still has a couple of glitches at upper left and right corners
intersectionsWith:
Answer a Set of points where the given Rectangle intersects with me.
Ignores arrowForms.
intersects:
Answer whether any of my segments intersects aRectangle, which is in World coordinates.
isBordered
isClosed
isCurve
isCurvier
Test used by smoothing routines. If true use true closed curve splines for closed curves. If not mimic old stodgy curveMorph curves with one sharp bend.. Override this routine in classes where backward compatability is still needed.
isCurvy
Test for significant curves.
Small smoothcurves in practice are straight.
isLineMorph
isOpen
justDroppedInto:event:
This message is sent to a dropped morph after it has been dropped on -- and been accepted by -- a drop-sensitive morph
lastVertex
lineBorderColor
lineBorderColor:
lineBorderWidth
lineBorderWidth:
lineColor
lineColor:
lineSegments
lineSegmentsDo:
Emit a sequence of segment endpoints into endPointsBlock.
lineWidth
lineWidth:
loadCachedState
Prepare for fast response -- next page of a book?
makeBackArrow
makeBothArrows
makeClosed
makeForwardArrow
makeNoArrows
makeOpen
makeOpenOrClosed
toggle the open/closed status of the receiver
merge:
Expand myself to enclose the other polygon. (Later merge overlapping or disjoint in a smart way.) For now, the two polygons must share at least two vertices. Shared vertices must come one after the other in each polygon. Polygons must not overlap.
mergeDropThird:in:from:
We are merging two polygons. In this case, they have at least three identical shared vertices. Make sure they are sequential in each, and drop the middle one from vertex lists mv, hv, and shared. First vertices on lists are identical already.
midVertices
Return and array of midpoints for this line or closed curve
midpoint
Answer the midpoint along my segments
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
newVertex:event:fromHandle:
Insert a new vertex and fix everything up! Install the drag-handle of the new vertex as recipient of further mouse events.
newVertex:fromHandle:afterVert:
Reorder the arguments for existing event handlers
nextDuplicateVertexIndex
nextToFirstPoint
For arrow direction
nextToLastPoint
For arrow direction
nudgeForLabel:
Try to move the label off me. Prefer labels on the top and right.
openOrClosePhrase
privateMoveBy:
Private! Use 'position:' instead.
quickFill:
rectOval
Set my vertices to an array of corner vertices.
Order of vertices is in the tradion of warpblt quads.
reduceVertices
Reduces the vertices size, when 3 vertices are on the same line with a
little epsilon. Based on code by Steffen Mueller
referencePosition
Return the current reference position of the receiver
releaseCachedState
Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.
removeHandles
tk 9/2/97 allow it to be called twice (when nil already)
removeVertex:
Make sure that I am not left with less than two vertices
rotateTestFlip:
Return one copy of me for each vertex using each vertex as
the
starting point.
Vary to border color to destinguish the copies.
This tests closed curves for their consistency.
The flip boolean tests the reversed rotations.
rotationCenter
Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationCenter:
Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position.
rotationDegrees
Default implementation.
rotationDegrees:
scale:
Backstop for morphs that don't have to do something special to set their scale
setRotationCenterFrom:
Polygons store their referencePosition.
setVertices:
shapeFromPen:color:borderWidth:borderColor:
showOrHideHandles
showingHandles
slopes:
Choose slopes according to state of polygon and preferences
smoothOrSegmentedPhrase
specifyDashedLine
standardArrows
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
straightLineSegmentsDo:
Emit a sequence of segment endpoints into endPointsBlock.
Work the same way regardless of whether I'm curved.
straighten
toggleHandles
toggleSmoothing
totalLength
Answer the full length of my segments. Can take a long time if I'm curved.
transformVerticesFrom:to:
transformedBy:
unrotatedLength
If the receiver bears rotation without a transformation morph, answer what its length in the direction it is headed is
unrotatedLength:
If the receiver bears rotation without a transformation morph, answer what its length in the direction it is headed is
unrotatedWidth
If the receiver bears rotation without a transformation morph, answer what its length in the direction it is headed is
unrotatedWidth:
If the receiver bears rotation without a transformation morph, answer what its length in the direction it is headed is
updateHandles
vertexAt:
vertices
vertices:color:borderWidth:borderColor:
verticesAt:put:
wantsSteps
Return true if the receiver overrides the default Morph step method.
PopUpChoiceMorph
A PopUpChoiceMorph is xxxxxxxxx.
Instance Variables
actionSelector: <Object>
arguments: <Object>
choiceArgs: <Object>
getItemsArgs: <Object>
getItemsSelector: <Object>
target: <Object>
actionSelector
- xxxxx
arguments
- xxxxx
choiceArgs
- xxxxx
getItemsArgs
- xxxxx
getItemsSelector
- xxxxx
target
- xxxxx
actionSelector
actionSelector:
arguments
arguments:
getItemsArgs
getItemsArgs:
getItemsSelector
getItemsSelector:
handlesMouseDown:
If the shift key is pressed then yes.
As normal if the editableStringMorphs preference is false.
initialize
initialize the state of the receiver
mouseDown:
If the shift key is pressed, make this string the keyboard input focus.
Process as normal if the editableStringMorphs preference is false.
target
target:
Morphs with targets will override. This backstop does nothing.
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared. Warning!! Every instance variable defined in this class must be handled. We must also implement veryDeepFixupWith:. See DeepCopier class comment.
PreDebugWindow
A PreDebugWindow is xxxxxxxxx.
Instance Variables
debugButton: <Object>
proceedButton: <Object>
debugButton
- xxxxx
proceedButton
- xxxxx
adjustBookControls
createMethod
debug
extent:
Set the receiver's extent to value provided. Respect my minimumExtent.
includeInNewMorphMenu
initialize
Initialize a system window. Add label, stripes, etc., if desired
proceed
setBalloonTextForCloseBox
setLabelWidgetAllowance
Set the extra space required, in general, apart from the label.
Should make theme based (for centered titles), leave enough room
for the moment.
storeLog
ProgressBarMorph
A ProgressBarMorph is xxxxxxxxx.
Instance Variables
lastValue: <Object>
progressColor: <Object>
value: <Object>
lastValue
- xxxxx
progressColor
- xxxxx
value
- xxxxx
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
changeProgressColor:
changeProgressValue:
drawOn:
initialize
initialize the state of the receiver
progressColor
progressColor:
update:
Receive a change notice from an object of whom the receiver is a
dependent. The default behavior is to do nothing; a subclass might want
to change itself in some way.
value
value:
ProgressMorph
A ProgressMorph is xxxxxxxxx.
Instance Variables
labelMorph: <Object>
progress: <Object>
subLabelMorph: <Object>
labelMorph
- xxxxx
progress
- xxxxx
subLabelMorph
- xxxxx
done
done:
example
fontOfPointSize:
incrDone:
initLabelMorph
initProgressMorph
initSubLabelMorph
initialize
initialize the state of the receiver
label
label:
labelMorph
progress
setupMorphs
subLabel
subLabel:
subLabelMorph
ProjectViewMorph
I am a Morphic view of a project. I display a scaled version of the project's thumbnail, which itself is a scaled-down snapshot of the screen taken when the project was last exited. When I am displayed, I check to see if the project thumbnail has changed and, if so, I update my own view of that thumbnail.
acceptDroppingMorph:event:
This message is sent when a morph is dropped onto a morph that has agreed to accept the dropped morph by responding 'true' to the wantsDroppedMorph:Event: message. This default implementation just adds the given morph to the receiver.
addProjectNameMorph
addProjectNameMorphFiller
borderWidthForRounding
colorAroundName
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
drawOn:
Draw the border after the image.
editTheName:
ensureImageReady
enter
Enter my project.
enterWhenNotPresent
extent:
Set my image form to the given extent.
fontForName
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesMouseOver:
Do I want to receive mouseEnter: and mouseLeave: when the button is up and the hand is empty? The default response is false, except if you have added sensitivity to mouseEnter: or mouseLeave:, using the on:send:to: mechanism.
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
initialize
initialize the state of the receiver
isEditingName
isTheRealProjectPresent
lastProjectThumbnail:
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseEnter:
Handle a mouseEnter event, meaning the mouse just entered my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseLeave:
Handle a mouseLeave event, meaning the mouse just left my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseLeaveDragging:
Handle a mouseLeaveLaden event, meaning the mouse just left my bounds with a button pressed or laden with submorphs. The default response is to let my eventHandler, if any, handle it; else to do nothing.
newMorphicProject
newMorphicProjectOn:
newProjectViewInAWindowFor:
objectForDataStream:
I am being written out on an object file
on:
project
project:
releaseCachedState
see if we can reduce size of published file, but there may be problems
safeProjectName
safeProjectName:
services
showBorderAs:
image border: image boundingBox width: 1 fillColor: aColor.
currentBorderColor := aColor.
self changed
showMouseState:
storeSegment
Store my project out on the disk as an ImageSegment. Keep the outPointers in memory. Name it <project name>.seg
thumbnail
unload
updateImageFrom:
updateNamePosition
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared. See DeepCopier class comment.
wantsDroppedMorph:event:
Return true if the receiver wishes to accept the given morph, which is being dropped by a hand in response to the given event. Note that for a successful drop operation both parties need to agree. The symmetric check is done automatically via aMorph wantsToBeDroppedInto: self.
wantsKeyboardFocusFor:
Answer whether a plain mouse click on aSubmorph, a text-edit-capable thing, should result in a text selection there
wantsRoundedCorners
Return true if the receiver wants its corners rounded
ProportionalLayout
I represent a layout that places all children of some morph in their given LayoutFrame.
isProportionalLayout
layout:in:
Compute the layout for the given morph based on the new bounds
minExtentOf:in:
Return the minimal size aMorph's children would require given the new bounds
ProportionalSplitterMorph
I am the morph the user grabs to adjust pane splitters.
addLeftOrTop:
addRightOrBottom:
adoptPaneColor:
Change our color too.
beSplitsTopAndBottom
bottomBoundary
Answer the bottom boundary position by calculating the minimum
of the minimum heights of the bottom morphs.
drawOn:
fastSplitterResize
getOldColor
handleRect
handleSize
hasLeftOrTop:
Answer whether the reciver has the given morph
as one of of its left or top morphs.
hasRightOrBottom:
Answer whether the reciver has the given morph
as one of of its right or bottom morphs.
hideLeftOrTop
Hide the receiver and all left or top morphs.
hideRightOrBottom
Hide the receiver and all right or bottom morphs.
initialize
initialize the state of the receiver
isCursorOverHandle
leftBoundary
Answer the left boundary position by calculating the minimum
of the minimum widths of the left morphs.
mouseDown:
A mouse button has been pressed.
Update the color for feedback and store the mouse
position and relative offset to the receiver.
mouseMove:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseUp:
Change the cursor back to normal if necessary and change the color back to normal.
normalFillStyle
Return the normal fillStyle of the receiver.
normalizedX:
normalizedY:
noteNewOwner:
Update the fill style.
overlapsHorizontal:
Answer whether the receiver overlaps the given spiltter
in the horizontal plane.
overlapsVertical:
Answer whether the receiver overlaps the given spiltter
in the vertical plane.
pressedFillStyle
Return the pressed fillStyle of the receiver.
resizeCursor
rightBoundary
Answer the right boundary position by calculating the minimum
of the minimum widths of the right morphs.
setGrabbedColor
Set the color of the receiver when it is grabbed.
shouldDraw
Answer whether the resizer should be drawn.
shouldInvalidateOnMouseTransition
Answer whether the resizer should be invalidated
when the mouse enters or leaves.
showLeftOrTop
Show the receiver and all left or top morphs.
showRightOrBottom
Show the receiver and all right or bottom morphs.
showSplitterHandles
siblingSplitters
splitsTopAndBottom
splitterAbove
Answer the splitter above the receiver that overlaps in its horizontal range.
splitterBelow
Answer the splitter below the receiver that overlaps in its horizontal range.
splitterLeft
Answer the splitter to the left of the receiver that overlaps in its vertical range.
splitterRight
Answer the splitter to the right of the receiver that overlaps in its vertical range.
splitterWidth
topBoundary
Answer the top boundary position by calculating the minimum
of the minimum heights of the top morphs.
updateFromEvent:
Update the splitter and attached morph positions from the mouse event.
Take into account the mouse down offset.
wantsEveryMouseMove
Unless overridden, this method allows processing to skip mouse move events
when processing is lagging. No 'significant' event (down/up, etc) will be skipped.
RaisedBorder
see BorderedMorph
bottomRightColor
Changed from direct access to color since, if nil,
self color is transparent.
colorsAtCorners
style
topLeftColor
Changed from direct access to color since, if nil,
self color is transparent.
trackColorFrom:
If necessary, update our color to reflect a change in aMorphs color
RectangleMorph
A subclass of BorderedMorph that supports different fillStyles.
RectangleMorph diagonalPrototype openInWorld.
RectangleMorph gradientPrototype openInWorld.
canHaveFillStyles
Return true if the receiver can have general fill styles; not just colors.
This method is for gradually converting old morphs.
defaultColor
answer the default color/fill style for the receiver
diagonalPrototype
gradientPrototype
roundRectPrototype
wantsToBeCachedByHand
Return true if the receiver wants to be cached by the hand when it is dragged around.
ReferenceMorph
Serves as a reference to any arbitrary morph; used, for example, as the tab in a tabbed palette The wrapper intercepts mouse events and fields them, passing them on to their referent morph.
addCustomMenuItems:hand:
Add morph-specific items to the menu for the hand
allNonSubmorphMorphs
we hold extra morphs
borderWidth:
Set the receiver's border width as indicated, and trigger a fresh layout
changeTabGraphic
changeTabText
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
doButtonAction
If the receiver has a button-action defined, do it now. The default button action of any morph is, well, to do nothing. Note that there are several ways -- too many ways -- for morphs to have button-like actions. This one refers not to the #mouseUpCodeToRun feature, nor does it refer to the Player-scripting mechanism. Instead it is intended for morph classes whose very nature is to be buttons -- this method provides glue so that arbitrary buttons on the UI can be 'fired' programatticaly from user scripts
existingWording
fitContents
forMorph:
forMorph:font:
graphicalMorphForTab
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
highlight
The receiver is being asked to appear in a highlighted state. Mostly used for textual morphs
initialize
initialize the state of the receiver
isCurrentlyGraphical
Answer whether the receiver is currently showing a graphical face
isCurrentlyTextual
isHighlighted
layoutChanged
Fixed to always flush layout cache - finally tracked down
layout anomalies due to cached extents in layout
policies not being flushed, the previous (incorrect) assumption being
that it did not matter if layout was to be recomputed (fullBounds being nil).
Recomputing of the layout apparently does not flush so must be done here.
morphToInstall
morphToInstall:
Create a new tab consisting of a string holding the morph's name
morphToInstall:font:
Create a new tab consisting of a string holding the morph's name
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseMove:
The mouse moved while the butten was down in the receiver
mouseUp:
The mouse came up in the receiver; If the mouse is still within the receiver at this point, do the corresponding action
preserveDetails
The receiver is being switched to use a different format. Preserve the existing details (e.g. wording if textual, grapheme if graphical) so that if the user reverts back to the current format, the details will be right
referent
referent:
setLabelFontTo:
Change the receiver's label font to be as indicated
setNameTo:
tabSelected
Called when the receiver is hit
unHighlight
useGraphicalTab
useTextualTab
Use a textually-emblazoned tab
RolloverButtonMorph
A RolloverButtonMorph is xxxxxxxxx.
Instance Variables
handlesMouseOver:
Do I want to receive mouseEnter: and mouseLeave: when the button is up and the hand is empty? The default response is false, except if you have added sensitivity to mouseEnter: or mouseLeave:, using the on:send:to: mechanism.
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
mouseEnter:
0.09375 is exact in floating point so no cumulative rounding error will occur
mouseLeave:
0.09375 is exact in floating point so no cumulative rounding error will occur
mouseLeaveDragging:
Handle a mouseLeaveLaden event, meaning the mouse just left my bounds with a button pressed or laden with submorphs. The default response is to let my eventHandler, if any, handle it; else to do nothing.
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
ScrollBar
Inspired by an oiginal design of Hans-Martin Mosner, this ScrollBar is intended to exercise the handling of input events in Morphic. With sufficient flexibility in this area, all particular behavior can be concentrated in this single class with no need to specialize any other morphs to achieve button, slider and menu-button behavior.
Once we have this working, put in logic for horizontal operation as well.
CachedImages was added to reduce the number of forms created and thrown away. This will be helpful for Nebraska and others as well.
adoptGradientColor:
Adopt the given pane color.
adoptPaneColor:
Adopt the given pane color
alwaysShowFlatScrollbarForAlternativeLook
animateValue:
arrowOfDirection:size:color:
arrowSamples
basicCreateArrowOfDirection:size:color:
boxOfSize:color:
boxSamples
buttonExtent
changesInPreferences
createArrowImagesCache
createArrowOfDirection:in:
createArrowOfDirection:size:color:
createBoxImagesCache
createBoxIn:
createBoxOfSize:color:
doScrollByPage
Scroll automatically while mouse is down
doScrollDown
Scroll automatically while mouse is down
doScrollUp
Scroll automatically while mouse is down
downImage
answer a form to be used in the down button
expandSlider
Compute the new size of the slider (use the old sliderThickness as a minimum).
extent:
finishedScrolling
Scrolling has finished (button or paging area).
finishedScrolling:
Scrolling has finished for a button.
imageColorFor:
initialize
initialize the state of the receiver
initializeDownButton
initialize the receiver's downButton
initializeEmbedded:
aBool == true => inboard scrollbar
aBool == false => flop-out scrollbar
initializeImagesCache
initializeMenuButton
initialize the receiver's menuButton
initializePagingArea
Initialize the receiver's pagingArea.
initializeSlider
Initialize the receiver's slider.
initializeUpButton
initialize the receiver's upButton
interval:
Supply an optional floating fraction so slider can expand to indicate range.
Update the fill style for the tumb (may have extent-based elements).
menuButtonMouseDown:
The menu button has been clicked.
menuButtonMouseEnter:
The mouse has entered the menu button.
menuButtonMouseLeave:
The mouse has left the menu button.
menuImage
answer a form to be used in the menu button
mouseDownInSlider:
The mouse has been pressed in the slider area.
mouseEnterDownButton:
The mouse has entered the down button.
mouseEnterPagingArea:
The mouse has entered the paging area.
mouseEnterThumb:
The mouse has entered the thumb.
mouseEnterUpButton:
The mouse has entered the up button.
mouseLeaveDownButton:
The mouse has left the down button.
mouseLeavePagingArea:
The mouse has left the paging area.
mouseLeaveThumb:
The mouse has left the thumb.
mouseLeaveUpButton:
The mouse has left the up button.
mouseOverBorderStyle
Return the mouse over borderStyle for the receiver.
mouseOverButtonBorderStyle
Return the mouse over button borderStyle for the receiver.
mouseOverButtonFillStyle
Return the mouse over button fillStyle for the receiver.
mouseOverFillStyle
Return the mouse over fillStyle for the receiver.
mouseOverPagingAreaButtonBorderStyle
Return the button borderStyle for the receiver when the mouse
is over the paging area.
mouseOverPagingAreaButtonFillStyle
Return the button fillStyle for the receiver when the mouse
is over the paging area.
mouseOverPagingAreaThumbBorderStyle
Return the thumb borderStyle for the receiver when the mouse
is over the paging area.
mouseOverPagingAreaThumbFillStyle
Return the thumb fillStyle for the receiver when the mouse
is over the paging area.
mouseOverThumbBorderStyle
Return the mouse over thumb borderStyle for the receiver.
mouseOverThumbButtonBorderStyle
Return the button borderStyle for the receiver when the mouse
is over the thumb.
mouseOverThumbButtonFillStyle
Return the mouse over thumb fillStyle for the receiver.
mouseOverThumbFillStyle
Return the mouse over thumb fillStyle for the receiver.
mouseUpInSlider:
The mouse button has been released.
normalBorderStyle
Return the normal borderStyle for the receiver.
normalButtonBorderStyle
Return the normal button borderStyle for the receiver.
normalButtonFillStyle
Return the normal button fillStyle for the receiver.
normalFillStyle
Return the normal fillStyle for the receiver.
normalThumbBorderStyle
Return the normal thumb borderStyle for the receiver.
normalThumbFillStyle
Return the normal thumb fillStyle for the receiver.
pagingArea
pressedBorderStyle
Return the pressed borderStyle for the receiver.
pressedButtonBorderStyle
Return the pressed button borderStyle for the receiver.
pressedButtonFillStyle
Return the pressed button fillStyle for the receiver.
pressedFillStyle
Return the pressed fillStyle for the receiver.
pressedThumbBorderStyle
Return the pressed thumb borderStyle for the receiver.
pressedThumbFillStyle
Return the pressed thumb fillStyle for the receiver.
resetTimer
roundedScrollbarLook
Rounded look currently only shows up in flop-out mode
sampleColors
sampleSizes
scrollAbsolute:
Just don't if it is not the red button and we are drawing gradients.
scrollBarAction
scrollBarAction:
scrollDelta
scrollDelta:pageDelta:
Supply optional increments for better scrolling of, eg, text
scrollDown
scrollDown:
scrollDownInit
Initialize a scroll down (from button) operation.
Fixed to perform immediately with deferred
stepping for subsequent hold of button.
scrollPageInit:
Scroll initiated by the paging area.
scrollUp
scrollUp:
scrollUpInit
Initialize a scroll up (from button) operation.
Fixed to perform immediately with deferred
stepping for subsequent hold of button.
setNextDirectionFromEvent:
setValue:
Using roundTo: instead of truncateTo: ensures that scrollUp will scroll the same distance as scrollDown.
Fix for >= 1.0 since, when close the roundTo may round down and not allow the value to reach
the full range.
setValueSelector:
Directly set the selector to make more flexible.
slider
Answer the slider.
sliderColor:
Change the color of the scrollbar to go with aColor.
sliderExtent
The sliderExtent is now stored in the slider itself, not hardcoded as it is in the superclass.
sliderShadowColor
sliderThickness
Answer the minimum width/height of the scrollbar thumb. Refer to the theme.
step
Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. The generic version dispatches control to the player, if any. The nasty circumlocation about owner's transformation is necessitated by the flexing problem that the player remains in the properties dictionary both of the flex and the real morph. In the current architecture, only the top renderer's pointer to the player should actually be honored for the purpose of firing.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
themeChanged
Update the rounding of buttons, slider and paging area.
thumbColor
Problem: Part of the ScrollBar/Slider code uses 'slider' to mean the entire scrollbar/slider widget, and part of it uses 'slider' to mean only the draggable 'thumb'. This should be cleaned up so that 'thumb' is used instead of 'slider' where appropriate. For now, the meaning of thumbColor is clear, at least.
totalSliderArea
upArrow8Bit
convert to 8-bit and convert white to transparent to avoid gratuitous conversion every time we put one in an ImageMorph
upImage
answer a form to be used in the up button
updateDownButtonImage
update the receiver's downButton. put a new image inside
updateMenuButtonImage
update the receiver's menuButton. put a new image inside
updateScrollBarButtonAspect:color:
updateScrollBarButtonsAspect:color:
updateUpButtonImage
update the receiver's upButton. put a new image inside
verticesForComplexArrow:
verticesForSimpleArrow:
waitForDelay1:delay2:
Return true if an appropriate delay has passed since the last scroll operation.
The delay decreases exponentially from delay1 to delay2.
wantsSteps
Return true if the receiver overrides the default Morph step method.
ScrollPane
The scroller (a transform) of a scrollPane is driven by the scrollBar. The scroll values vary from 0.0, meaning zero offset to 1.0 meaning sufficient offset such that the bottom of the scrollable material appears 3/4 of the way down the pane. The total distance to achieve this range is called the totalScrollRange.
Basic clue about utilization of the ScrollPane class is given in:
ScrollPane example1.
ScrollPane example2.
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
adoptPaneColor:
Match the pane colour.
alwaysShowHScrollBar:
alwaysShowScrollBars:
Get rid of scroll bar for short panes that don't want it shown.
alwaysShowVScrollBar:
borderStyle:
Optimised when no change.
borderStyleToUse
Answer the borderStyle that should be used for the receiver.
borderWidth:
containsPoint:
defaultBorderColor
answer the default border color/fill style for the receiver
defaultExtent
example1
example2
extent:
extraScrollRange
Return the amount of extra blank space to include below the bottom of the scroll content.
flatColoredScrollBarLook
Currently only show the flat (not rounded) + colored-to-match-window scrollbar look when inboard.
getMenu:
Answer the menu for this text view, supplying an empty menu to be filled in. If the menu selector takes an extra argument, pass in the current state of the shift key.
getMenuSelector:
Set the menu selector.
getMenuTitleSelector:
Set the menu titleselector.
hExtraScrollRange
Return the amount of extra blank space to include below the bottom of the scroll content.
hHideOrShowScrollBar
Hide or show the scrollbar depending on if the pane is scrolled/scrollable.
hHideScrollBar
hInitScrollBarTEMPORARY
This is called lazily before the hScrollBar is accessed in a couple of places. It is provided to transition old ScrollPanes lying around that do not have an hScrollBar. Once it has been in the image for awhile, and all ScrollPanes have an hScrollBar, this method and it's references can be removed.
hIsScrollable
If the contents of the pane are too small to scroll, return false.
hIsScrollbarNeeded
Return whether the horz scrollbar is needed
hIsScrollbarShowing
Return true if a horz scroll bar is currently showing
hIsScrolled
If the scroller is not set to x = 0, then the pane has been h-scrolled.
hLeftoverScrollRange
Return the entire scrolling range minus the currently viewed area.
hMargin
pixels of whitespace at to the left of the scroller when the hScrollBar offset is 0
hResizeScrollBar
TEMPORARY: IF OLD SCROLLPANES LYING AROUND THAT DON'T HAVE A hScrollBar, INIT THEM
hScrollBarMenuButtonPressed:
hScrollBarValue:
hScrollBarWidth
Return the width of the horizontal scrollbar
hScrollValue:
Set the horizontal scroll value via the scrollbar itself.
hSetScrollDelta
Set the ScrollBar deltas, value and interval, based on the current scroll pane size, offset and range.
hShowScrollBar
hTotalScrollRange
Return the entire scrolling range.
hUnadjustedScrollRange
Return the width extent of the receiver's submorphs.
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesMouseOver:
Could just ^ true, but this ensures that scroll bars won't flop out
if you mouse-over appendages such as connecting pins.
handlesMouseWheel:
Do I want to receive mouseWheel events?.
hasFocus
hasFocus is currently set by mouse enter/leave events.
This inst var should probably be moved up to a higher superclass.
hideHScrollBarIndefinitely:
Get rid of scroll bar for short panes that don't want it shown.
hideOrShowScrollBar
Hide or show the scrollbar depending on if the pane is scrolled/scrollable.
hideOrShowScrollBars
hideScrollBars
hideScrollBarsIndefinitely
hideScrollBarsIndefinitely:
Get rid of scroll bar for short panes that don't want it shown.
hideVScrollBarIndefinitely:
Get rid of scroll bar for short panes that don't want it shown.
includeInNewMorphMenu
initialize
initialize the state of the receiver
initializePreferences
initialize the receiver's Preferences
initializeScrollBars
initialize the receiver's scrollBar
innerBounds
Return the inner rectangle enclosed by the bounds of this morph excluding the space taken by its borders. For an unbordered morph, this is just its bounds.
isAScrollbarShowing
Return true if a either retractable scroll bar is currently showing
isScrolledFromTop
Have the contents of the pane been scrolled, so that the top of the contents are not visible?
keyStroke:
If pane is not empty, pass the event to the last submorph,
 assuming it is the most appropriate recipient (!)
leftOrRight
Change scroll bar location
menuTitleSelector:
minHeight
Answer the minimum height.
minWidth
Answer the minimum width.
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseEnter:
Handle a mouseEnter event, meaning the mouse just entered my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseLeave:
Handle a mouseLeave event, meaning the mouse just left my bounds with no button pressed. The default response is to let my eventHandler, if any, handle it.
mouseMove:
If pane is not empty, pass the event to the last submorph,
assuming it is the most appropriate recipient (!).
mouseUp:
If pane is not empty, pass the event to the last submorph,
assuming it is the most appropriate recipient (!)
mouseWheel:
Handle a mouseWheel event.
numSelectionsInView
Answer the scroller's height based on the average number of submorphs.
resetExtent
Reset the extent. (may be overridden by subclasses which need to do more than this)
resizeScrollBars
resizeScroller
retractable:
retractableOrNot
Change scroll bar operation
retractableScrollBar
scrollBarFills:
Return true if a flop-out scrollbar fills the rectangle
scrollBarMenuButtonPressed:
scrollBarOnLeft
scrollBarOnLeft:
scrollBarThickness
Includes border
scrollBy:
Move the contents in the direction delta.
scrollByKeyboard:
If event is ctrl+up/down then scroll and answer true
scrollDeltaHeight
Return the increment in pixels which this pane should be scrolled (normally a subclass responsibility).
scrollDeltaWidth
Return the increment in pixels which this pane should be scrolled (normally a subclass responsibility).
scrollToShow:
scroll to include as much of aRectangle as possible, where aRectangle is in the scroller's local space
scrollValue
Answer the values of the scrollbars as a point.
scroller
scroller:
setScrollDeltas
Set the ScrollBar deltas, value and interval, based on the current scroll pane size, offset and range.
shiftedTextPaneMenuRequest
The more... button was hit from the text-pane menu
shiftedYellowButtonActivity
showHScrollBarOnlyWhenNeeded:
Get rid of scroll bar for short panes that don't want it shown.
showScrollBars
showScrollBarsOnlyWhenNeeded:
showVScrollBarOnlyWhenNeeded:
Get rid of scroll bar for short panes that don't want it shown.
unshiftedYellowButtonActivity
vExtraScrollRange
Return the amount of extra blank space to include below the bottom of the scroll content.
vHideOrShowScrollBar
vHideScrollBar
vIsScrollable
Return whether the verticle scrollbar is scrollable
vIsScrollbarNeeded
Return whether the verticle scrollbar is needed
vIsScrollbarShowing
Return true if a retractable scroll bar is currently showing
vIsScrolled
If the scroller is not set to y = 0, then the pane has been scrolled.
vLeftoverScrollRange
Return the entire scrolling range minus the currently viewed area.
vResizeScrollBar
vScrollBarHeight
vScrollBarMenuButtonPressed:
vScrollBarValue:
vScrollValue:
Set the vertical scroll value via the scrollbar itself.
vSetScrollDelta
Set the ScrollBar deltas, value and interval, based on the current scroll pane size, offset and range.
vShowScrollBar
vTotalScrollRange
Return the entire scrolling range.
vUnadjustedScrollRange
Return the height extent of the receiver's submorphs.
wantsYellowButtonMenu
Answer true if the receiver wants a yellow button menu
yellowButtonActivity:
Find me or my outermost owner that has items to add to a
yellow button menu.
shiftState is true if the shift was pressed.
Otherwise, build a menu that contains the contributions from
myself and my interested submorphs,
and present it to the user.
SelectedObjectThumbnail
A SelectedObjectThumbnail is xxxxxxxxx.
Instance Variables
noSelectedBalloonText: <Object>
noSelectedThumbnail: <Object>
noSelectedBalloonText
- xxxxx
noSelectedThumbnail
- xxxxx
extent:noSelectedThumbnail:noSelectedBalloonText:
initialize
Initialize the receiver
initializeExtent:noSelectedThumbnail:noSelectedBalloonText:
makeEmptyThumbnail
makeErrorThumbnail
makeThumbnailFrom:
makeThumbnailOfColor:
noSelectedBalloonText:
Set the balloon text to be used when no object is selected
noSelectedThumbnail:
Set the form to be used when no object is selected
step
Update the image to be a thumbnail of the morph under the hand.
Optimized to not constantly update.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
SelectionMorph
A selectionMorph supports the selection of multiple objects in a morphic world or pasteUp.
Structure:
selectedItems an OrderedCollection of Morphs
These are the morphs that have been selected
slippage a Point
Keeps track of actual movement between the
steps of gridded movement
dupLoc a Point
Notes the position when first duplicate request occurs from halo
dupDelta a Point
Holds the final delta of the first duplicate plus subsequent moves.
aboutToBeGrabbedBy:
The receiver is being grabbed by a hand.
Perform necessary adjustments (if any) and return the actual morph
that should be added to the hand.
addCustomMenuItems:hand:
Add custom menu items to the menu
addHandlesTo:box:
Add halo handles to the halo. Apply the halo filter if appropriate
addOptionalHandlesTo:box:
addOrRemoveItems:
Make a new selection extending the current one.
alignBottomEdges
Make the bottom coordinate of all my elements be the same
alignCentersHorizontally
Make every morph in the selection have the same vertical center as the topmost item.
alignCentersVertically
Make every morph in the selection have the same horizontal center as the topmost item.
alignLeftEdges
Make the left coordinate of all my elements be the same
alignRightEdges
Make the right coordinate of all my elements be the same
alignTopEdges
Make the top coordinate of all my elements be the same
balloonHelpTextForHandle:
Answer a string providing balloon help for the
given halo handle
borderColor:
Unfortunately, the argument to borderColor could be more than just a color.
It could also be a symbol, in which case it is to be interpreted as a style identifier.
But I might not be able to draw that kind of border, so it may have to be ignored.
Or it could be nil, in which case I should revert to the default border.
borderColorForItems:
borderWidth:
borderWidthForItems:
bounds:
Make sure position: gets called before extent:; Andreas' optimization for growing/shrinking in ChangeSet 3119 screwed up selection of morphs from underlying pasteup.
defaultBorderColor
answer the default border color/fill style for the receiver
defaultColor
answer the default color/fill style for the receiver
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
dismissViaHalo
The user has clicked in the delete halo-handle. This provides a hook in case some concomitant action should be taken, or if the particular morph is not one which should be put in the trash can, for example.
distributeHorizontally
Distribute the empty vertical space in a democratic way.
distributeVertically
Distribute the empty vertical space in a democratic way.
doDup:fromHalo:handle:
doneExtending
drawOn:
duplicate
Make a duplicate of the receiver and havbe the hand grab it
extendByHand:
Assumes selection has just been created and added to some pasteUp or world
extent:
externalName
Answer an external name by which the receiver is known. Generic implementation here is a transitional backstop. probably
fillStyle:
Set the current fillStyle of the receiver.
Optimized for no change.
fillStyleForItems:
hasHalo:
initialize
initialize the state of the receiver
justDroppedInto:event:
This message is sent to a dropped morph after it has been dropped on -- and been accepted by -- a drop-sensitive morph
maybeAddCollapseItemTo:
... don't
morphicLayerNumber
helpful for insuring some morphs always appear in front of or
behind others. smaller numbers are in front
organizeIntoColumn
Place my objects in a column-enforcing container
organizeIntoRow
Place my objects in a row-enforcing container
privateFullMoveBy:
Private! Relocate me and all of my subMorphs by recursion. Subclasses that implement different coordinate systems may override this method.
refineUndoTarget:selector:arguments:in:
Any morph can override this method to refine its undo specification
selectSubmorphsOf:
selectedItems
setOtherSelection:
setSelectedItems:
slideToTrash:
Morph do not slide to trash anymore.
undoMove:redo:owner:bounds:predecessor:
Handle undo and redo of move commands in morphic
wantsToBeTopmost
Answer if the receiver want to be one of the topmost objects in
its owner
ShadowDrawingCanvas
A ShadowDrawingCanvas is xxxxxxxxx.
Instance Variables
shadowColor: <Object>
shadowColor
- xxxxx
image:at:sourceRect:rule:
Draw the given form. For the 'paint' combination rule use stenciling otherwise simply fill the source rectangle.
isShadowDrawing
mapColor:
on:
shadowColor
Return the current override color or nil if no such color exists
shadowColor:
Set a shadow color. If set this color overrides any client-supplied color.
SimpleBorder
see BorderedMorph
baseColor
baseColor:
Ignored
bottomRightColor
Changed from direct access to color since, if nil,
self color is transparent.
color
color:
Ignored
drawLineFrom:to:on:
frameRectangle:on:
Frame the given rectangle on aCanvas
initialize
Subclasses should redefine this method to perform initializations on instance creation
style
topLeftColor
Changed from direct access to color since, if nil,
self color is transparent.
width
width:
Ignored
SimpleButtonMorph
I am labeled, rectangular morph which allows the user to click me. I can be configured to send my "target" the message "actionSelector" with "arguments" when I am clicked. I may have a label, implemented as a StringMorph.
Example:
SimpleButtonMorph new
target: Smalltalk;
label: 'Beep!';
actionSelector: #beep;
openInWorld
Structure:
instance var Type Description
target Object The Object to notify upon a click
actionSelector Symbol The message to send to Target (#messageName)
arguments Array Arguments to send with #actionSelection (optional)
actWhen Symbol When to take action: may be #buttonUp (default), #buttonDown,
#whilePressed, or #startDrag
oldColor Color Used to restore color after click
Another example: a button which quits the image without saving it.
SimpleButtonMorph new
target: Smalltalk;
label: 'quit';
actionSelector: #snapshot:andQuit:;
arguments: (Array with: false with: true);
openInWorld
actWhen
acceptable symbols: #buttonDown, #buttonUp, and #whilePressed
actWhen:
Accepts symbols: #buttonDown, #buttonUp, and #whilePressed, #startDrag
actionSelector
actionSelector:
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addLabelItemsTo:hand:
addTargetingMenuItems:hand:
Add targeting menu items
arguments
arguments:
authoringPrototype
clearTarget
defaultLabel
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
doButtonAction
Perform the action of this button. Subclasses may override this method. The default behavior is to send the button's actionSelector to its target object with its arguments.
extent:
fitContents
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesMouseStillDown:
Return true if the receiver wants to get repeated #mouseStillDown: messages between #mouseDown: and #mouseUp
initialize
initialize the state of the receiver
label
label:
label:font:
labelString:
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseMove:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseStillDown:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseStillDownStepRate
Answer how often I want the #handleMouseStillDown: stepped
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
newWithLabel:
recolor:
setActWhen
setActionSelector
setArguments
setDefaultLabel
setLabel
setTarget
setTarget:
target
target:
Morphs with targets will override. This backstop does nothing.
updateVisualState:
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared. Warning!! Every instance variable defined in this class must be handled. We must also implement veryDeepFixupWith:. See DeepCopier class comment.
SimpleHierarchicalListMorph
Display a hierarchical list of items. Each item should be wrapped with a ListItemWrapper.
For a simple example, look at submorphsExample. For beefier examples, look at ObjectExplorer or FileList2.
acceptDroppingMorph:event:
This message is sent when a morph is dropped onto a morph that has agreed to accept the dropped morph by responding 'true' to the wantsDroppedMorph:Event: message. This default implementation just adds the given morph to the receiver.
addMorphsTo:from:allowSorting:withExpandedItems:atLevel:
addSubmorphsAfter:fromCollection:allowSorting:
adjustSubmorphPositions
Fixed to not require setting item widths to 9999.
adoptPaneColor:
Pass on to the border too.
arrowKey:
Handle a keyboard navigation character. Answer true if handled, false if not.
autoDeselect:
Enable/disable autoDeselect (see class comment)
columns
columns:
currentlyExpanded
drawLinesOn:
Draw the lines for the submorphs.
Modified for performance.
drawOn:
Draw the selection and lines.
drawSubmorphsOn:
Display submorphs back to front.
Draw the focus here since we are using inset bounds
for the focus rectangle.
expand:to:
expandAll
Expand all of the roots!
expandAll:
expandAll:except:
expandRoots
Expand all the receiver's roots
expandedForm
Answer the form to use for expanded items.
extent:
getCurrentSelectionItem
getList
Answer the list to be displayed.
getSelectionIndex
hExtraScrollRange
Return the amount of extra blank space to include below the bottom of the scroll content.
hUnadjustedScrollRange
Return the width of the widest item in the list.
Use super now since actual item widths are correct.
handleMouseMove:
Reimplemented because we really want #mouseMove when a morph is dragged around
handlesKeyboard:
Return true if the receiver wishes to handle the given keyboard event
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
highlightSelection
indentingItemClass
initialize
initialize the state of the receiver
insertNewMorphs:
itemFromPoint:
Return the list element (morph) at the given point or nil if outside
keyStroke:
Process potential command keys.
Fix for command key required (like PluggableListMorph).
keyboardFocusChange:
The message is sent to a morph when its keyboard focus changes.
Update for focus feedback.
lineColor
Answer a good color to use for drawing the lines that connect members of the hierarchy view.
Used the cached color, or derive it if necessary by finding the receiver or the first owner (up to my root) that is not transparent, then picking a contrasting color.
Fall back to black if all my owners are transparent.
lineColor:
list:
listItemHeight
This should be cleaned up. The list should get spaced by this parameter.
maximumSelection
minimumSelection
mouseDown:
Changed to take keybaord focus.
mouseDown:onItem:
mouseDownHighlightColor
Answer a good color to use for drawing the mouse down highlight.
Used the line color if not transparent, otherwise a contrasting color in the
same way as the line color is determined.
Fall back to black if all my owners are transparent.
mouseEnter:
Changed to take mouseClickForKeyboardFocus preference into account.
mouseEnterDragging:
Handle a mouseEnterDragging event, meaning the mouse just entered my bounds with a button pressed or laden with submorphs. The default response is to let my eventHandler, if any, handle it, or else to do nothing.
mouseEnterDragging:onItem:
mouseLeaveDragging:
Handle a mouseLeaveLaden event, meaning the mouse just left my bounds with a button pressed or laden with submorphs. The default response is to let my eventHandler, if any, handle it; else to do nothing.
mouseLeaveDragging:onItem:
mouseMove:
If pane is not empty, pass the event to the last submorph,
assuming it is the most appropriate recipient (!).
mouseUp:
Fixed up highlight problems.
notExpandedForm
Answer the form to use for unexpanded items.
noteRemovalOfAll:
on:list:selected:changeSelected:
on:list:selected:changeSelected:menu:
on:list:selected:changeSelected:menu:keystroke:
potentialDropMorph
potentialDropMorph:
removeObsoleteEventHandlers
resetPotentialDropMorph
roots
Answer the receiver's roots
scrollDeltaHeight
Return the increment in pixels which this pane should be scrolled (normally a subclass responsibility).
scrollDeltaWidth
A guess -- assume that the width of a char is approx 1/2 the height of the font
selectedMorph
selectedMorph:
selection:
Called from outside to request setting a new selection.
Assumes scroller submorphs is exactly our list.
Note: MAY NOT work right if list includes repeated items
selectionColor
Answer the colour to use for selected items.
selectionColor:
Set the colour for selected items.
selectionColorToUse
Answer the colour to use for selected items.
selectionColorToUse:
Set the colour for selected items.
selectionFrame
Answer the frame of the selected morph in the receiver or nil if none.
selectionFrameChanged
Invalidate frame of the current selection if any.
selectionIndex:
Called internally to select the index-th item.
selectionOneOf:
Set the selection to the first item in the list which is represented by one of my submorphs
setSelectedMorph:
setSelectionIndex:
Called internally to select the index-th item.
sortingSelector:
startDrag:
Handle a double-click event. This message is only sent to clients that request it by sending #waitForClicksOrDrag:event: to the initiating hand in their mouseDown: method. This default implementation does nothing.
startDrag:onItem:
submorphsExample
takesKeyboardFocus
Answer whether the receiver can normally take keyboard focus.
themeChanged
Update the selection colour.
toggleExpandedState:
toggleExpandedState:event:
self setSelectedMorph: aMorph.
unhighlightSelection
update:
Receive a change notice from an object of whom the receiver is a
dependent. The default behavior is to do nothing; a subclass might want
to change itself in some way.
vUnadjustedScrollRange
Return the width of the widest item in the list
wantsDroppedMorph:event:
Return true if the receiver wishes to accept the given morph, which is being dropped by a hand in response to the given event. Note that for a successful drop operation both parties need to agree. The symmetric check is done automatically via aMorph wantsToBeDroppedInto: self.
SimpleSwitchMorph
I represent a switch that can be either on or off. I chnage my state in response to a mouse click. When clicked, I also send my actionSelector to my target, just like a SimpleButtonMorph.
defaultLabel
doButtonAction
Perform the action of this button. The last argument of the message sent to the target is the new state of this switch.
initialize
initialize the state of the receiver
isOff
isOn
mouseDown:
Handle a mouse down event. The default response is to let my
eventHandler, if any, handle it.
mouseMove:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
offColor
offColor:
onColor
onColor:
setSwitchState:
toggleState
turnOff
turnOn
SketchEditorMorph
Inst vars (converting to morphic events)
hostView -- SketchMorph we are working on.
stampForm -- Stamp is stored here.
canvasRectangle -- later use bounds
palette -- the PaintBox interface Morph
dirty -- not used
currentColor
ticksToDwell rotationCenter registrationPoint
newPicBlock -- do this after painting
action -- selector of painting action
paintingForm -- our copy
composite -- now paintArea origin. world relative. stop using it.
dimForm -- SketchMorph of the dimmed background. Opaque.
installed behind the editor morph.
buff
brush -- 1-bit Form of the brush,
paintingFormPen
formCanvas -- Aim it at paintingForm to allow it to draw ovals, rectangles, lines, etc.
picToComp dimToComp compToDisplay -- used to composite -- obsolete
picToBuff brushToBuff buffToBuff buffToPic
rotationButton scaleButton -- submorphs, handles to do these actions.
strokeOrigin -- During Pickup, origin of rect.
cumRot cumMag -- cumulative for multiple operations from same original
undoBuffer
lastEvent
currentNib -- 1 bit deep form.
For now, we do not carry the SketchMorph's registration point, rotation center, or ticksToDwell.
New -- using transform morphs to rotate the finished player. How get it rotated back and the rotationDegrees to be right? We cancel out rotationDegrees, so how remember it?
Registration point convention:
In a GraphicFrame, reg point is relative to this image's origin.
During painting, it is relative to canvasRectangle origin, and thus us absolute within the canvas. To convert back, subract newBox origin.
Be sure to convert back and forth correctly. In deliverPainting. initializeFromFrame:inView:
addRotationScaleHandles
Rotation and scaling handles
afterNewPicDo:ifNoBits:
If the user said 'Save' at the end of drawing, do this block to save the picture.
goodBlock takes 2 args, the painted form and the bounding rectangle of its bits.
badBlock takes no args.
cancel:
Palette is telling us that the use wants to end the painting session.
cancelOutOfPainting
The user requested to back out of a painting session without saving
cancelPainting:evt:
Undo the operation after user issued #cancel in aPaintBoxMorph
clear
wipe out all the paint
clearPainting:
Clear the image after user issued #clear in aPaintBoxMorph
defaultColor
answer the default color/fill style for the receiver
deleteSelfAndSubordinates
Delete the receiver and, if it has one, its subordinate dimForm
deliverPainting:evt:
Done painting. May come from resume, or from original call. Execute user's post painting instructions in the block. Always use this standard one. 4/21/97 tk
dimTheWindow
Updated to use TranslucentColor by kfr 10/5 00
drawOn:
Put the painting on the display
ellipse:
Draw an ellipse from the center.
enclosingPasteUpMorph
erase:
Pen is set up to draw transparent squares
erasePrep:
Transparent paint, square brush. Be careful not to let this be undone by asking palette for brush and color.
fill:
Find the area that is the same color as where you clicked. Fill it with
the current paint color.
flipHoriz:
Flip the image
flipVert:
Flip the image
forward:direction:
Move the forward direction arrow of this painting. When the user
says forward:, the object moves in the direction of the arrow. evt may be
an Event (from the user moving the arrow), or an initial number ofdegrees.
forwardDirection
The direction object will go when issued a sent forward:. Up is
zero. Clockwise like a compass. From the arrow control.
get:for:
getActionFor:
getBrushFor:
getColorFor:
getCursorFor:
getNibFor:
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
handlesMouseOver:
Do I want to receive mouseEnter: and mouseLeave: when the button is up and the hand is empty? The default response is false, except if you have added sensitivity to mouseEnter: or mouseLeave:, using the on:send:to: mechanism.
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
hostView
includeInNewMorphMenu
initializeFor:inBounds:pasteUpMorph:
initializeFor:inBounds:pasteUpMorph:paintBoxPosition:
NB: if aPosition is nil, then it's assumed that the paintbox is obtained from a flap or some such, so do nothing special regarding a palette in this case. The palette needs already to be in the world for this to work.
line:
Draw a line on the paintingForm using formCanvas aimed at it.
morphicLayerNumber
Place the painting behind the paint palette
mouseDown:
Start a new stroke. Check if any palette setting have changed. 6/11/97 20:30 tk
mouseEnter:
Set the cursor. Reread colors if embedded editable polygon needs it.
mouseEnterDragging:
Test button state elsewhere if at all
mouseLeave:
Revert to the normal hand cursor.
mouseLeaveDragging:
Test button state elsewhere if at all
mouseMove:
In the middle of drawing a stroke. 6/11/97 19:51 tk
mouseUp:
Do nothing except those that work on mouseUp.
notes
Singleton costumes.
Registration points
paint:
While the mouse is down, lay down paint, but only within window bounds.
11/28/96 sw: no longer stop painting when pen strays out of window; once it comes back in, resume painting rather than waiting for a mouse up
paintBoxChanged:
painting
palette
paletteAttached:
A new palette has been attached to the receiver.
Don't know what to do here...
paletteDetached:
The palette has been detached to the receiver.
Don't know what to do here....
pickup:
Grab a part of the picture (or screen) and store it in a known place. Note where we started. Use a rubberband rectangle to show what is being selected.
pickupMouseUp:
Grab a part of the picture (or screen) and store it in a known place. Like Copy on the Mac menu. Then switch to the stamp tool.
polyEdit:
Add handles and let user drag'em around
polyEditing
polyEditing:
polyFreeze
A live polygon is on the painting. Draw it into the painting and
delete it.
polyNew:
Create a new polygon. Add it to the sketch, and let the user drag
its vertices around! Freeze it into the painting when the user chooses
another tool.
polygon:
prepareToPaint:
Figure out what the current brush, fill, etc is. Return an action to take every mouseMove. Set up instance variable and pens. Prep for normal painting is inlined here. tk 6/14/97 21:11
rect:
While moving corner, just write on the canvas. When done, write on the paintingForm
registrationPoint
registrationPoint:
render:
Compose the damaged area again and store on the display. damageRect is relative to paintingForm origin. 3/19/97 tk
replaceOnly:
Paint replacing only one color! Call this each stroke. Also works for replacing all but one color.
restoreRect:
Restore the given rectangular area of the painting Form from the undo buffer.
rotateBy:
Left-right is rotation. 3/26/97 tk Slider at top of window. 4/3/97 tk
rotateDone:
MouseUp, snap box back to center.
rotateScalePrep:
Make a source that is the paintingForm. Work from that. 3/26/97 tk
rotationStyle
Return the 'rotation style' of the receiver
save:
Palette is telling us that the use wants to end the painting session.
savePainting:evt:
Save the image after user issued #keep in aPaintBoxMorph
scaleBy:
up-down is scale. 3/26/97 tk Now a slider on the right.
set:for:to:
setRotations:
Tell the palette what number of rotations (or background) to show.
shiftConstrainPoint:
answer a point with x and y equal for shift-constrained drawing
showDirType
Display the proper symbol for this direction type. rotationStyle
is one of #(normal leftRight upDown none).
stamp:
plop one copy of the user's chosen Form down.
star:
Draw an star from the center.
ticksToDwell
ticksToDwell:
toggleDirType:in:
Toggle from 'rotate' to 'to and fro' to 'up and down' to 'none'
for the kind of rotation the object does. An actor's rotationStyle is one
of #(normal leftRight upDown none).
undo:
revert to a previous state.
undoPainting:evt:
Undo the operation after user issued #undo in aPaintBoxMorph
valuesForHand:
valuesForHandIfPresent:
verifyState:
We are sure we will make a mark now. Make sure the palette has not changed state while we were away. If so, end this action and start another one. 6/11/97 19:52 tk action, currentColor, brush
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here. If they were in the tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared. Warning!! Every instance variable defined in this class must be handled. We must also implement veryDeepFixupWith:. See DeepCopier class comment.
SketchMorph
The morph that results when the user draws a color bitmap using the PaintBox (SketchEditorMorph and PaintBoxMorph).
forwardDirection is the angle at which the object will go forward. When the rotationStyle is not #normal, then forwardDirection is any angle, while the rotation is highly restricted. If flexed, this is remembered by the Transform morph. For non-normal rotationStyle, it is rotationDegrees.
setupAngle (a property) is where the user put the green arrow to indicate which direction on the picture is forward. When #normal, draw the morph initially at (0.0 - setupAngle). The enclosing TransformationMorph then rotates it to the true angle.

rotationDegrees In a #normal object, rotationDegrees is constant an equal to setupAngle.
For non-normal, it is the direction the object is going.
When repainting, set it back to its original state. The green arrow is set to setupAngle, and the sketch is shown as drawn originally (rotationDegrees = 0).
rotationStyle = normal (turns), leftRight, upDown, fixed.
When leftRight upDown or fixed, bit map has severe restrictions.
addBorderToShape:
addCustomMenuItems:hand:
Add custom menu items
addFillStyleMenuItems:hand:
Do nothing here - we do not allow changing the fill style of a SketchMorph yet.
addToggleItemsToHaloMenu:
Add toggle-items to the halo menu
areasRemainingToFill:
Figuring out which parts of a Sketch are not translucent can be tricky to
do... (Colors used can be transparent (see canBeEnlargedWithB3D)
- Source Form can be depth 32 with alpha bits, etc.
It's not certain whether the calculation to find areas remaining outside
opaque parts will be of significant value (i.e. they probably will be merged
when creating damage rects for Morphs beneath anyways), therefore handle
it like we always have to redraw content beneath... At least for now
baseGraphic
Answer my base graphic
baseGraphic:
Remember the given form as the receiver's base graphic
basicType
Answer a symbol representing the inherent type I hold
callThisBaseGraphic
Set my baseGraphic to be the current form
canBeEnlargedWithB3D
changePixelsOfColor:toColor:
clearExtent:fillColor:
Make this sketch have the given pixel dimensions and fill it with given color. Its previous contents are replaced.
collapse
containsPoint:
defaultForm
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
drawHighResolutionOn:in:
drawInterpolatedImage:on:
Draw the given form onto the canvas using the Balloon 3D engine
drawOn:
editDrawing
editDrawingIn:forBackground:
Edit an existing sketch.
erasePixelsOfColor:
Let the user specifiy a color such that all pixels of that color should be erased; then do the erasure
extent:
Change my scale to fit myself into the given extent.
Avoid extents where X or Y is zero.
firstIntersectionWithLineFrom:to:
flipHorizontal
flipVertical
form
form:
Set the receiver's form
forwardDirection:
If not rotating normally, update my rotatedForm
framesToDwell
framesToDwell:
fromFile:
fromStream:
generateInterpolatedForm
Draw the given form onto the canvas using the Balloon 3D engine
generateRotatedForm
Compute my rotatedForm and offsetWhenRotated.
heading:
If not rotating normally, change forward direction rather than heading
includeInNewMorphMenu
initialize
initialize the state of the receiver
initializeAllButForm
initializeForm:
initializeWithForm:
insertIntoMovie:
isLikelyRecipientForMouseOverHalos
isSketchMorphClass
layoutChanged
Update rotatedForm and compute new bounds.
newForm:
nominalForm:
Ascribe the blank nominal form
openEditor
originalForm:
penOnMyForm
Support for experiments with drawing under program control. To get started, make a new SketchMorph in a morphic world. In an inspector, give it the desired pixel dimensions with clearExtent:fillColor:. Then use this method to get a pen to which you can send normal pen commands. Reveal the resulting drawing with revealPenStrokes.
recolorPixelsOfColor:
Let the user select a color to be remapped, and then a color to map that color to, then carry it out.
reduceColorPalette:
Let the user ask for a reduced number of colors in this sketch
releaseCachedState
Clear cache of rotated, scaled Form.
replaceSelfWithMovie
Replace this SketchMorph in its owner with a MovieMorph containing this sketch as its only frame. This allows a SketchMorph to be turned into a MovieMorph by just insering additional frames.
restoreBaseGraphic
Restore the receiver's base graphic
restoreBaseGraphicFromMenu
Restore the base graphic -- invoked from a menu, so give interactive feedback if appropriate
revealPenStrokes
This message must be sent after a sequence of pen strokes to make the resulting changes visible.
rotatedForm
rotationStyle
Return the 'rotation style' of the receiver
rotationStyle:
Set my rotation style to #normal, #leftRight, #upDown, or #none. Styles mean:
#normal -- continuous 360 degree rotation
#leftRight -- quantize angle to left or right facing
#upDown -- quantize angle to up or down facing
#none -- do not rotate
scaleFactor
Answer the number representing my scaleFactor, assuming the receiver to be unflexed (if flexed, the renderer's scaleFactor is called instead
scalePoint
scalePoint:
setNewFormFrom:
Set the receiver's form as indicated. If nil is provided, then a default form will be used, possibly retrieved from the receiver's defaultValue property
setRotationStyle
toggleInterpolation
useInterpolation
useInterpolation:
useInterpolationString
wantsDirectionHandles
wantsDirectionHandles:
wantsRecolorHandle
Answer whether the receiver would like a recolor handle to be
put up for it. We'd want to disable this but for the moment
that would cut off access to the button part of the properties
sheet. So this remains a loose end.
wantsSimpleSketchMorphHandles
Answer true if my halo's simple handles should include the simple sketch morph handles.
wearCostume:
withForm:
Slider
A Slider is xxxxxxxxx.
Instance Variables
descending: <Object>
setValueSelector: <Object>
slider: <Object>
sliderColor: <Object>
sliderShadow: <Object>
value: <Object>
descending
- xxxxx
setValueSelector
- xxxxx
slider
- xxxxx
sliderColor
- xxxxx
sliderShadow
- xxxxx
value
- xxxxx
computeSlider
defaultBorderColor
answer the default border color/fill style for the receiver
defaultBorderWidth
answer the default border width for the receiver
defaultBounds
answer the default bounds for the receiver
defaultColor
answer the default color/fill style for the receiver
descending
descending:
extent:
includeInNewMorphMenu
initialize
initialize the state of the receiver
initializeSlider
mouseDownInSlider:
mouseUpInSlider:
pagingArea
roomToMove
scrollAbsolute:
setValue:
Called internally for propagation to model
sliderColor
color scheme for the whole slider widget
sliderColor:
sliderExtent
sliderShadowColor
sliderThickness
thumbColor
Color of the draggable 'thumb'
totalSliderArea
value
value:
Drive the slider position externally...
StandardFileMenu
I represent a SelectionMenu which operates like a modal dialog for selecting files, somewhat similar to the StandardFile dialogs in MacOS and Java Swing.
Try for example, the following:
StandardFileMenu oldFile inspect
StandardFileMenu oldFileStream inspect
StandardFileMenu newFile inspect
StandardFileMenu newFileStream inspect

(StandardFileMenu oldFileMenu: FileDirectory default withPattern: '*') startUpWithCaption: 'Select a file:'

(StandardFileMenu oldFileMenu: (FileDirectory default) withPatternList: {'*.txt'. '*.changes'}) startUpWithCaption: 'Select a file:'
advance:containingDirectoriesFrom:
computeLabelParagraph
Answer a Paragraph containing this menu's labels, one per line and centered.
confirmExistingFiles:
directoryNamesString:
Answer a string concatenating the directory name strings in aDirectory, each string followed by a '[...]' indicator, and followed by a cr.
fileNamesString:
Answer a string concatenating the file name strings in aDirectory, each string followed by a cr.
getTypedFileName:
makeFileMenuFor:
Initialize an instance of me to operate on aDirectory
menuLabelsString:
Answer a menu labels object corresponding to aDirectory
menuLinesArray:
Answer a menu lines object corresponding to aDirectory
menuSelectionsArray:
Answer a menu selections object corresponding to aDirectory. The object is an array corresponding to each item, each element itself constituting a two-element array, the first element of which contains a selector to operate on and the second element of which contains the parameters for that selector.
newFile
newFileFrom:
newFileFrom:withPattern:
newFileFrom:withPatternList:
newFileMenu:
newFileMenu:withPattern:
newFileMenu:withPatternList:
newFileStream
newFileStreamFrom:
oldFile
oldFileFrom:
oldFileFrom:withPattern:
oldFileFrom:withPatternList:
oldFileMenu:
oldFileMenu:withPattern:
oldFileMenu:withPatternList:
oldFileStream
oldFileStreamFrom:
pathPartsString:
Answer a string concatenating the path parts strings in aDirectory, each string followed by a cr.
pattern:
* for all files, or '*.cs' for changeSets, etc. Just like fileLists
patternList:
startUpWithCaption:at:
Display the menu, with caption if supplied. Wait for the mouse button to go down,
then track the selection as long as the button is pressed. When the button is released,
answer the index of the current selection, or zero if the mouse is not released over
any menu item. Location specifies the desired topLeft of the menu body rectangle.
StandardFileMenuResult
A StandardFileMenuResult is xxxxxxxxx.
Instance Variables
directory: <Object>
name: <Object>
directory
- xxxxx
name
- xxxxx
directory
directory:
directory:name:
isCommand
isDirectory
name
Answer a name for the receiver. This is used generically in the title of certain inspectors, such as the referred-to inspector, and specificially by various subsystems. By default, we let the object just print itself out..
name:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
StandardScriptingSystem
An instance of this is installed as the value of the global variable "ScriptingSystem". Client subclasses are invited, such as one used internally by squeak team for ongoing internal work.
applyNewEToyLook
deletePrivateGraphics
ScriptingSystem deletePrivateGraphics
deletePrivateGraphics:afterStoringToFileNamed:
This method is used to strip private graphics from the FormDictionary and store them on a file of the given name
formAtKey:
Answer the form saved under the given key
formAtKey:extent:depth:
ScriptingSystem saveForm: (TileMorph downPicture) atKey: 'downArrow'
formDictionary
helpStringOrNilFor:
If my HelpStrings dictionary has an entry at the given symbol,
answer that entry's value, else answer nil
privateGraphics
ScriptingSystem deletePrivateGraphics
prototypicalHolder
removePlayersIn:
removeUnreferencedPlayers
resetStandardPartsBin
ScriptingSystem resetStandardPartsBin
saveForm:atKey:
squeakyMouseForm
stripGraphicsForExternalRelease
ScriptingSystem stripGraphicsForExternalRelease
unload
StepMessage
A StepMessage is xxxxxxxxx.
Instance Variables
stepTime: <Object>
stepTime
- xxxxx
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
scheduledAt:stepTime:receiver:selector:arguments:
stepTime
Return the step time for this message. If nil, the receiver of the message will be asked for its #stepTime.
stepTime:
Set the step time for this message. If nil, the receiver of the message will be asked for its #stepTime.
StringMorph
StringMorph is a "lightweight" Morph to display a String. It supports only a single font, color, and emphasis combination. For multiple text styles, use TextMorph.
Structure:
instance var Type Description
font StrikeFont (normally nil; then the accessor #font gives back TextStyle
or nil defaultFont)
emphasis SmallInteger bitmask determining character attributes (underline, bold, italics, narrow, struckout)
contents String The text that will be displayed.
hasFocus Boolean Do I have the keyboard focus or not?
If you shift-click on a StringMorph you can edit its string. This is accomplished the following way: StringMorph can launch a StringMorphEditor if it receives a #mouseDown event.
A StringMorph may also be used like a SimpleButtonMorph to do an action when clicked. Use the menu 'extras' / 'add mouseUpAction'.
The following propery will be defined:
aStringMorph valueOfProperty: #mouseUpCodeToRun
acceptContents
The message is sent when the user hits enter or Cmd-S. Accept the current contents and end editing. This default implementation does nothing.
acceptValue:
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addOptionalHandlesTo:box:
areasRemainingToFill:
Pushed up from BorderedMorph, all cases tested for there are
supported by basic Morph.
authoringPrototype
boundsForBalloon
Some morphs have bounds that are way too big. This is a contorted way of making things work okay in PluggableListMorphs, whose list elements historically have huge widths
cancelEdits
changeEmphasis
changeFont
newFont := StrikeFont fromUser: self fontToUse.
contents
contents:
contents:font:
contents:font:emphasis:
contentsClipped:
Change my text, but do not change my size as a result
defaultColor
answer the default color/fill style for the receiver
doneWithEdits
drawOn:
emphasis:
Set the receiver's emphasis as indicated. aNumber is a bitmask with the following format:
bit attribute
1 bold
2 italic
4 underlined
8 narrow
16 struckOut
fitContents
fixUponLoad:seg:
We are in an old project that is being loaded from disk.
Fix up conventions that have changed.
font
who came up with #fontToUse rather than font?!
font:
Set the font my text will use. The emphasis remains unchanged.
font:emphasis:
fontName:size:
fontToUse
fullBounds
Return the bounding box of the receiver and all its children. Recompute the layout if necessary.
getCharacters
obtain a string value from the receiver.
handlesMouseDown:
If the shift key is pressed then yes.
As normal if the editableStringMorphs preference is false.
hasFocus
hasTranslucentColor
Answer true if this any of this morph is translucent but not transparent.
imageForm:forRectangle:
initWithContents:font:emphasis:
initialize
initialize the state of the receiver
initializeToStandAlone
Set up the receiver, created by a #basicNew and now ready to be initialized, as a fully-formed morph suitable for providing a graphic for a parts bin surrogate, and, when such a parts-bin surrogate is clicked on, for attaching to the hand as a viable stand-alone morph. Because of historical precedent, #initialize has been expected to handle this burden, though a great number of morphs actually cannot stand alone. In any case, by default we call the historical #initialize, though unhappily, so that all existing morphs will work no worse than before when using this protocol.
interimContents:
The receiver is under edit and aString represents the string the user sees as she edits, which typically will not have been accepted and indeed may be abandoned
launchMiniEditor:
lookTranslucent
keep the text the same color (black)
lostFocusWithoutAccepting
The message is sent when the user, having been in an editing episode on the receiver, changes the keyboard focus -- typically by clicking on some editable text somewhere else -- without having accepted the current edits.
measureContents
Round up in case fractional.
minHeight
Answer the minimum height of the receiver.
minimumWidth
Answer the minimum width that the receiver can have. A nonzero value here keeps the receiver from degenerating into something that cannot ever be seen or touched again! Obeyed by fitContents.
mouseDown:
If the shift key is pressed, make this string the keyboard input focus.
Process as normal if the editableStringMorphs preference is false.
paneColor
Answer the window's pane color or our owner's color otherwise.
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
setWidth:
Round up in case fractional.
test
test2
userString
Do I have a text string to be searched on?
valueFromContents
Return a new value from the current contents string.
wantsKeyboardFocusOnShiftClick
wouldAcceptKeyboardFocus
Answer whether a plain mouse click on the receiver should result in a text selection there
StringMorphAttributeScanner
A StringMorphAttributeScanner provides the interface of a CharacterScanner so that text attributes may be collected from a Text and used elsewhere, like in setting the attributes of a StringMorph.
actualFont
Answer the value of actualFont
addEmphasis:
Set the value of emphasis
addKern:
Set the current kern amount.
alignment
Answer the value of alignment
emphasis
Answer the value of emphasis
font
Answer the value of font
fontNumber
Answer the value of font
indent
Answer the value of indent
indentationLevel:
Set the value of indent
initialize
Subclasses should redefine this method to perform initializations on instance creation
initializeFromStringMorph:
kern
Answer the value of kern
setActualFont:
Set the value of actualFont, from a TextFontReference
setAlignment:
Set the value of alignment
setFont:
Set the value of font
textColor
Answer the value of textColor
textColor:
Set the value of textColor
textStyle
StringMorphEditor
I am a textMorph used as a pop-up editor for StringMorphs. I present a yellow background and I go away when a CR is typed or when the user clicks elsewhere.
drawOn:
Draw the receiver on a canvas.
Draw keyboard focus if appropriate.
includeInNewMorphMenu
initialize
Initialize the receiver. Give it a white background
keyStroke:
This is hugely inefficient, but it seems to work, and it's unlikely it will ever need
to be any more efficient -- it's only intended to edit single-line strings.
keyboardFocusChange:
Changed to update focus indication.
SystemProgressBarMorph
Instances of this morph get used by SystemProgressMoprh to quickly display a progress bar.
barFillStyle
Answer the fillStyle for the bar if present or
Preferences menuTitleColor otherwise.
barFillStyle:
Set the fillStyle for the bar.
barSize:
drawOn:
Draw the receiver with the fill style for the bar, clipping to the inner bounds.
extent:
Update the bar fillStyle if appropriate.
initialize
Initialize the receiver from the current theme.
privateMoveBy:
Update the bar fillStyle if appropriate.
SystemProgressMorph
An single instance of this morph class is used to display progress while the system is busy, eg. while it receives code updates or does a fileIn. To give the user progress information you don't deal directly with SystemProgressMorph. You keep on using the well established way of progress notification, that has been a long time in the system, is widely used and does not depend on the existence of SystemProgressMorph. For more information on this look at the example in this class or look at the comment of the method displayProgressAt:from:to:during: in class String.
SystemProgressMorph is not meant to be used as a component inside other morphs.
You can switch back to the old style of progress display by disabling the morphicProgressStyle setting in the morphic section of the preferences.
close:
dismissViaHalo
The user has clicked in the delete halo-handle. This provides a hook in case some concomitant action should be taken, or if the particular morph is not one which should be put in the trash can, for example.
example
freeSlot:
initialize
initialize the state of the receiver
label:min:max:
Answer the block that updates the progress bar.
morphicLayerNumber
progress morphs are behind menus and balloons, but in front of most other stuff
new
nextSlotFor:
reset
setDefaultParameters
slideToTrash:
If the user needs to dismiss a progress morph by hand, start with a
fresh instance next time.
updateColor:color:intensity:
update the apareance of aMorph
SystemWindow
SystemWindow is the Morphic equivalent of StandardSystemView -- a labelled container for rectangular views, with iconic facilities for close, collapse/expand, and resizing.
The attribute onlyActiveOnTop, if set to true (and any call to activate will set this), determines that only the top member of a collection of such windows on the screen shall be active. To be not active means that a mouse click in any region will only result in bringing the window to the top and then making it active.
aboutText
Answer the text to use for the About dialog.
aboutTitle
Answer the title to use for the About dialog.
activate
Activate the owner too.
activateAndForceLabelToShow
activeFillStyle
Return the active fillStyle for the receiver.
activeLabelFillStyle
Return the active label fillStyle for the receiver.
activeOnlyOnTop
activeOnlyOnTop:
activeTitleFillStyle
Return the active title fillStyle for the receiver.
addCloseBox
If I have a labelArea, add a close box to it
addCollapseBox
If I have a labelArea, add a collapse box to it.
addCornerGrips
Should add these to the front!
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addEdgeGrips
Should add these to the front!
addExpandBox
If I have a labelArea, add a close box to it
addGrips
Add the edge and corner grips.
addGripsIfWanted
Add the edge and corner grips if the window wants them.
addLabelArea
addMenuControl
If I have a label area, add a menu control to it.
addMorph:frame:
addMorph:fullFrame:
Add a morph to the receiver with the given layout frame.
addPaneHSplitterBetween:and:
Add a horizontal splitter for the given morphs that share a common bottom fraction.
If there is a horizontal discontinuity apply the splitter to the first contiguous group.
Answer the morphs to which the splitter was applied.
addPaneHSplitters
Add the horizontal pane splitters.
addPaneSplitters
Add the vertical and horizontal pane splitters.
addPaneVSplitterBetween:and:
Add a vertical splitter for the given morphs that share a common right fraction.
If there is a vertical discontinuity apply the splitter to the first contiguous group.
Answer the morphs to which the splitter was applied.
addPaneVSplitters
Add the vertical pane splitters.
adjustBorderUponActivationWhenLabeless
Adjust the border upon, um, activation when, um, labelless
adjustBorderUponDeactivationWhenLabeless
Adjust the border upon deactivation when, labelless
allowedToClose
Answer whether the window is currently allowed to close.
amendSteppingStatus
Circumstances having changed, find out whether stepping is wanted and assure that the new policy is carried out
animateClose
Animate closing.
animateMaximize
Animate maximizing from restored.
animateMinimize
Animate minimizing.
animateRectangles:doing:
Animate the given rectangles.
animateRestore
Animate restoring from maximised.
animateRestoreFromMinimized
Animate restoring from minimised.
applyModelExtent
areasRemainingToFill:
Pushed up from BorderedMorph, all cases tested for there are
supported by basic Morph.
basicActivate
Bring me to the front and make me able to respond to mouse and keyboard.
Was #activate (sw 5/18/2001 23:20)
basicLabel
Answer the actual label morph.
basicTaskThumbnailOfSize:
Answer a new task thumbnail for the receiver.
beWithGrips
Add the grips and set a property to
indicate that grips are wanted.
beWithoutGrips
Remove the grips and set a property to
indicate that grips are not wanted.
borderWidth
boxExtent
answer the extent to use in all the buttons.
The label height is used to be proportional to the fonts preferences
bringBehind:
Make the receiver be directly behind the given morph.
Take into account any modal owner and propagate.
buildWindowMenu
Build and answer the window menu.
canBeMaximized
Answer whether we are not we can be maximised.
changeColor
Change the color of the receiver -- triggered, e.g. from a menu. This variant allows the recolor triggered from the window's halo recolor handle to have the same result as choosing change-window-color from the window-title menu
classVersion
closeBoxHit
The user clicked on the close-box control in the window title.
For Mac users only, the Mac convention of option-click-on-close-box is obeyed if the mac option key is down.
If we have a modal child then don't delete.
Play the close sound now since this is the only time we know that the close is user-initiated.
closeBoxImage
closeTopWindow
collapse
collapseBoxHit
The user has clicked on the collapse box.
Collapse or expand the receiver as appropriate.
collapseBoxImage
collapseOrExpand
Collapse or expand the window, depending on existing state.
Use the taskbar if present, otherwise do as normal.
collapsedFrame
colorForInsets
Return the color to be used for shading inset borders.
convertAlignment
Primarily Jesse Welton's code to convert old system windows to ones with modern layout scheme
createBox
create a button with default to be used in the label area
createCloseBox
Answer a button for closing the window.
createCollapseBox
Answer a button for minimising the window.
createExpandBox
Answer a button for maximising/restoring the window.
createMenuBox
Answer a button for the window menu.
defaultBackgroundColor
Answer the color to be used as the base window color.
defaultBorderColor
answer the default border color/fill style for the receiver
defaultColor
answer the default color/fill style for the receiver
delete
Should activate window before asking model if okToChange
since likely that a confirmation dialog will be requested.
Don't if not owned by the world though.
deleteCloseBox
doFastFrameDrag:
Do fast frame dragging from the given point
doFastWindowReframe:
For fast display, only higlight the rectangle during loop
doubleClick:
Handle a double click. Maximize/restore the window.
Works in title bar area.
doubleClickTimeout:
Forget the #inactiveDoubleClick property.
The property is set if an inactive window was double-clicked.
drawDropShadowOn:
Get the theme to draw the drop shawdow for the receiver.
existingPaneColor
Answer the existing pane color for the window, obtaining it from the first paneMorph if any, and fall back on using the second stripe color if necessary.
expand
expandBoxHit
The full screen expand box has been hit
expandBoxImage
extantSketchEditor
If my world has an extant SketchEditorMorph associated with anything
in this window, return that SketchEditor, else return nil
extent:
Set the receiver's extent to value provided. Respect my minimumExtent.
externalName
Answer the name by which the receiver is known in the UI
fastAnimateRectangles:
Animate the given rectangles using the fast method.
fastFramingOn
fillStyleToUse
Answer the basic fill style for the receiver.
fullFrame
fullScreen
Zoom Window to Full World size with possible DeskMargins
fullScreenBounds
Answer the bounds that the receiver would tak if expanded to full screen.
fullScreenMaximumExtent
Zoom Window to Full World size with possible DeskMargins
obey the maximum extent rules
getBoundsWithFlex
Return the lastest bounds rectangle with origin forced to global coordinates
getCollapsedFrame
getRawLabel
Owner is needed by Preferences class>>refreshFontSettings and
the #duplicate class is rather time consuming with Freetype fonts.
Answer a shallowCopy of the label with the contents fitted.
gradientWithColor:
handleListenEvent:
Make sure we lock our contents after DnD has finished
handlesDropShadowInHand
Answer whether the receiver will handle drop shadow drawing when picked up in the hand.
handlesKeyboard:
Return true if the receiver wishes to handle the given keyboard event
handlesMouseDown:
If I am not the topWindow, then I will only respond to dragging by the title bar.
Any other click will only bring me to the top
handlesMouseOverDragging:
Return true if I want to receive mouseEnterDragging: and mouseLeaveDragging: when the hand drags something over me (button up or button down), or when the mouse button is down but there is no mouseDown recipient. The default response is false, except if you have added sensitivity to mouseEnterLaden: or mouseLeaveLaden:, using the on:send:to: mechanism.
hasCloseBox
Answer whether the receiver currently has a close box.
hasCollapseBox
Answer whether the receiver currently has a collapse box.
hasExpandBox
Answer whether the receiver currently has an expand box.
hasMenuBox
Answer whether the receiver currently has a menu box.
holdsTranscript
ugh
icon
Answer a form with an icon to represent the receiver
inactiveFillStyle
Return the active fillStyle for the receiver.
inactiveLabelFillStyle
Return the inactive label fillStyle for the receiver.
inactiveTitleFillStyle
Return the inactive title fillStyle for the receiver.
includeInNewMorphMenu
indicateModalChild
Make the user aware that this is the topmost modal child
by flashing.
initialExtent
Answer the desired extent for the receiver when a view on it is first opened on the screen.
5/22/96 sw: in the absence of any override, obtain from RealEstateAgent
initialize
Initialize a system window. Add label, stripes, etc., if desired
initializeLabelArea
Initialize the label area (titlebar) for the window.
isActive
Answer active if no owner too to avoid color flickering.
isCollapsed
isMaximized
Answer whether we are maximised.
isMinimized
Answer whether we are minimised.
isNotMaximized
Answer whether we are not maximised.
isNotMinimized
Answer whether we are not minimised.
isNotRestored
Answer whether we are maximised or minimised.
isRestored
Answer whether we are neither expanded or collapsed.
isSystemWindow
answer whatever the receiver is a SystemWindow
isTaskbarPresent
Answer whether there is a taskbar in the world.
justDroppedInto:event:
Release the mouse focus as well.
keyStroke:
Check for close window.
label
labelArea
Answer the label area.
labelHeight
Answer the height for the window label. The standard behavior is at bottom; a hook is provided so that models can stipulate other heights, in support of various less-window-looking demos.
If no label answer the class border width instead.
labelRect
labelString
Answer the actual label string.
labelWidgetAllowance
labelled:
layoutBounds
Bounds of pane area only.
layoutChanged
No need to propagate to the world.
Fixed to always flush layout cache.
linkSplittersToSplitters
The pane morphs are already linked. Cross link the splitters as appropriate.
lockInactivePortions
Make me unable to respond to mouse and keyboard. Control boxes remain active.
makeClosable
Reinstate the close box. Go via theme to maintain box order.
makeMeVisible
makeSecondTopmost
makeUnclosable
maximize
Maximise the receiver. If collapsed the uncollapse first.
maximumExtent
This returns the maximum extent that the morph may be expanded to.
Return nil if this property has not been set.
maximumExtent:
This returns the maximum extent that the morph may be expanded to.
Return nil if this property has not been set.
menuBox
Answer the receiver's menu box.
menuBoxImage
minimize
Minimise the receiver.
minimizeAfterGeneratingThumbnail
Minimize the window after thumbnail generation.
minimizeOrRestore
Collapse or expand the window, depending on existing state
modalChild
Answer the modal child of the receiver, if any.
modalLockTo:
Lock the receiver as a modal owner of the given window.
modalOwner
Answer the modal owner of the receiver, if any.
modalUnlockFrom:
Unlock the receiver as a modal owner of the given window.
model:
Set the model.
mouseDown:
Changed to properly process the mouse down event if passing to
submorphs.
mouseEnterDragging:
unlock children for drop operations
mouseLeaveDragging:
lock children after drop operations
mouseLeaveEvent:fromPane:
For backward compatibility only. Not used by any newly created window
mouseMove:
Handle a mouse-move event
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
mustNotClose
navigateFocusForward
Change the keyboard focus to the next morph or the receiver
in none are interested.
navigationKey:
Check for tab key activity and change focus as appropriate.
Check for menu key to do popup.
Check for active window naviagation.
nextMorphAcrossInWindow
Answer the next morph in the window. Traverse
from the receiver to its next sibling or owner's next sibling etc.
nextMorphInWindow
Answer the next morph in the window. Traverse
from the receiver to its first pane.
noteTopWindowIn:
offerWindowMenu
openAsIs
openAsIsIn:
This msg and its callees result in the window being activeOnlyOnTop.
Play the open sound if the preference is enabled.
openInWorld:
This msg and its callees result in the window being activeOnlyOnTop
openInWorld:extent:
This msg and its callees result in the window being activeOnlyOnTop
openInWorldExtent:
This msg and its callees result in the window being activeOnlyOnTop
openModal:
Open the given window locking the receiver until it is dismissed.
Set the pane color to match the receiver.
Answer the system window.
paneColor
Answer the window's pane color or our color otherwise.
paneColor:
Explicitly set the pane color for the reveiver.
paneColorOrNil
Answer the window's pane color or nil otherwise.
paneColorToUse
paneColorTracksModel
Answer true if the colour of the window should be taken from the model.
paneMorphSatisfying:
paneMorphs
Nominally private but a need for obtaining this from the outside arose
paneTransition:
Mouse has entered or left a pane
paneWithLongestSide:near:
panelRect
Answer the area below the title bar which is devoted to panes.
passivate
Make me unable to respond to mouse and keyboard
playCloseSound
Play the themed sound for closing.
playMaximizeSound
Play the themed sound for maximizing.
playMinimizeSound
Play the themed sound for maximizing.
playOpenSound
Play the themed sound for opening.
playRestoreDownSound
Play the themed sound for restoring from maximized.
playRestoreUpSound
Play the themed sound for restoring from minimized.
position:
Change the position of this morph and and all of its
submorphs.
positionSubmorphs
Feels like overkill, but effect needed
preferredCornerStyle
Answer the preferred corner style.
previousMorphInWindow
Answer the previous morph in the window. This will be the
last submorph recursively of the first pane morph.
putLabelItemsInLabelArea
Put label items into the label area, if there is one
raisedColor
Return the color to be used for shading raised borders. The
default is my own color, but it might want to be, eg, my
owner's color. Whoever's color ends up prevailing, the color
itself gets the last chance to determine, so that when, for
example, an InfiniteForm serves as the color, callers won't choke
on some non-Color object being returned
reframePanesAdjoining:along:to:
relabel
rememberKeyboardFocus:
Record the current keyboard focus for the receiver.
rememberedKeyboardFocus
Answer the remembered keyboard focus for the receiver.
removeBoxes
Remove all label area boxes.
removeCloseBox
Remove the close box.
removeCollapseBox
Remove the collapse box.
removeEdgeGrips
Remove the window edge grips.
removeExpandBox
Remove the expand box.
removeGrips
Remove the edge and corner grips.
removeLabelArea
Remove the entire label area.
removeMenuBox
replaceBoxes
Rebuild the various boxes.
replacePane:with:
Make newPane exactly occupy the position and extent of oldPane
requestor
returns the focused window's requestor
resetCollapsedFrame
Reset the collapsed frame.
resetForms
restore
Restore the receiver's normal size.
restoreAndActivate
Restore the window if minimised then activate.
restoreBeforeGeneratingThumbnail
Restore the window without activating unlocking or stepping.
restoreDefaultPaneColor
Useful when changing from monochrome to color display
scrollBarColor
secondaryPaneTransition:divider:
Mouse has entered or left a pane
sendToBack
sendTopWindowToBack
setBoundsWithFlex:
Set bounds from newFrame with origin preserved from global coordinates
setExpandBoxBalloonText
Set the expand box balloon help text as appropriate.
setFramesForLabelArea
Set the layout for the label area.
setLabel:
setLabelFont:
setLabelWidgetAllowance
Set the extra space required, in general, apart from the label.
Should make theme based (for centered titles), leave enough room
for the moment.
setPaneRectsFromBounds
Reset proportional specs from actual bounds, eg, after reframing panes
setStripeColorsFrom:
Set the stripe color based on the given paneColor.
Removed box color update for Pharo compatability.
setUpdatablePanesFrom:
Set my updatablePanes inst var to the list of panes which are list panes with the given get-list selectors. Order is important here! Note that the method is robust in the face of panes not found, but a warning is printed in the transcript in each such case
setWindowColor
Allow the user to select a new basic color for the window
setWindowColor:
Removed existing color check - looked useless!
shadowOffsetRectangle
Answer a rectangle describing the offsets to the
receiver's bounds for a drop shadow.
shouldDropOnMouseUp
Return true for consistency with fastdrag
showAbout
Show the class comment of the model in a workspace.
Suggested by Michael Davies.
stepAt:
If the receiver is not collapsed, step it, after first stepping the model.
stepTime
Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.
takeOutOfWindow
Take the receiver's pane morph out the window and place it, naked, where once the window was
taskThumbnailOfSize:
Answer a new task thumbnail for the receiver.
taskbarButtonClicked
The taskbar button for the receiver has been clicked.
If minimised then restore.
If active then minimize.
Otherwise make active.
taskbarButtonEntered:event:in:
The mouse has entered out taskbar button.
Show a thumbnail.
taskbarButtonFor:
Answer a new task bar button for the receiver.
Answer nil if not required.
taskbarButtonLeft:event:in:
The mouse has left our taskbar button.
Remove our thumbnail.
taskbarButtonMenu:
Answer the menu for the task bar button.
taskbarIcon
Answer the icon for the receiver in a task bar.
taskbarLabel
Answer the label to use for a taskbar button for the receiver.
taskbarState
Answer one of #minimized, #restored, #maximized or #active.
taskbarTask
Answer a new taskbar task for the receiver.
Answer nil if not required.
taskbarThumbnailExtent
Answer the size of a taskbar thumbnail for the receiver.
theme
Answer the ui theme that provides controls.
Don't call super since that implementation may delegate here.
themeChanged
Update the window colour and control boxes.
titleAndPaneText
If the receiver represents a workspace, return an Association between the title and that text, else return nil
toggleVisibleAndRaise
Toggle the visibility of the receiver, bringing to
the front if becoming visible. Activate or passivate here.
topWindow
unexpandedFrame
Return the frame size of an unexpanded window
unexpandedFrame:
Set the frame size of an unexpanded window
updatablePanes
Answer the list of panes, in order, which should be sent the #verifyContents message
update:
Receive a change notice from an object of whom the receiver is a
dependent. The default behavior is to do nothing; a subclass might want
to change itself in some way.
updatePaneColors
Useful when changing from monochrome to color display
updatePanesFromSubmorphs
Having removed some submorphs, make sure this is reflected in my paneMorphs.
wakeUpTopWindowUponStartup
wantsExpandBox
Answer whether I'd like an expand box
wantsGrips
Answer whether the window wants edge and corner grips.
wantsHalo
wantsRoundedCorners
Answer whether rounded corners are wanted.
wantsSteps
Return true if the model wants its view to be stepped. For an open system window, we give the model to offer an opinion
wantsStepsWhenCollapsed
Default is not to bother updating collapsed windows
wantsToBeCachedByHand
Return true if the receiver wants to be cached by the hand when it is dragged around.
wantsToBeDroppedInto:
Return true if it's okay to drop the receiver into aMorph
wantsYellowButtonMenu
Answer true if the receiver wants a yellow button menu
widthOfFullLabelText
window
Answer the receiver's window.
windowsIn:satisfying:
worldTaskbar
Answer the world taskbar or nil if none.
SystemWindowWithButton
A SystemWindow with a single extra button in its title bar.
adjustExtraButton
buttonInTitle:
extent:
Set the receiver's extent to value provided. Respect my minimumExtent.
setLabelWidgetAllowance
Set the extra space required, in general, apart from the label.
Should make theme based (for centered titles), leave enough room
for the moment.
wantsExpandBox
Answer whether I'd like an expand box
TTSampleFontMorph
An example for using TrueType fonts.
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addOptionalHandlesTo:box:
areasRemainingToFill:
Pushed up from BorderedMorph, all cases tested for there are
supported by basic Morph.
balloonHelpTextForHandle:
Answer a string providing balloon help for the
given halo handle
canDrawBorder:
Return true if the receiver can be drawn with the given border style.
changed
Report that the area occupied by this morph should be redrawn.
Fixed to include submorphs outside the outerBounds.
computeTransform
createSample
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
doesBevels
To return true means that this object can show bevelled borders, and
therefore can accept, eg, #raised or #inset as valid borderColors.
Must be overridden by subclasses that do not support bevelled borders.
drawCharactersOn:
drawOn:
extent:
font
font:
fontWithoutString:
getSmoothingLevel
Menu support
glyphAt:
glyphIndexAt:
initialize
initialize the state of the receiver
newTransformationMorph
nextSmoothingLevel
open
openInWorld
Add this morph to the world.
position:
Change the position of this morph and and all of its
submorphs.
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
privateMoveBy:
Private! Use 'position:' instead.
selectGlyph
Modal glyph selector
selectGlyphAndSendTo:
selectGlyphBlock:event:from:
smoothing
smoothing:
transform
veryDeepFixupWith:
If fields were weakly copied, fix them here. If they were in the
tree being copied, fix them up, otherwise point to the originals!!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all,
but shared. Warning!! Every instance variable defined in this class
must be handled. We must also implement veryDeepFixupWith:.
See DeepCopier class comment.
TTSampleStringMorph
I allow the display of a string in a TrueType font as a stand-alone morph.
Morph's color changes the inside of the characters.
Morph's borderColor changes the outline.
Many free fonts are stored at www.FontGuy.com.
Use a normal web browser (not our Scamper) and go there.
Choose 'categories' and browse to a font you like.
Hold the mouse down on the example text in that font.
When the menu comes up, choose "Copy this link location".
Come back into Squeak, choose "load font from web..."
from my menu, and paste in the url.
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addOptionalHandlesTo:box:
computeTransform
containsPoint:
^ super containsPoint: aPoint
defaultBorderWidth
answer the default border width for the receiver
defaultColor
answer the default color/fill style for the receiver
drawOn:
edit
Allow the user to change the text in a crude way
font:
howTo
initializeString
initializeToStandAlone
Make me into an example
loadFromURL
Allow the user to change the text in a crude way
loadFromURL:
Fetch the file, unarchive, unzip, and use as my font.
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
string
string:
TableLayout
The layout process:
For computing the new layout for the children of any morph, we start with an initial rectangle which is provided as a reference.
Step 1: The first step of layout computation is to compute the minimum extent each of our children can have. The minimum extent is mapped through both the local layout frame of the morph (for relative positioning) and the global layout frame (for insets, such as cursor indication) to obtain the minimal size required for each cell.
Step 2: Based on the cell sizes, the number of cells we can put into each row and column is computed. For equal spacing, the maximum size of the cells is taken into account here.
Step 3: Based on the row/column sizes, we compute the extra space which should be added to each row/column. For
#leftFlush/#topFlush - we add all extra space add the end
#rightFlush/#bottomFlush - we add all extra space at the start
#centering - we add 1/2 of the extra space at start and end
#justified - we distribute the space evenly between the morphs
[NOTE: If any #spaceFill morphs are encountered during this step, #justified is implied and the space is exclusively and equally distributed between those #spaceFill morphs. This is for backward compatibility and should *never* be necessary in the new regime].
Step 4: The morphs are placed in the computed cells and the extra space is distributed as necessary. Placing the submorphs is done by mapping through the global and the local layout frame as requested.
Start point:
=> bounds: new rectangle for the morph.
Compute basic arrangement of morphs:
=> For each submorph compute minExtent
- if global layout frame inset in global layout frame
- if local layout frame inset in local layout frame
=> Compute number of morphs per, width and height of row/column
- if equal spacing based on max size
=> Compute extra space per row/column
- if centering = #justified; distribute space equally
- if centering #leftFlush/#topFlush (-1) add start extra
- if centering #rightFlush/#bottomFlush (1) add end extra
- if centering #centered add 1/2 extra to start/end
<extra space must be float and rounded accordingly!>
=> Place morphs in appropriate cells
- if global layout frame inset in global layout frame
- if local layout frame inset in local layout frame
<will likely cause #layoutChanged by submorphs>
Distribute morphs in row/column:
=> Compute the max length of each row/column
computeCellArrangement:in:horizontal:target:
Compute number of cells we can put in each row/column. The returned array contains a list of all the cells we can put into the row/column at each level.
Note: The arrangement is so that the 'x' value of each cell advances along the list direction and the 'y' value along the wrap direction. The returned arrangement has an extra cell at the start describing the width and height of the row.
computeCellSizes:in:horizontal:
Step 1: Compute the minimum extent for all the children of aMorph
computeExtraSpacing:in:horizontal:target:
Compute the required extra spacing for laying out the cells
computeGlobalCellArrangement:in:horizontal:wrap:spacing:
Compute number of cells we can put in each row/column. The returned array contains a list of all the cells we can put into the row/column at each level.
Note: The arrangement is so that the 'x' value of each cell advances along the list direction and the 'y' value along the wrap direction. The returned arrangement has an extra cell at the start describing the width and height of the row.
flushLayoutCache
Flush any cached information associated with the receiver
indexForInserting:at:in:
Return the insertion index based on the layout strategy defined for some morph. Used for drop insertion.
indexForInserting:inList:horizontal:target:
isTableLayout
layout:in:
Compute the layout for the given morph based on the new bounds
layoutLeftToRight:in:
An optimized left-to-right list layout
layoutTopToBottom:in:
An optimized top-to-bottom list layout
minExtentHorizontal:
Return the minimal size aMorph's children would require given the new bounds
minExtentOf:in:
Return the minimal size aMorph's children would require given the new bounds
minExtentVertical:
Return the minimal size aMorph's children would require given the new bounds
placeCells:in:horizontal:target:
Place the morphs within the cells accordingly
TableLayoutProperties
A TableLayoutProperties is xxxxxxxxx.
Instance Variables
cellInset: <Object>
cellPositioning: <Object>
cellSpacing: <Object>
layoutInset: <Object>
listCentering: <Object>
listDirection: <Object>
listSpacing: <Object>
maxCellSize: <Object>
minCellSize: <Object>
reverseTableCells: <Object>
rubberBandCells: <Object>
wrapCentering: <Object>
wrapDirection: <Object>
cellInset
- xxxxx
cellPositioning
- xxxxx
cellSpacing
- xxxxx
layoutInset
- xxxxx
listCentering
- xxxxx
listDirection
- xxxxx
listSpacing
- xxxxx
maxCellSize
- xxxxx
minCellSize
- xxxxx
reverseTableCells
- xxxxx
rubberBandCells
- xxxxx
wrapCentering
- xxxxx
wrapDirection
- xxxxx
cellInset
Default
cellInset:
cellPositioning
cellPositioning:
cellSpacing
Default
cellSpacing:
includesTableProperties
initialize
Subclasses should redefine this method to perform initializations on instance creation
layoutInset
layoutInset:
listCentering
Default
listCentering:
listDirection
Default
listDirection:
listSpacing
Default
listSpacing:
maxCellSize
maxCellSize:
minCellSize
minCellSize:
reverseTableCells
reverseTableCells:
rubberBandCells
rubberBandCells:
wrapCentering
wrapCentering:
wrapDirection
wrapDirection:
TextAnchor
TextAnchors support anchoring of images in text. A TextAnchor exists as an attribute of text emphasis, and it gets control like a FontReference, through the emphasizeScanner: message. Depending on whether its anchoredMorph is a Morph or a Form, it repositions the morph, or displays the form respectively. The coordination between composition, display and selection can best be understood by browsing the various implementations of placeEmbeddedObject:.
In the morphic world, simply embed any form or morph in text.
Workspace new
contents: (Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) , (Text withAll: 'bar');
openLabel: 'Text with Form'.
Workspace new
contents: (Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar');
openLabel: 'Text with Morph'.
In this case you select a piece of the screen, and it gets anchored to a one-character text in the editor's past buffer. If you then paste into some other text, you will see the image as an embedded image.
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
anchoredMorph
If one hides here, return it
anchoredMorph:
emphasizeScanner:
Subclasses may override to set, eg, font, color, etc
hash
#hash is re-implemented because #= is re-implemented
mayBeExtended
A textAnchor is designed to modify only a single character, and therefore must not be extended by the ParagraphEditor's emphasisHere facility
printHtmlOpenTagOn:
do nothing for now
TextComposer
A TextComposer is xxxxxxxxx.
Instance Variables
actualHeight: <Object>
currCharIndex: <Object>
currentY: <Object>
defaultLineHeight: <Object>
deltaCharIndex: <Object>
isFirstLine: <Object>
lines: <Object>
maxRightX: <Object>
nowSliding: <Object>
possibleSlide: <Object>
prevIndex: <Object>
prevLines: <Object>
scanner: <Object>
startCharIndex: <Object>
stopCharIndex: <Object>
theContainer: <Object>
theText: <Object>
theTextStyle: <Object>
wantsColumnBreaks: <Object>
actualHeight
- xxxxx
currCharIndex
- xxxxx
currentY
- xxxxx
defaultLineHeight
- xxxxx
deltaCharIndex
- xxxxx
isFirstLine
- xxxxx
lines
- xxxxx
maxRightX
- xxxxx
nowSliding
- xxxxx
possibleSlide
- xxxxx
prevIndex
- xxxxx
prevLines
- xxxxx
scanner
- xxxxx
startCharIndex
- xxxxx
stopCharIndex
- xxxxx
theContainer
- xxxxx
theText
- xxxxx
theTextStyle
- xxxxx
wantsColumnBreaks
- xxxxx
addNullLineForIndex:
This awful bit is to ensure that if we have scanned all the text and the last character is a CR that there is a null line at the end of lines. Sometimes this was not happening which caused anomalous selections when selecting all the text. This is implemented as a post-composition fixup because I couldn't figure out where to put it in the main logic.
addNullLineWithIndex:andRectangle:
characterForColumnBreak
checkIfReadyToSlide
Check whether we are now in sync with previously composed lines
composeAllLines
composeAllRectangles:
composeEachRectangleIn:
composeLinesFrom:to:delta:into:priorLines:atY:textStyle:text:container:wantsColumnBreaks:
composeOneLine
fixupLastLineIfCR
This awful bit is to ensure that if we have scanned all the text and the last character is a CR that there is a null line at the end of lines. Sometimes this was not happening which caused anomalous selections when selecting all the text. This is implemented as a post-composition fixup because I couldn't figure out where to put it in the main logic.
slideOneLineDown
Having detected the end of rippling recoposition, we are only sliding old lines
TextContainer
A TextContainer models the shape of an ownerMorph, possibly occluded by one or more occludingMorphs, and scans this shape to provide a list of rectangles suitable for layout of text. It does this by displaying the shadow of the ownerMorph in black, and any occludingMorphs in white, on its shadowForm. It then scans horizontal strips of appropriate height to find unbroken intervals of black, greater than minWidth in extent. Conputation of the rectangles is done on demand, and results are cached so that text can be redisplayed without having to recompute the rectangles.
avoidsOcclusions
avoidsOcclusions:
bottom
Note we should really check for contiguous pixels here
bounds
computeShadow
fillsOwner
fillsOwner:
for:minWidth:
initialize
Subclasses should redefine this method to perform initializations on instance creation
left
paragraphClass
rectanglesAt:height:
Return a list of rectangles that are at least minWidth wide
in the specified horizontal strip of the shadowForm.
Cache the results for later retrieval if the owner does not change.
releaseCachedState
shadowForm
textMorph
top
Note we should really check for contiguous pixels here
topLeft
for compatibility
translateBy:
vertProfile
width
for compatibility
TextFieldMorph
Act as a field in a HyperCard-like setting. Has both properties of a Rectangle, and exposes some proteries of the TextMorph it owns.
append:
add to my text
authoringPrototype
contents
talk to my text
contents:
talk to my text
defaultColor
answer the default color/fill style for the receiver
exampleBackgroundField
fit
tell my text to recompute its looks
fontName:size:
talk to my text
initialize
initialize the state of the receiver
lineCount
how many lines in my text
prepend:
add to my text
registerInFlapsRegistry
unload
TextLine
A TextLine embodies the layout of a line of composed text.
left right top bottom The full line rectangle
firstIndex lastIndex Starting and stopping indices in the full text
internalSpaces Number of spaces to share paddingWidth
paddingWidth Number of pixels of extra space in full line
baseline Distance of baseline below the top of the line
leftMargin Left margin due to paragraph indentation
TextLine's rather verbose message protocol is required for compatibility with the old CharacterScanners.
=
Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.
baseline
bottom
bottomRight
first
firstIndex:lastIndex:
hash
#hash is re-implemented because #= is re-implemented
internalSpaces
Answer the number of spaces in the line.
internalSpaces:
Set the number of spaces in the line to be spacesInteger.
internalSpaces:paddingWidth:
justifiedPadFor:
Compute the width of pad for a given space in a line of justified text.
justifiedPadFor:font:
Compute the width of pad for a given space in a line of justified text.
justifiedTabDeltaFor:
Compute the delta for a tab in a line of justified text, so tab falls
somewhere plausible when line is justified.
last
left
leftMargin
This has to get fixed -- store during composition
leftMargin:
leftMarginForAlignment:
lineHeight
lineHeight:baseline:
moveBy:
Move my rectangle by the given delta
paddingWidth
Answer the amount of space to be added to the font.
paddingWidth:
Set the amount of space to be added to the font to be padWidthInteger.
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
rectangle
rectangle:
right
rightMargin
This has to get fixed -- store during composition
setRight:
slide:
Change the starting and stopping points of the line by delta.
slideIndexBy:andMoveTopTo:
Relocate my character indices and y-values.
Used to slide constant text up or down in the wake of a text replacement.
start:stop:internalSpaces:paddingWidth:
stop:
Set the stopping point in the string of the line to be stopInteger.
top
topLeft
width
TextMorph
TextMorphs support display of text with emphasis. They also support reasonable text-editing capabilities, as well as embedded hot links, and the ability to embed submorphs in the text.
Late in life, TextMorph was made a subclass of BorderedMorph to provide border and background color if desired. In order to keep things compatible, protocols have been redirected so that color (preferably textColor) relates to the text, and backgroundColor relates to the inner fill color.
Text display is clipped to the innerBounds of the rectangle, and text composition is normally performed within a rectangle which is innerBounds inset by the margins parameter.
If text has been embedded in another object, one can elect to fill the owner's shape, in which case the text will be laid out in the shape of the owner's shadow image (including any submorphs other than the text). One can also elect to have the text avoid occlusions, in which case it will avoid the bounds of any sibling morphs that appear in front of it. It may be necessary to update bounds in order for the text runaround to notice the presence of a new occluding shape.
The optional autoFitContents property enables the following feature: if the text contents changes, then the bounds of the morph will be adjusted to fit the minimum rectangle that encloses the text (plus any margins specified). Similarly, any attempt to change the size of the morph will be resisted if this parameter is set. Except...
If the wrapFlag parameter is true, then text will be wrapped at word boundaries based on the composition width (innerBounds insetBy: margins) width. Thus an attempt to resize the morph in autofit mode, if it changes the width, will cause the text to be recomposed with the new width, and then the bounds will be reset to the minimum enclosing rectangle. Similarly, if the text contents are changed with the wrapFlag set to true, word wrap will be performed based on the current compostion width, after which the bounds will be set (or not), based on the autoFitcontents property.
Note that fonts can only be applied to the TextMorph as a whole. While you can change the size, color, and emphasis of a subsection of the text and have it apply to only that subsection, changing the font changes the font for the entire contents of the TextMorph.
Still a TextMorph can be composed of several texts of different fonts
| font1 font2 t1 t2 tMorph|
tMorph _ TextMorph new.
font1 _ (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 22)).
font2 _ (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 11)).
t1 _ 'this is font1' asText addAttribute: font1.
t2 _ ' and this is font2' asText addAttribute: font2.
tMorph contents: (t1,t2).
tMorph openInHand.
Yet to do:
Make a comprehensive control for the eyedropper, with border width and color, inner color and text color, and margin widths.
acceptContents
The message is sent when the user hits enter or Cmd-S.
Accept the current contents and end editing.
This default implementation does nothing.
acceptDroppingMorph:event:
This message is sent when a morph is dropped onto me.
acceptOnCR
Answer whether the receiver wants to accept when the Return key is hit. Generic TextMorph has no such feature, but subclasses may.
addCustomMenuItems:hand:
Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.
addMorphFront:fromWorldPosition:
Overridden for more specific re-layout and positioning
addPredecessor:
addSuccessor:
adjustLineIndicesBy:
adjustTextAnchor:
Later compute the new relative position of aMorph if it is #paragraph anchored.
anchorMorph:at:type:
areasRemainingToFill:
Overridden from BorderedMorph to test backgroundColor instead of (text) color.
asHttpResponseTo:
asText
authoringPrototype
autoFit:
autoFitOnOff
autoFitString
Answer the string to put in a menu that will invite the user to
switch autoFit mode
avoidsOcclusions
backgroundColor
backgroundColor:
basicType
Answer a symbol representing the inherent type I hold
beAllFont:
blinkStart
Reset time for blink cursor after which blinking should actually start
blinkStart:
Reset time for blink cursor after which blinking should actually start
boldAuthoringPrototype
borderWidth:
borderedPrototype
bounds
Return the bounds of this morph.
cancelEdits
The message is sent when the user hits enter or Cmd-L.
Cancel the current contents and end editing.
This default implementation does nothing.
centered
changeMargins:
chooseAlignment
chooseEmphasis
chooseEmphasisOrAlignment
chooseFont
chooseStyle
clippingRectangle
composeToBounds
Compose my text to fit my bounds.
If any text lies outside my bounds, it will be clipped, or
if I have successors, it will be shown in the successors.
compositionRectangle
container
Return the container for composing this text. There are four cases:
1. container is specified as, eg, an arbitrary shape,
2. container is specified as the bound rectangle, because
this morph is linked to others,
3. container is nil, and wrap is true -- grow downward as necessary,
4. container is nil, and wrap is false -- grow in 2D as nexessary.
containsPoint:
contents
contents:
contents:wrappedTo:
Accept new text contents. Lay it out, wrapping to width.
Then fit my height to the result.
contentsAsIs:
Accept new text contents with line breaks only as in the text.
Fit my width and height to the result.
contentsWrapped:
Accept new text contents. Lay it out, wrapping within my current width.
Then fit my height to the result.
copy
Answer another instance just like the receiver. Subclasses typically override postCopy; they typically do not override shallowCopy.
crAction
Return the action to perform when encountering a CR in the input
crAction:
Return the action to perform when encountering a CR in the input
cursor
Answer the receiver's logical cursor position
cursorWrapped:
Set the cursor as indicated
debugDrawLineRectsOn:
Shows where text line rectangles are
defaultColor
answer the default color/fill style for the receiver
defaultLineHeight
defaultNameStemForInstances
Answer a basis for names of default instances of the receiver. The default is to let the class specify, but certain instances will want to override. (PasteUpMorphs serving as Worlds come to mind
delete
Remove the receiver as a submorph of its owner and make its
new owner be nil.
drawNullTextOn:
Make null text frame visible.
Nicer if not shaded!
drawOn:
Draw the receiver on a canvas.
Draw keyboard focus if appropriate.
drawOnTest:
Draw the receiver on a canvas
editHistory
editHistory:
editor
Return my current editor, or install a new one.
editorClass
Answer the class used to create the receiver's editor
elementCount
Answer how many sub-objects are within me
enterClickableRegion:
exampleBackgroundField
exampleBackgroundLabel
extent:
fancyPrototype
fillStyle
Return the current fillStyle of the receiver.
fillStyle:
Set the current fillStyle of the receiver.
fillingOnOff
Establish a container for this text, with opposite filling status
fillsOwner
Answer true if I fill my owner's shape.
fillsOwner:
firstCharacterIndex
firstInChain
Return the first morph in a chain of textMorphs
fit
Adjust my bounds to fit the text. Should be a no-op if autoFit is not specified.
Required after the text changes,
or if wrapFlag is true and the user attempts to change the extent.
fixUponLoad:seg:
We are in an old project that is being loaded from disk.
Fix up conventions that have changed.
font:
fontName:pointSize:
fontName:size:
getAllButFirstCharacter
Obtain all but the first character from the receiver; if that would be empty, return a black dot
getCharacters
obtain a string value from the receiver
getFirstCharacter
obtain the first character from the receiver if it is empty, return a
black dot
getLastCharacter
obtain the last character from the receiver if it is empty, return a black dot
getMenu:
getNumericValue
Obtain a numeric value from the receiver; if no digits, return zero
goBehind
We need to save the container, as it knows about fill and run-around
handleEdit:
Ensure that changed areas get suitably redrawn
handleInteraction:
Perform the changes in interactionBlock, noting any change in selection
and possibly a change in the size of the paragraph (ar 9/22/2001 - added for TextPrintIts)
handleKeystroke:
System level event handling.
handleMouseMove:
Re-implemented to allow for mouse-up move events
handlesKeyboard:
Return true if the receiver wishes to handle the given keyboard event
handlesMouseDown:
Do I want to receive mouseDown events (mouseDown:, mouseMove:, mouseUp:)?
hasFocus
hasTranslucentColor
Overridden from BorderedMorph to test backgroundColor instead of (text) color.
hasUnacceptedEdits:
Ignored here, but noted in TextMorphForEditView
holderForCharacters
Hand the user a Holder that is populated with individual text morphs representing my characters
initialize
initialize the state of the receiver
insertCharacters:
Insert the characters from the given source at my current cursor position
installEditor
installEditorToReplace:
Install an editor for my paragraph. This constitutes 'hasFocus'.
If priorEditor is not nil, then initialize the new editor from its state.
We may want to rework this so it actually uses the prior editor.
isAutoFit
isLinkedTo:
isTextMorph
isWrapped
justified
keyStroke:
Handle a keystroke event.
keyboardFocusChange:
Changed to update focus indication.
lastCharacterIndex
leftFlush
loadCachedState
Prepare for fast response -- next page of a book?
margins
margins:
newMargins can be a number, point or rectangle, as allowed by, eg, insetBy:.
minimumExtent
This returns the minimum extent that the morph may be shrunk to. Not honored in too many places yet, but respected by the resizeToFit feature, at least. copied up from SystemWindow 6/00
mouseDown:
Make this TextMorph be the keyboard input focus, if it isn't
already, and repond to the text selection gesture.
Changed to not take keyboard focus if an owner is a
PluggableTextMorph that doesn't want focus.
mouseMove:
Handle a mouse move event. The default response is to let my eventHandler, if any, handle it.
mouseUp:
Handle a mouse up event. The default response is to let my eventHandler, if any, handle it.
newContents:
Accept new text contents.
occlusionsOnOff
Establish a container for this text, with opposite occlusion avoidance status
onBlinkCursor
Blink the cursor
optimalExtent
Create a new paragraph and answer its extent.
overrideExtent:
If autoFit is on then override to false for the duration of the extent call.
ownerChanged
The receiver's owner, some kind of a pasteup, has changed its layout.
paragraph
Paragraph instantiation is lazy -- create it only when needed
paragraphClass
passKeyboardFocusTo:
predecessor
predecessor:successor:
Private -- for use only in morphic duplication
predecessorChanged
preferredKeyboardPosition
privateMoveBy:
Private! Use 'position:' instead.
privateOwner:
Nil the container when text gets extracted
recognizerArena
Answer the rectangular area, in world coordinates, that the character recognizer should regard as its tablet
recomposeChain
Recompose this textMorph and all that follow it.
registerInFlapsRegistry
releaseCachedState
Release any state that can be recomputed on demand, such as the pixel values for a color gradient or the editor state for a TextMorph. This method may be called to save space when a morph becomes inaccessible. Implementations of this method should do 'super releaseCachedState'.
releaseEditor
Release the editor for my paragraph. This morph no longer 'hasFocus'.
releaseParagraph
a slight kludge so subclasses can have a bit more control over whether the paragraph really
gets released. important for GeeMail since the selection needs to be accessible even if the
hand is outside me
releaseParagraphReally
a slight kludge so subclasses can have a bit more control over whether the paragraph really
gets released. important for GeeMail since the selection needs to be accessible even if the
hand is outside me
removedMorph:
Notify the receiver that aMorph was just removed from its children
resetBlinkCursor
Reset the blinking cursor
reverseCurveDirection
rightFlush
selectAll
selectFrom:to:
selection
selectionChanged
Invalidate all the selection rectangles.
Make sure that any drop shadow is accounted for too.
setCharacters:
obtain a string value from the receiver
setCompositionWindow
setContainer:
Adopt (or abandon) container shape
setCurveBaseline:
setDefaultContentsIfNil
Set the default contents
setFirstCharacter:
Set the first character of the receiver as indicated
setLastCharacter:
Set the last character of the receiver as indicated
setPredecessor:
setSuccessor:
setTextStyle:
shiftedYellowButtonActivity
Supply the normal 'code pane' menu to use its text editing commands from a menu.
startBlinking
startingIndex
stopBlinking
string:fontName:size:
string:fontName:size:wrap:
successor
takesKeyboardFocus
Answer whether the receiver can normally take keyboard focus.
text
text:textStyle:
Private -- for use only in morphic duplication
text:textStyle:wrap:color:predecessor:successor:
Private -- for use only in morphic duplication
textAlignment
Answer 1..4, representing #leftFlush, #rightFlush, #centered, or #justified
textAlignmentSymbol
Answer one of #leftFlush, #rightFlush, #centered, or #justified
textBounds
textColor
textColor:
textStyle
unload
updateFromParagraph
A change has taken place in my paragraph, as a result of editing and I must be updated. If a line break causes recomposition of the current paragraph, or it the selection has entered a different paragraph, then the current editor will be released, and must be reinstalled with the resulting new paragraph, while retaining any editor state, such as selection, undo state, and current typing emphasis.
userString
Do I have a text string to be searched on?
veryDeepFixupWith:
If target and arguments fields were weakly copied, fix them here. If
they were in the tree being copied, fix them up, otherwise point to the
originals!
veryDeepInner:
Copy all of my instance variables. Some need to be not copied at all, but shared.
Warning!! Every instance variable defined in this class must be handled.
We must also implement veryDeepFixupWith:. See DeepCopier class comment.
wantsKeyboardFocusNavigation
Answer whether the receiver wants to be navigated to.
Answer false here (use PluggableTextMorph instead).
withSuccessorsDo:
Evaluate aBlock for each morph in my successor chain
wouldAcceptKeyboardFocusUponTab
Answer whether the receiver might accept keyboard focus if
tab were hit in some container playfield
wrapFlag:
Change whether contents are wrapped to the container.
wrapOnOff
wrapString
Answer the string to put in a menu that will invite the user to
switch autoFit mode
yellowButtonActivity
Supply the normal 'code pane' menu to use its text editing
commands from a menu.
yellowButtonActivity:
Invoke the text-editing menu.
Check if required first!
TextMorphCommandHistory
A TextMorphCommandHistory is xxxxxxxxx.
Instance Variables
redo
rememberCommand:
Make the supplied command be the 'LastCommand', and mark it 'done'
removeUndoneCommands
Remove all of the commands at the end of history until the first one that is not marked #undone
undo
TextMorphEditor
This is the ParagraphEditor for TextMorphs.
accept
Save the current text of the text being edited as the current acceptable version for purposes of canceling. Allow my morph to take appropriate action
addEditCommand:
againOrSame:
Subroutine of search: and again. If useOldKeys, use same FindText and ChangeText as before.
1/26/96 sw: real worked moved to againOrSame:many:
align
Align text according to the next greater alignment value,
cycling among leftFlush, rightFlush, center, and justified.
alphabeticalGroupsFor:size:
bindingOf:
cancel
Cancel the changes made so far to this text
changeEmphasis:keyEvent:
Change the emphasis of the current selection.
changeEmphasisOrAlignment
changeSelectionFontTo:
changeStyle
Let user change styles for the current text pane.
changeTextFont
Present a menu of available fonts, and if one is chosen, apply it to the current selection.
If there is no selection, or the selection is empty, apply it to the whole morph.
changeTextFontAlphabeticalMenu
changeTextFontDialog
Present a dialog which allows the user to select a font, and if one is chosen, apply it to the current selection. If there is no selection, or the selection is empty, apply it to the whole morph.
chooseColor
Make a new Text Color Attribute, let the user pick a color, and return the attribute
closeTypeIn
See comment in openTypeIn. It is important to call closeTypeIn before executing
any non-typing key, making a new selection, etc. It is called automatically for
menu commands.
Typing commands can call 'closeTypeIn: aCharacterStream' instead of this to
save typeahead. Undoer & Redoer: undoAndReselect:redoAndReselect:.
controlInitialize
No-op for MVC ParagraphEditor compatibility
controlTerminate
No-op for MVC ParagraphEditor compatibility
dispatchOnKeyEvent:with:
Carry out the action associated with this character, if any.
Type-ahead is passed so some routines can flush or use it.
editHistory
familyMemberFor:fromFamilies:
find
Prompt the user for a string to search for, and search the receiver from the current selection onward for it. 1/26/96 sw
flash
Causes the view of the paragraph to complement twice in succession.
fontMenuItemsDisplayWithMenuFont
Answer true if menu items should display using the standard menu font,
false to display them in the font that they represent
handleDisabledKey:
Handle a key character when