|
|
Class: SimpleView
Object
|
+--GraphicsContext
|
+--DeviceGraphicsContext
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--ClockView
|
+--DSVLabelView
|
+--DigitalClockView
|
+--FilenameWidgetWithHistory
|
+--FramedBox
|
+--HorizontalScale
|
+--InputView
|
+--InspectorView
|
+--PanelView
|
+--Ruler
|
+--Scale
|
+--ScrollBar
|
+--ScrollableView
|
+--Separator
|
+--ShadowView
|
+--SyncedMultiColumnTextView
|
+--SystemStatusMonitor
|
+--TabSpecRuler
|
+--VariablePanel
|
+--View
|
+--ViewScroller
|
+--ViewWithAcceptAndCancelBar
|
+--ViewWithAcceptAndCancelBar::AcceptAndCancelBar
|
+--VisualRegion
|
+--WoodenMenu
- Package:
- stx:libview
- Category:
- Views-Basic
- Version:
- rev:
1.659
date: 2010/02/05 16:09:52
- user: cg
- file: SimpleView.st directory: libview
- module: stx stc-classLibrary: libview
- Author:
- Claus Gittinger
this class implements functions common to all Views which do not work on / show a model.
Previously, all of this functionality used to be in the old View class, but has been
separated into this new SimpleView (which does not know about models) and the new View,
which does so.
I'd prefer to call this class View and the current View class a ModelView,
but for backward compatibility it is better to leave things the way they are
(there are simply too many subclasses of View around...).
Instances of SimpleView are seldom used directly, most views in the system inherit
from this class. However, sometimes a view is needed to create a dummy view for framing
or layout purposes.
[Instance variables:]
superView <View> my superview i.e. the view I am in
subViews <Collection> the collection of subviews
These are the views proper.
components <Collection> collection of gadgets (will be merged with subViews, soon)
These are lightweight gadgets (not seen by windows/x11).
styleSheet <ResourcePack> contains widget attributes (see libview/styles/*.style)
resources <ResourcePack> contains national language translations (see lib*/resources/*.rs)
border <Border> color and width of border
unused <nil> to keep the instVar size constant
viewShape <Form> shape of view & border (if device supports it)
top <Number> actual top coordinate (pixels) in superview
left <Number> actual left coordinate (pixels) in superview
flagBits <Integer> flag bits (used to be individual booleans)
extendChanged true if extend changed during setup
originChanged true if origin changed during setup
relativeOrigin <Number> relative origin in percent within superview
relativeExtent <Number> relative extent in percent within superview
relativeCorner <Number> relative corner in percent within superview
originRule <Block> rule to compute origin if superview changes size
extentRule <Block> rule to compute extent if superview changes size
cornerRule <Block> rule to compute corner if superview changes size
insets <Array> array with top, left, bottom & right insets (or nil)
layout <LayoutObject> not yet implemented - will replace the above layout
variables.
shown <Boolean> true if visible (false if iconified, unmapped or covered)
hiddenOnRealize <Boolean> dont show automatically when superview is realized
name <String> my name (future use for resources)
level (**) <Number> 3D level relative to superview
margin <Number> convenient margin; that is the number of pixels
which are taken up by border plus 3D level
(i.e. borderWidth + level abs)
innerClipRect <Rectangle> convenient inner clip (minus margin)
shadowColor (**) <Color> color used to draw 3D shadowed edges
lightColor (**) <Color> color used to draw 3D lighted edges
bitGravity <nil | Symbol> gravity of contents (if device supports it)
viewGravity <nil | Symbol> gravity of view (if device supports it)
controller <nil | Controller> the controller (if any)
windowGroup <WindowGroup> the windowGroup
preferredExtent(*) <nil | Point> preferredExtent overWrite
if nonNil, the widget will not compute
its pref-extent, but use that value.
explicitExtent(*) <nil | Point> preferredExtent overWrite
if nonNil, the widget will not compute
its pref-extent, but use that value.
dependents <nil | Collection> who depends on me
layoutManager
visibilityChannel
helpKey
dropTarget
(*) about to be changed to use preferredExtent as a cache and explicitExtent as
an overwrite value.
(**) We have recently started to change the system to use borders instead of separate
borderWidth, borderColor, level, shadow- and lightColors.
Expect more changes here in the near future..
[Class variables:]
Grey <Color> the color grey - its used so often
ViewSpacing <Number> preferred spacing between views; 1mm
CentPoint <Point> 100 @ 100 - its used so often
StyleSheet <ResourcePack> contains all view-style specifics
ReturnFocusWhenClosingModalBoxes if true, a closing modalBox returns
<Boolean> the keyboard focus to the view which was
active when the box was opened.
If false (the default), it is left to
window manager to assign a new focus.
If running on olwm/olvwm (which requires an
explicit click to reassign a focus), it is
better to turn this on in a private.rc file.
[styleSheet parameters:]
popupShadow <Boolean> if true, popupViews show a shadow below
popupLevel <nil | Integer> 3D level
borderWidth <nil | Integer> borderWidth (ignored in 3D styles)
borderColor <nil | Color> borderColor (ignored in 3D styles)
viewBackground <nil | Color> views background
shadowColor <nil | Color> color for shadow edges (ignored in 2D styles)
lightColor <nil | Color> color for light edges (ignored in 2D styles)
font <nil | Font> font to use
TODO:
get rid of relativeOrigin, relativeCorner, originRule, extentRule,
and insets; replace by a single object which defines the size
(mhmh - ST-80 seems to call this LayoutFrame ?)
-> be prepared for a change here in the near future and ONLY use
access methods to get those instance variables' values
get rid of 3D level & margin, move it to extra wrappers
(although this will make view setup more complicated, it will remove
complexity from the internals of view. Also, it will allow for more
varieties of borders.)
add components (could also call them gadgets or lightweight views)
- views are expensive in terms of X resources. This would make all
framing/edge and panel helper views become cheap ST objects, instead
of views.
StandardSystemView
DialogBox
WindowGroup
WindowEvent
Layout
[introduction to view programming]
Signal constants
-
aboutToOpenBoxNotificationSignal
-
change & update
-
update: something with: aParameter from: changedObject
-
defaults
-
defaultBackgroundColor
-
return the default background color for drawing - usually,
that is the same as the viewBackgroundColor.
-
defaultExtent
-
return the default extent of my instances.
The value returned here is usually ignored, and
the value from preferredExtent taken instead.
-
defaultFont
-
-
defaultFont: aFont
-
set the default font used for drawing
-
defaultStyle
-
return the default view style
-
defaultStyle: aStyle
-
set the view style for new views
-
defaultViewBackgroundColor
-
return the default view background
-
readStyleSheet
-
(re)load the styleSheet.
-
readStyleSheetAndUpdateAllStyleCaches
-
reload all style caches in all view classes.
Needed after a style change or when a style file has been changed
-
returnFocusWhenClosingModalBoxes
-
return the current focus-return behavior.
See #returnFocusWhenClosingModalBoxes: for a description.
-
returnFocusWhenClosingModalBoxes: aBoolean
-
control the keyboard-focus behavior when a modal dialog
is closed. The default (true) is to return the focus to the view
which was active when the dialog was opened.
If false, it is left up to the display to set the focus.
For owm / ovwm (which requires an explicit click for the focus),
it is better to return the focus automatically.
For managers which assign the focus according the pointer position,
it may be better to turn the focus-return off.
You should add a corresponding expression into your private.rc or
display.rc file.
-
setDefaultStyle
-
-
styleSheet
-
return the view style sheet information (a dictionary)
-
styleSheet: aViewStyle
-
set the view style from a style-sheet
-
updateAllStyleCaches
-
reload all style caches in all view classes.
Needed after a style change or when a style file has been changed
-
updateStyleCache
-
this method gets some heavily used style stuff and keeps
it in class-variables for faster access.
Subclasses should redefine this to load any cached style-values
into faster class variables as well. These should NOT do a
super updateStyleCache, since this method is called for all view-classes
anyway.
-
viewSpacing
-
return a convenient number of pixels used to separate views (usually 1mm).
Having this value here at a common place makes certain that all views
get a common look
initialization
-
initialize
-
-
postAutoload
-
instance creation
-
extent: extent
-
create a new view with given extent
-
extent: extent in: aView
-
create a new view as a subview of aView with given extent
-
extent: extent label: label
-
create a new view with given extent and label
-
in: aView
-
return a new view as a subview of aView.
If aView is nil, it is left unspecified, in which superview
the new view will be placed. The view can later be assigned
by adding it to the superview via #addSubView:.
If its later realized and no superview has ever been set,
it will come up as a topview.
-
label: label
-
create a new view with given label
-
label: label in: aView
-
create a new view as subview of aView with given label
-
model: aModel
-
st-80 style view creation: create a new view and set its model.
Notice, that simpleViews do not understand #model:; however,
subclasses may.
-
on: aModel
-
create a new drawable on aModel
-
onSameDeviceAs: anotherView
-
create a view on the same device as anotherView.
Used with popUpMenus, which should be created on the device of
its masterView.
-
origin: origin corner: corner
-
create a new view with given origin and extent
-
origin: anOrigin corner: aCorner borderWidth: bw font: aFont label: aLabel in: aView
-
-
origin: origin corner: corner borderWidth: bw in: aView
-
create a new view as a subview of aView with given origin and extent
-
origin: origin corner: corner in: aView
-
create a new view as a subview of aView with given origin and extent
-
origin: origin extent: extent
-
create a new view with given origin and extent
-
origin: origin extent: extent borderWidth: bw
-
create a new view with given origin, extent and borderWidth
-
origin: anOrigin extent: anExtent borderWidth: bw font: aFont label: aLabel in: aView
-
-
origin: origin extent: extent borderWidth: bw in: aView
-
create a new view as a subview of aView with given origin, extent
and borderWidth
-
origin: origin extent: extent font: aFont label: label
-
-
origin: origin extent: extent font: aFont label: label in: aView
-
-
origin: origin extent: extent in: aView
-
create a new view as a subview of aView with given origin and extent
-
origin: origin extent: extent label: label
-
create a new view with given origin, extent and label
-
origin: anOrigin extent: anExtent label: aLabel icon: aForm minExtent: minExtent maxExtent: maxExtent
-
-
origin: origin in: aView
-
create a new view as a subview of aView with given origin
misc ui support
-
iconInBrowserSymbol
-
resources
-
classResources
-
if not already loaded, get the classes resourcePack and return it
-
classResources: aResourcePack
-
allow setting of the classResources
-
flushAllClassResources
-
flush all classes resource translations.
Needed after a resource file has changed.
-
flushClassResources
-
flush classes resource string translations.
Needed whenever a resource file or language has changed
-
resources
-
return the views resources -
that's a ResourcePack containing national language strings
-
updateClassResources
-
flush classes resource string translations and reload them.
Needed whenever a resource file or language has changed
startup
-
open
-
create, realize the view - this topview and all its subviews will
run as a separate process with its own windowGroup
-
openOnXScreenNamed: aScreenName
-
create an instance of the view and open it
on some X display screen. The argument aScreenName must be
a valid x-display name (i.e. of the form '<host>:<screenNr>' as in 'foo:0').
For more info, read the document on multiple display
support and the documentation of the DeviceWorkstation class.
Compatibility-ST80
-
checkForEvents
-
ST-80 compatibility:
check for any pending events and process them
-
closeAndUnschedule
-
actually sent to a controller in VW...
however, #open returns the view in ST/X, so we respond here
-
displayOn: aGCOrStream
-
ST-80 compatibility: (re-)display myself
-
displayPendingInvalidation
-
dummy - for ST-80 compatibility
-
invalidateRectangle: aRectangle repairNow: doRepairNow
-
-
isEnabled
-
return true, if this view is enabled (i.e. accepts user interaction).
Most views are enabled - only a few (buttons, SelectionInList etc.) can
be disabled.
#isEnabled is ST-80's equivalent of #enabled
-
isOpen
-
ST80 compatibility
-
lookPreferences: prefs
-
ignored - but required for some apps
-
newLayout: aLayoutObject
-
set the layout object which controls my geometry.
ST80-compatibility.
-
refresh
-
-
takeKeyboardFocus
-
Compatibility-Squeak
-
insetDisplayBox
-
Squeak mimicri: return my bounds
accessing
-
client: anApplicationModel
-
release existing components and generate new components from
the applications windowSpec.
ATTENTION: this is a low level interface; postBuild is NOT invoked
-
client: anApplication spec: aWindowSpecOrSelector
-
release existing components and generate new components from
the applications windowSpec.
ATTENTION: this is a low level interface; postBuild is NOT invoked
-
client: anApplication spec: aWindowSpecOrSpecSymbol builder: aBuilder
-
release existing components and generate new components from
the given windowSpec, using the given builder.
-
client: anApplication spec: aWindowSpecOrSpecSymbol builder: aBuilder withMenu: withMenuBoolean
-
release existing components and generate new components from
the given windowSpec, using the given builder.
ATTENTION: this is a low level interface.
TODO: this code is so ugly and badly designed - it must be redesigned
or at least well documented.
-
helpKey
-
-
helpKey: something
-
-
keyboardProcessor
-
return my keyboard processor
accessing-behavior
-
disable
-
alternative method; redirected to basic mechanism
-
enable
-
alternative method; redirected to basic mechanism
-
enabled
-
views are enabled by default
-
enabled: bool
-
this is the basic machanism to enable/disable a view.
empty in this class; may be redefined by subclasses
-
isEnabled: aState
-
ST-80 compatibility; set enabled state
accessing-bg & border
-
allSubViewsBackground: something
-
set the viewBackground to something, a color, image or form,
recursively in all of my subviews
-
allSubViewsBackground: something if: condition
-
set the viewBackground to something, a color, image or form,
recursively in all of my subviews
-
allSubViewsForeground: something
-
set the foreground to something, a color, image or form,
recursively in all of my subviews
-
allViewBackground: something
-
set the viewBackground to something, a color, image or form,
in myself and recursively in all of my subviews
-
allViewBackground: something if: condition
-
set the viewBackground to something, a color, image or form,
in myself and recursively in all of my subviews
-
allViewForeground: something
-
set the foreground to something, a color, image or form,
in myself and recursively in all of my subviews
-
backgroundColor
-
return the background color of the contents -
here, (since there is no contents), the viewBackground is returned.
-
backgroundColor: aColor
-
set the background color of the contents -
here, (since there is no contents), the viewBackground is changed.
-
border
-
return my border
-
border: aBorder
-
set my border
-
borderColor
-
return my borderColor
-
borderColor: aColor
-
set my borderColor
-
borderShape: aForm
-
set the borderShape to aForm
-
borderWidth
-
return my borderWidth
-
borderWidth: aNumber
-
set my borderWidth
-
computeMargin
-
-
fillFormWithBorderShape: aForm
-
fill aForm with my borderShape
-
foregroundColor
-
return the foreground color of the contents -
here, (since there is no contents), some default is returned.
-
foregroundColor: aColor
-
set the foreground color of the contents -
ignored here, since there is no contents.
-
foregroundColor: fgColor backgroundColor: bgColor
-
set both the foreground and background colors of the contents
-
level
-
return my level relative to superView (3D)
-
level: aNumber
-
set my level relative to superView (3D)
-
lightColor
-
returb the color to be used for lighted edges (3D only)
-
lightColor: aColorOrImage
-
set the color to be used for lighted edges (3D only)
-
margin
-
return my inner margin - this is usually the level,
but can be more for some views
(textViews which add more margin between the border and the text)
-
setBorderWidth
-
set my borderWidth in the devices physical view
-
setBorderWidth: aNumber
-
set my borderWidth without affecting the real view (private only)
-
shadowColor
-
returb the color to be used for shadowed edges (3D only)
-
shadowColor: aColorOrImage
-
set the color to be used for shadowed edges (3D only)
-
viewBackground: something
-
set the viewBackground to something, a color, image or form.
If its a color and we run on a color display, also set shadow and light
colors - this means, that a red view will get light-red and dark-red
edges.
-
viewShape: aForm
-
set the viewShape to aForm
accessing-channels
-
setupChannel: newChannel for: changeSelector withOld: oldChannel
-
common code to change a channel.
If changeSelector is non-nil, arrange for it to be sent when
the channel changes its value; otherwise, arrange for a simple update.
This is so common, that ist worth a helper method:
release any old channel (if non-nil),
arrange for changeSelector (or #update) to be sent for the new channel.
accessing-contents
-
heightOfContents
-
return the height of the contents in logical units
- defaults to views visible area here.
This method MUST be redefined in all view classess which are
going to be scrolled AND show data which has different size than
the view. For example, a view showing A4-size documents should return
the number of vertical pixels such a document has on this device.
A view showing a bitmap of height 1000 should return 1000.
If not redefined, scrollbars have no way of knowing the actual size
of the contents being shown. This is called by scrollBars to compute
the relative height of the document vs. the views actual size.
The value returned here must be based on a scale of 1, since users
of this will scale as appropriate.
-
widthOfContents
-
return the width of the contents in logical units
- defaults to views visible area here.
This method MUST be redefined in all view classess which are
going to be scrolled AND show data which has different size than
the view. For example, a view showing A4-size documents should return
the number of horizontal pixels such a document has on this device.
A view showing a bitmap of width 500 should return 500.
If not redefined, scrollbars have no way of knowing the actual size
of the contents being shown. This is called by scrollBars to compute
the relative width of the document vs. the views actual width.
The value returned here must be based on a scale of 1, since users
of this will scale as appropriate.
accessing-dimensions
-
allInset: aNumber
-
set all insets; positive makes the view smaller,
negative makes it larger..
Obsolete: please use a layout object.
-
bottom
-
return the y position of the actual bottom edge (in pixels)
-
bottom: aNumber
-
set the corners y position
-
bottomInset
-
return the inset of the bottom edge; positive is to the top,
negative to the bottom.
Obsolete: please use a layout object.
-
bottomInset: aNumber
-
set the inset of the bottom edge;
positive is to the top (view becomes smaller),
negative to the bottom (becomes larger).
Obsolete: please use a layout object.
-
bounds
-
ST-80 compatibility: return my bounds
-
bounds: aRectangle
-
ST-80 compatibility: change my bounds
-
center
-
return the point at the center of the receiver (in pixels)
-
center: newCenter
-
move the receiver so that newCenter, aPoint becomes the center point
-
computeCorner
-
compute my corner; if I have a layoutObject,
relative origins or blocks to evaluate, compute it now ..
Blocks may return relative values or nil; nil means: take current value.
Returns the corner point in device coordinates (pixels).
-
computeExtent
-
compute my extent; if I have a layoutObject, a relative extent
or blocks to evaluate, compute it now ..
There is one catch here, if the dimension was defined
by origin/corner, compute them here and take that value.
I.e. origin/corner definition has precedence over extent definition.
Returns the extent in device coordinates (pixels).
-
computeOrigin
-
compute my origin; if I have a layoutObject, a relative origin
or blocks to evaluate, compute it now ..
Blocks may return relative values or nil; nil means: take current value.
Returns the origin point in device coordinates (pixels).
-
corner
-
return the lower right corner-point (in pixels)
-
corner: corner
-
set the views corner;
the corner argument may be:
a point
where integer fields mean 'pixel-values'
and float values mean 'relative-to-superview'
and nil means 'take current value';
or a block returning a point which is interpreted as above.
Please migrate to use layoutObjects, if possible.
-
cornerRule
-
return the corner block - non public; this will vanish without notice
-
extent: extent
-
set the views extent;
extent may be:
a point
where integer fields mean 'pixel-values'
and float values mean 'relative-to-superview'
and nil means 'leave current value';
or a block returning a point which is interpreted as above.
Be careful when using relative extents: rounding errors may
accumulate. Better use origin/corner.
Best: migrate to use layour objects.
Notice: this sets the views explicitExtent flag, which prevents it normally
from resizing itself to its preferredExtent.
See initialExtent: for a variation.
-
extentRule
-
return the extent block - non public; this will vanish without notice
-
frame
-
compatibility with displayObjects: returns my bounds
-
geometryLayout
-
this method will vanish, as soon as all implementations of
#layout: are removed ...
(conflict for example in label>>layout:).
DO NOT USE #geometryLayout: in your code; it will be removed without
notice.
-
geometryLayout: aLayoutObject
-
this method will vanish, as soon as all implementations of
#layout: are removed ...
(conflict for example in label>>layout:).
DO NOT USE #geometryLayout: in your code; it will be removed without
notice.
-
hasExplicitExtent
-
^ explicitExtent.
-
height: aNumber
-
set the views height in pixels
-
heightIncludingBorder
-
return my height including border
(this is my height as seen from the outside view;
while #height returns the height as seen by myself)
-
horizontalInset: aNumber
-
set the insets of the left/right edge;
positive makes it smaller, negative makes it larger.
Obsolete: please use a layout object.
-
initialExtent: extent
-
set the views extent, but dont change its explicitExtent setting.
a variant of #extent.
-
initialHeight: aNumber
-
set the views height in pixels, but dont change its explicitExtent setting
-
initialWidth: aNumber
-
set the views width in pixels, but dont change its explicitExtent setting
-
innerHeight
-
return the height of the view minus any 3D-shadow-borders
-
innerHeight: pixels
-
set the height of the view plus any 3D-shadow-borders.
This does not work with a relative size.
-
innerHorizontalMargin
-
return any additional inner margin (i.e. contents margin).
This should be redefined by views which do add margins
(for example: textViews do this)
-
innerVerticalMargin
-
return any additional inner margin (i.e. contents margin).
This should be redefined by views which do add margins
(for example: textViews do this)
-
innerWidth
-
return the width of the view minus any 3D-shadow-borders
-
innerWidth: pixels
-
set the width of the view plus any 3D-shadow-borders.
This does not work with a relative size.
-
inset: aNumber
-
set all insets; positive makes the view smaller,
negative makes it larger..
Obsolete: please use a layout object.
-
layout
-
return the layout object which controls my geometry.
Currently, this is nil in most cases, and my geometry is
defined by relativeOrigin/relativeCorner/relativeExtent,
originRule/extentRule/cornerRule and inset.
Applications should be changed to use layoutObjects,
since the above listed instance variables will vanish.
-
layout: aLayoutObject
-
set the layout object which controls my geometry.
Currently, this is almost nowhere used but views will be
incrementally changed to use this new geometry management.
-
left
-
return the x position of the left border (in pixels)
-
left: aNumber
-
set the x position
-
left: newLeft top: newTop width: newWidth height: newHeight
-
another way of specifying origin and extent
-
leftInset
-
return the inset of the left edge; positive is to the right,
negative to the left.
Obsolete: please use a layout object.
-
leftInset: aNumber
-
set the inset of the left edge;
positive is to the right (view becomes smaller),
negative to the left (becomes larger).
Obsolete: please use a layout object.
-
makeFullyVisible
-
make sure, that the view is fully visible by shifting it
into the visible screen area if nescessary.
This method will be moved to StandardSystemView ...
-
makeRoundViewShapeWithBorder: bw
-
setup my window for a round shaped view;
this is not supported by all devices
-
makeRoundViewShapeWithBorder: bw opaque: opaque
-
setup my window for a round shaped view;
this is not supported by all devices
-
makeTransparentRectangularViewShapeWithBorder: bw
-
setup my window for a rectangluar transparent shaped view;
this is not supported by all devices
-
minExtent
-
for compatibility with StdSysView
-
origin
-
return the origin (in pixels)
-
origin: origin
-
set the views origin;
origin may be:
a point
where integer fields mean 'pixel-values'
and float values mean 'relative-to-superview'
and nil means 'take current value';
or a block returning a point which is interpreted as above.
Please migrate to use layout objects.
-
origin: origin corner: corner
-
set both origin and extent
-
origin: origin extent: extent
-
set both origin and extent
-
originRelativeTo: aView
-
return the origin (in pixels) relative to a superView,
or relative to the rootView (if the aView argument is nil).
If the receiver is nonNil and not a subview of aView, return nil.
-
originRule
-
return the origin block - non public; this will vanish without notice
-
preferredExtent: anExtentPoint
-
override the views own preferredExtent computation,
and let it prefer the size given by the argument.
-
relativeCorner
-
return the relative corner or nil.
Obsolete: please use a layout object.
-
relativeCorner: aPoint
-
set the relative corner.
Obsolete: please use a layout object.
-
relativeExtent
-
return the relative extent or nil.
Obsolete: please use a layout object.
-
relativeExtent: aPoint
-
set the relative extent.
Obsolete: please use a layout object.
-
relativeOrigin
-
return the relative origin or nil.
Obsolete: please use a layout object.
-
relativeOrigin: aPoint
-
set the relative origin.
Obsolete: please use a layout object.
-
right
-
return the x position of the right edge (in pixels)
-
right: aNumber
-
set the corners x position
-
rightInset
-
return the inset of the right edge; positive is to the left,
negative to the right.
Obsolete: please use a layout object.
-
rightInset: aNumber
-
set the inset of the right edge;
positive is to the left (view becomes smaller),
negative to the right (becomes larger).
Obsolete: please use a layout object.
-
screenBounds
-
return my bounds on the screen
-
setOrigin: aPoint
-
set the origin only
-
sizeFixed: aBoolean
-
set/clear the fix-size attribute, if supported by concrete subclasses.
Views which want to resize themselfes as appropriate to their contents
should cease to do so and take their current size if sizeFixed is set to
true. Currently, only supported by Labels.
This does NOT prevent the window manager from resizing the view,
instead it tell the view to NOT resize ITSELF.
Added here to provide a common protocol for all views.
-
superViewRectangle
-
return the inside area of the superView.
-
top
-
return the y position of the top border
-
top: aNumber
-
set the y position
-
topInset
-
return the inset of the top edge; positive is to the bottom,
negative to the top.
Obsolete: please use a layout object.
-
topInset: aNumber
-
set the inset of the top edge;
positive is to the bottom (view becomes smaller),
negative to the top (becomes larger).
Obsolete: please use a layout object.
-
verticalInset: aNumber
-
set the insets of the top/bottom edge;
positive makes it smaller, negative makes it larger.
Obsolete: please use a layout object.
-
viewRectangle
-
return the inside area.
This is used by relative sized subviews and layout-computations
to base relative coordinates on.
For most views, the value returned here (actual extent minus any
margins required for 3D levels) is ok.
However, views which want some extra area around (for example: FramedBox)
may redefine this method to return a rectangle without this area
(thus, a relative sized subviews coordinates will be based on this net area)
-
width: aNumber
-
set the views width in pixels
-
widthIncludingBorder
-
return my width including border
(this is my width as seen from the outside view;
while #width returns the width as seen by myself)
accessing-display attributes
-
beMDIChildView
-
-
beNativeWidget
-
-
beNonNativeWidget
-
-
isMDIChildView
-
-
isMarkedAsUnmappedModalBox
-
-
isNativeWidget
-
-
markAsUnmappedModalBox
-
-
setWindowClass: windowClassNameString name: nameString
-
define class and name of a window.
This may be used by the window manager to
select client specific resources.
-
unmarkAsUnmappedModalBox
-
accessing-hierarchy
-
components
-
return the collection of non-view components
-
container
-
return my container
-
container: aContainer
-
set my container (i.e. superView) to be aContainer
-
hierarchicalIndex
-
-
hierarchicalIndexInList: aViewCollection
-
-
hierarchicalIndexOfChild: aView
-
-
hierarchicalUUID
-
-
lower
-
bring to back
-
raise
-
bring to front
-
setContainer: aContainer
-
set my container (i.e. superView) to be aContainer
-
subViews
-
return the collection of subviews
-
subViews: aListOfViews
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
superView
-
return my superView
-
superView: aView
-
set my superView to be aView
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
topComponent
-
return the topmost component - thats the one with no superview.
For ST-80 compatibility.
-
topView
-
return the topView - thats the one with no superview
-
uuidStringOrName
-
-
view
-
return my view - for real views, thats the receiver.
For wrappers, its the real view that contains it
accessing-menus
-
menuHolder
-
who has the menu ?
By default, I have it.
-
menuMessage
-
Return the symbol sent to myself to aquire the menu
-
menuPerformer
-
who should perform the menu actions ?
By default, I do it.
-
yellowButtonMenu
-
actually, this should be called 'middleButtonMenu'.
But for ST-80 compatibility ....
This method will vanish, once all views have controllers
associated with them; for now, duplicate some code also found in
controller.
accessing-misc
-
bitGravity
-
return the bitGravity - thats the direction where the contents will move
when the the view is resized.
-
bitGravity: gravity
-
set the bitGravity - thats the direction where the contents will move
when the view is resized.
-
clippingRectangle: aRectangle
-
set the clipping rectangle for drawing (in logical coordinates);
a nil argument turns off clipping (i.e. whole view is drawable).
Redefined to care for any margin.
-
fullName
-
return my full name to be used for resource-access
-
name
-
return my name component to be used for resource-access
-
name: aString
-
set my name component to be used for resource-access
-
processName
-
return a string to be shown in the process monitor
-
styleSheet
-
return the styleSheet. This is set at early view-creation time,
from the defaultStyleSheet which is valid at that time.
It is not affected by later defaultStyle changes
-
styleSheet: aStyleSheet
-
change the styleSheet. Knowledgable users only, please.
-
uuid
-
return my uuid (for the pollonium st/x capture/replay tool)
-
uuid: aUUID
-
set my uuid (for the pollonium st/x capture/replay tool)
-
viewGravity
-
return the viewGravity - thats the direction where the view will move
when the superView is resized.
-
viewGravity: gravity
-
set the viewGravity - thats the direction where the view will move
when the superView is resized.
accessing-mvc
-
application
-
return the application, under which this view was opened,
or nil, if there is no application
-
aspect: aspectSymbol
-
ST-80 style updating: If a views aspectSymbol is nonNil,
it will respond to changes of this aspect from the model.
Alias for aspectMessage: for ST-80 compatibility.
-
controller
-
return the controller. For views which implement the controller
functionality themself, return the receiver itself
-
controller: aController
-
set the controller - thats the one handling user events
-
model
-
return nil - simpleViews have no model (only providing geometric)
-
sensor
-
return the views sensor
-
setController: aController
-
set the controller but do not affect the model/view releationship
-
setWindowGroup: aGroup
-
set the window group.
-
windowGroup
-
return the window group. For old style views, return nil
-
windowGroup: newGroup
-
set the window group of myself and recursively of any children.
If I am currently in a group, remove me from it it.
accessing-transformation
-
maxComponentBottom
-
return the maximum of all components bottom
-
maxComponentRight
-
return the maximum of all components rights
-
maxSubViewBottom
-
subViews isNil ifTrue:[^ 0].
-
maxSubViewRight
-
subViews isNil ifTrue:[^ 0].
-
scale: aPoint
-
set the scale factor of the transformation
-
setViewOrigin: aPoint
-
set the viewOrigin - i.e. virtually scroll without redrawing
-
viewOrigin
-
return the viewOrigin; thats the coordinate of the contents
which is shown topLeft in the view
(i.e. the origin of the visible part of the contents).
-
visibleArea
-
return the rectangle that contains the visible part
of the view in user coordinates.
-
xOriginOfContents
-
return the x coordinate of the viewOrigin in pixels;
used by scrollBars to compute thumb position within the document.
-
yOriginOfContents
-
return the y coordinate of the viewOrigin in pixels;
used by scrollBars to compute thumb position within the document.
accessing-visibility
-
beInvisible
-
make the view invisible; if my container is visible,
change visibility immediately;
otherwise, arrange for the receiver to be not realized,
when the container is made visible.
-
beVisible
-
make the view visible; if my container is already visible,
change visibility immediately; otherwise, arrange for the receiver
to be made visible when the container is made visible.
Notice, that the command may not be sent immediately to the display,
and that ST/X considers the view to be still invisible until a
visibility event arrives from the display.
Thus, the view may remain logically invisible
for a while. (see #beVisibleNow for more on this)
-
beVisibleNow
-
make the view visible immediately.
In contrast to #beVisible, this waits until the view is really
visible.
-
hidden
-
return true, if the view does not want to be realized
automatically when superview is realized
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
hidden: aBoolean
-
if the argument is true, the receiver view will not
be realized automatically when superview is realized
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
hiddenOnRealize: aBoolean
-
if the argument is true, the receiver view will not
be mapped (i.e. shown) automatically when the superview is realized.
The hiddenOnRealize flag is useful to create views which are
to be made visible conditionally or later.
For ST-80 compatibility, please use #beVisible / #beInvisible.
-
isHiddenOnRealize
-
return true, if the receiver will NOT be mapped when realized.
False otherwise.
The hiddenOnRealize flag is useful to create views which are
to be made visible conditionally or later.
-
isVisible
-
return true, if the view is visible
-
isVisible: aBoolean
-
make the view visible or invisible
-
setVisibilityChannel: aValueHolder
-
set the valueHolder, which holds the visible boolean value
-
shown
-
return true if the view is shown; false if not.
Shown means: the view is mapped and is not completely covered.
-
visibilityChannel
-
return a valueHolder for visible/invisible
-
visibilityChannel: aValueHolder
-
set the valueHolder, which holds the visible boolean value
adding & removing components
-
add: aComponent
-
add a component (either a view or gadget) to the collection of
subComponents.
-
add: aComponent at: anOrigin
-
for ST-80 compatibility.
add a component at some origin
-
add: aComponentOrCollection in: aRectangleOrLayoutFrame
-
for ST-80 compatibility.
add a component in some frame; the argument may be either a rectangle
with relative coordinates, or an instance of LayoutFrame, specifying
both relative coordinates and the insets.
-
addComponent: aComponent
-
components (i.e. gadgets or lightweight views) are being prepared.
Dont use this right now for non-views
-
addSubView: newView
-
add a view to the collection of subviews
-
addSubView: newView after: aView
-
add a view to the collection of subviews after another view.
This makes sense, in Panels and other layout views, to enter a new
element at some defined place.
-
addSubView: newView before: aView
-
add a view to the collection of subviews before another view.
This makes sense, in Panels and other layout views, to enter a new
element at some defined place.
-
addSubView: aView in: bounds borderWidth: bw
-
for ST-80 V2.x compatibility
-
addSubViewFirst: newView
-
add a view to the front of the collection of subviews
-
component: aComponent
-
components (i.e. gadgets or lightweight views) are being prepared.
Dont use this right now for non-views
-
destroySubViews
-
remove all subviews
-
removeComponent: aComponent
-
components (i.e. gadgets or lightweight views) are being prepared.
Dont use this right now for non-views
-
removeSubView: aView
-
remove a view from the collection of subviews
-
setContainerIn: aView
-
common code for addSubView* methods
change & update
-
changedPreferredBounds: someArgument
-
tell any dependents, that I have changed my preferred bounds;
Interface is provided mostly provided for ST80 compatibility;
here, translate into ST/X's mechanism for telling others about this.
-
languageChanged
-
-
update: aspect with: aParameter from: changedObject
-
an update request
cursor animation
-
showBusyWhile: aBlock
-
evaluate some time consuming block, while doing this,
show a spinning wheel cursor. If those bitmaps are not found,
fallback to the standard busy cursor.
Experimental.
dependents access
-
addDependent: anObject
-
make the argument, anObject be a dependent of the receiver
-
dependents
-
return a Collection of dependents
-
dependents: aCollection
-
set the collection of dependents
-
dependentsDo: aBlock
-
evaluate aBlock for all of my dependents
-
removeDependent: anObject
-
make the argument, anObject be independent of the receiver
dependents access (non weak)
-
addNonWeakDependent: anObject
-
make the argument, anObject be a dependent of the receiver.
Since all dependencies are nonWeak in Model, this is simply
forwarded to addDependent:
-
interests
-
return a Collection of interests - empty if there is none.
Here, we use the normal dependents collection for interests.
-
nonWeakDependents
-
return a Collection of dependents - empty if there is none.
Since all dependencies are nonWeak in Model, this is a dummy.
-
removeNonWeakDependent: anObject
-
make the argument, anObject be independent of the receiver.
Since all dependencies are nonWeak in Model, this is simply
forwarded to removeDependent:
drag & drop
-
canDrop: aDropContext
-
return true, if we can drop using a dropContexts information (the new drop interface).
This method should be redefined in views which can take objects
-
canDrop: aDropContext at: positionInView
-
return true, if we can drop using a dropContexts information (the new drop interface).
This method should be redefined in views which can take objects
-
canDropObjects: aCollectionOfDropObjects
-
return true, if we can drop aCollectionOfDropObjects (the OLD drop interface).
This method should be redefined in views which can take objects
-
canDropObjects: aCollectionOfDropObjects at: positionInView
-
return true, if we can drop aCollectionOfDropObjects (the OLD drop interface).
This method should be redefined in views which can take objects
-
dragAutoScroll: aContext
-
called by the DragAndDropManager to scroll during a drag/drop operation
if necassery (decided by the widget itself);
If a scroll is done, return true otherwise false (used to restore the background).
By default false is returned.
-
drop: aDropContext
-
drop manager wants to drop using info in aDropContext (the new drop interface).
An error here, because this is only sent, if #canDrop: returned true;
if you redefined #canDrop: in a subclass, #drop: must also be redefined.
** This method raises an error - it must be redefined in concrete classes **
-
drop: aDropContext at: aPoint
-
drop manager wants to drop using info in aDropContext (the new drop interface).
If I have an application, forward the request.
Otherwise, ignore it. This is only sent, if #canDrop: returned true;
if you redefined #canDrop: in a subclass, #drop:at: must also be redefined.
-
dropObjects: aCollectionOfDropObjects
-
someone wants to drop aCollectionOfDropObjects (the OLD drop interface).
An error here, because this is only sent, if #canDrop: returned true;
if you redefined #canDropObjects: in a subclass, #dropObjects: must also be redefined.
** This method raises an error - it must be redefined in concrete classes **
-
dropObjects: aCollectionOfDropObjects at: aPoint
-
someone wants to drop aCollectionOfDropObjects (the OLD drop interface).
An error here, because this is only sent, if #canDrop: returned true;
if you redefined #canDropObjects: in a subclass, #dropObjects: must also be redefined.
-
dropTarget
-
returns the dropTarget or nil
-
dropTarget: aDropTragetOrNil
-
set the dropTarget
edge drawing
-
drawBottomEdge
-
draw bottom 3D edge into window frame
-
drawBottomEdgeLevel: level shadow: shadowColor light: lightColor halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawEdges
-
draw all of my 3D edges
-
drawEdgesForX: x y: y width: w height: h level: l
-
draw 3D edges into a rectangle
-
drawLeftEdge
-
draw left 3D edge into window frame
-
drawLeftEdgeLevel: level shadow: shadowColor light: lightColor halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawRightEdge
-
draw right 3D edge into window frame
-
drawRightEdgeLevel: level shadow: shadowColor light: lightColor halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawTopEdge
-
draw top 3D edge into window frame
-
drawTopEdgeLevel: level shadow: shadowColor light: lightColor halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
redrawEdges
-
redraw my edges (if any)
enumerating subviews
-
allSubViewsDetect: aBlock ifNone: exceptionBlock
-
find a subview for which aBlock returns true (recursively)
-
allSubViewsDo: aBlock
-
evaluate aBlock for all subviews (recursively)
-
allVisibleSubViewsDetect: aBlock ifNone: exceptionBlock
-
find a visible subview for which aBlock returns true (recursively)
-
changeSequenceOrderFor: aSubViewOrComponent to: anIndex
-
change a subview's position in the subviews collection.
Usually, this only affects the order of components in a panelView,
unless they overlap. In that case, the later view is placed above the earlier.
-
changeSequenceOrderForComponent: aComponent to: anIndex
-
change a components's position in the components collection.
The later components is drawn above the earlier.
-
changeSequenceOrderForView: aSubView to: anIndex
-
change a subview's position in the subviews collection.
Usually, this only affects the order of components in a panelView,
unless they overlap. In that case, the later view is placed above the earlier.
-
withAllSubViewsDo: aBlock
-
evaluate aBlock for the receiver and all subviews (recursively)
event handling
-
alienDrop: aCollectionOfDropObjects position: positionOrNil
-
a drop from some other non-ST/X application.
-
buttonMultiPress: button x: x y: y
-
button was pressed quickly again - check my components for a hit.
-
buttonPress: button x: x y: y
-
button was pressed - check my components for a hit.
-
buttonRelease: button x: x y: y
-
button was released - check my components for a hit.
-
changeScaleForMouseWheelZoom: amount
-
CTRL-wheel action.
ignored here - redefined in views which can zoom
-
clientMessage: msgType format: msgFormat eventData: msgData
-
a client message - very X-specific and only useful for special applications.
Forwarded to my application (if I have one)
-
closeRequest
-
programmatic close request
-
configureX: x y: y width: newWidth height: newHeight
-
my size has changed by window manager action
-
containerChangedSize
-
my container has changed size; if I have relative
origin/extent or blocks to evaluate, do it now ..
-
containerMapped
-
my container was mapped (became visible).
If I was previously realized, this implies that I myself
am now mapped as well.
-
containerUnmapped
-
my container was unmapped
- this implies that the recevier is now also unmapped.
-
copyDataEvent: parameter eventData: msgData
-
a copyData message - very Win32-specific and only useful for special applications.
Forwarded to my application (If I have one)
-
destroyed
-
view has been destroyed by someone else (usually window system)
-
dropMessage: dropTypeSymbol data: dropValue position: dropPosition handle: dropHandle
-
a drop from some other window (X: DND or Win32 drag&drop).
Convert to the ST/X drag and drop protocol here.
-
exposeX: x y: y width: w height: h
-
a low level redraw event from device
- let subclass handle the redraw and take care of edges here
-
focusIn
-
got keyboard focus (via the window manager).
Nothing done here
-
focusOut
-
lost keyboard focus (via the window manager).
Nothing done here
-
hasKeyboardFocus: aBoolean
-
notification from the windowGroup that I got the keyboardFocus.
-
keyPress: key x: x y: y
-
a key has been pressed. If there are components,
pass it to the corresponding one.
Otherwise, forward it to the superview, if there is any.
-
keyRelease: key x: x y: y
-
a key has been released. If there are components,
pass it to the corresponding one.
Otherwise, do whatever my superclass would do.
-
mapped
-
the view has been mapped (by some outside
action - i.e. window manager de-iconified me)
-
mouseWheelMotion: buttonState x: x y: y amount: amount deltaTime: dTime
-
the mouseWheel was turned - handle as a scroll operation.
Specialized application windows may redefine this for any other
operation.
Here, we scroll some amount which depends upon the views contents height
(but never too much);
if shift is pressed, always scroll a single scroll-step;
if ctrl is pressed, always scroll one page.
-
mouseWheelZoom: amount
-
CTRL-wheel action.
ignored here - redefined in views which can zoom
-
pointerEnter: state x: x y: y
-
mouse pointer entered - request the keyboard focus (sometimes)
-
reparented
-
the view has changed its parent by some outside
action - i.e. window manager has added a frame.
nothing done here
-
saveAndTerminate
-
window manager wants me to save and go away;
- notice, that not all window managers are nice enough to
send this event, but simply destroy the view instead.
Can be redefined in subclasses to do whatever is required
to prepare for restart.
-
scaleMouseWheelScrollAmount: amountToScroll
-
-
sizeChanged: how
-
tell subviews if I change size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity)
-
subViewChangedSize
-
some subview has changed its size; we are not interested
in that here, but some geometry managers redefine this, to reorganize
components if that happens.
-
terminate
-
window manager wants me to go away;
- notice, that not all window managers are nice enough to
send this event, but simply destroy the view instead.
Can be redefined in subclasses to do whatever cleanup is
required.
-
unmapped
-
the view has been unmapped
(either by some outside action - i.e. window manager iconified me,
or due to unmapping of my parentView).
-
visibilityChange: how
-
the visibility of the view has changed (by some outside
action - i.e. window manager rearranged things).
Using this knowledge avoids useless redraw in obscured views.
-
visibilityStateChanged
-
this is called when our visibilityChannel changes
-
win32NativeScroll: scrollCode position: newPosition
-
this is generated by a native scrollBar widget.
We should never arrive here, as its only supposed to be
sent to scrollableViews...
event simulation
-
pushEvent: aSelector
-
push some messageSend into my event queue -
I will perform the corresponding method when its time
to handle events (useful to update low-prio views from
a higher prio process, to avoid blocking in the high prio one)
-
pushEvent: aSelector with: arg
-
push some 1-arg messageSend into my event queue -
I will perform the corresponding method when its time
to handle events (useful to update low-prio views from
a higher prio process, to avoid blocking in the high prio one)
-
pushEvent: aSelector with: arg1 with: arg2
-
push some 1-arg messageSend into my event queue -
I will perform the corresponding method when its time
to handle events (useful to update low-prio views from
a higher prio process, to avoid blocking in the high prio one)
-
pushEvent: aSelector withArguments: args
-
push some messageSend into my event queue -
I will perform the corresponding method when its time
to handle events (useful to update low-prio views from
a higher prio process, to avoid blocking in the high prio one)
-
startButtonLongPressedHandlerProcess
-
start a process, which simulates a right-button press if the left-button
has been pressed, but not released, and stayed pressed for a while.
This is very handy for single-button-mice, as used with the MAC
-
stopButtonLongPressedHandlerProcess
-
stop any long-button-pressed process
focus handling
-
canTab
-
returns true if the widget is tabable
-
canTab: aBoolean
-
set widget tabable or not
-
doNotRequestFocusOnPointerEnter
-
returns true if widget SHOULD NOT request the focus on pointer enter;
if false is returned, the behavior depends upon the settings.
-
doNotRequestFocusOnPointerEnter: aBoolean
-
if true, setup that the widget SHOULD NOT request the focus on pointer enter;
if false, the behavior depends upon the settings.
-
focusNext
-
get next focus view to self
Skip invisible, disabled or widgets the extent is to small
-
focusNextChildAfter: aChildView
-
get the next focus view after aChildView in mySelf or nil,
if there is none.
Skip invisible or disabled widgets
-
focusNextForWhich: aCondition
-
get next focus view to self
Skip invisible, disabled or widgets the extent is to small
-
focusPrevious
-
get previous focus view to self
Skip invisible & disabled widgets.
-
focusPreviousChildBefore: aChildView
-
get the previous focus view before aChildView in mySelf or nil, if there is none.
Skip invisible or disabled widgets
-
requestDoNotFocusOnPointerEnter
-
returns true if widget SHOULD NOT request the focus on pointer enter;
if false is returned, the behavior depends upon the settings.
-
requestDoNotFocusOnPointerEnter: aBoolean
-
if true, setup that the widget SHOULD NOT request the focus on pointer enter;
if false, the behavior depends upon the settings.
-
requestFocus
-
request focus from my windowGroup;
typically, this is invoked when the mouse pointer enters a
widget. The request may or may not be ignored by the wGroup
(it will be ignored, if an explicit focus-change is currently
active - i.e. if the user tabbed into a widget)
-
requestFocusOnPointerEnter
-
returns true if widget SHOULD request the focus on pointer enter;
if false is returned, the behavior depends upon the settings.
-
requestFocusOnPointerEnter: aBoolean
-
if true, setup that the widget SHOULD request the focus on pointer enter;
if false, the behavior depends upon the settings.
-
showFocus: explicit
-
highlight myself somehow to tell user that I have the focus.
If explicit is true, the focus came via focusStepping (i.e. tabbing);
if false, it came via the window manager (i.e. pointer entering).
Only change my border, if this is an explicit focusChange.
-
showNoFocus: explicit
-
undo the effect of showFocus.
Explicit tells if the focus came via focusStepping (i.e. tabbing)
or via the window manager (i.e. pointer entering).
Only change my border, if this is an explicit focusChange.
-
subviewsInFocusOrder
-
-
takeFocus
-
Unconditionally take the focus from my windowGroup
-
wantsFocusWithButtonPress
-
views which do not like to take the keyboard focus
with buttonPress can do so by redefining this
to return false
-
wantsFocusWithPointerEnter
-
views which like to take the keyboard focus
when the pointer enters can do so by redefining this
to return true
grabbing
-
forceUngrabKeyboard
-
force a keyboard ungrab - even if was not the grabber
-
forceUngrabPointer
-
force a pointer ungrab - even if was not the grabber
-
grabKeyboard
-
grab the keayboard - that is: report all keyboard events to myself,
even if the mouse moved out of myself.
Returns true, if the grab was sucessfull (could fail, if some other
application has a grab - but thats very unlikely).
-
grabPointer
-
grab the pointer - that is: report all motion events relative to
myself, even if moved out of myself.
Returns true, if the grab was sucessfull (could fail, if some other
application has a grab - but thats very unlikely).
-
grabPointerWithCursor: aCursorOrNil
-
grab the pointer - that is: report all motion events relative to
myself, even if moved out of myself.
Show aCursor during the grab, if the cursor argument is not nil.
Returns true, if the grab was sucessfull (could fail, if some other
application has a grab - but thats very unlikely).
-
ungrabKeyboard
-
ungrab the keyboard - but only if I was the grabber
-
ungrabPointer
-
ungrab the pointer - but only if I was the grabber
informing others of changes
-
contentsChanged
-
this one is sent, whenever contents changes size -
tell dependents about the change (i.e. scrollers).
-
noticeOfWindowClose
-
-
noticeOfWindowOpen
-
-
originChanged: delta
-
this one is sent, after the origin of my contents has changed -
tell dependents (i.e. scrollers) about this
-
originWillChange
-
this one is sent, just before viewOrigin changes -
gives subclasses a chance to catch scrolls easily
(for example to hide cursor before scroll)
initialization & release
-
defaultControllerClass
-
-
defaultExtent
-
return the default extent of my instances.
-
defaultFont
-
-
destroy
-
unmap & destroy - make me invisible, destroy subviews then
make me unknown to the device
-
initEvents
-
will be sent by create - can be redefined by subclasses to enable
view events
-
initStyle
-
this method sets up all style dependent things
-
initStyleSheet
-
this method gets the styleSheet
-
initialize
-
initialize all state of the view - usually redefined in subclasses,
but always doing a 'super initialize'. Each class should setup its
locals - and not forget the others.
View setup is separated into two parts, the general setup done here
and the style specific setup in initStyle. Each view should be prepared
for a stylechange by being sent another initStyle with a new style value.
(in this case, it should set all of its style-dependent things, but
leave the state and contents as-is)
-
initializeMiddleButtonMenu
-
a place to initialize menu - this one is sent once when the view-object is initialized.
usually redefined in subclasses; default here is no menu.
Notice, that static middleButtonmenus are a historic thing in ST/X;
you may prefer to create the menu dynamically.
-
prepareForReinit
-
-
reinitStyle
-
this method is called for a style change
-
reinitialize
-
this is called right after snapIn
-
release
-
remove all dependencies from the receiver
-
restarted
-
sent by my windowGroup, when restarted from an image.
Nothing done here, but can be redefined to perform any actions
required to reset some state after an image-restart.
Only top views (usually instances of TopView) get this message sent.
Since SimpleViews can act as a top view, too this message is implemented
in SimpleView
keyboard control
-
defineShortcutAndTranslateLabelStringFrom: aString
-
-
mnemonicKey
-
get the mnemonic key or nil if undefined
-
mnemonicKey: aSymbolOrNil
-
set or clear the mnemonic key
-
mnemonicViewNext: aKeyEvent
-
a mnemonicKey event as forwarded from the keyboardProcessor - if there
is the mnemonic-key defined for a subView return the view otherwise nil.
-
performShortcutAction
-
perform my shortcutKey action.
-
processShortcut: aKeyEvent
-
a shortcutKey event as forwarded from the keyboardProcessor - if there is the
shortcut-key defined process the shortcut and return true otherwise false.
-
shortcutAndTranslatedStringFrom: aString
-
return an array filled with an extracted shortcut key and a translated string;
looks for and reemoves any ampercent character from aString, and adds underline emphasis to the
following character
-
shortcutKey
-
get the shortcut key
-
shortcutKey: aSymbolOrNil
-
set or clear the shortcut key
menu handling
-
activateMenu
-
activate my menu.
This code will move into the controller ASAP
If there is a static middleButtonMenu, that one is taken,
and handled in the superClass (static menus are a historic leftOver).
Otherwise, the follwing steps are performed:
- ask the receiver for the menu (via #yellowButtonMenu)
- ask the receiver for the menuPerformer.
- startUp the menu - it is supposed to return an actionSelector
- if the menuPerformer responds to the selector,
send it to the performer;
otherwise send it to the view (the receiver)
This is funny, it allows additional menuItems to be added
AND still get the views copy/cut/paste functionality.
Without this, you had to redefine and forward all of those
messages in the performer.
-
dispatchMenuSelection: menuSelection to: aMenuPerformerOrNil
-
dispatch a menu message.
This code will move into the controller ASAP
-
menuFromSpec: aMenuOrMenuSpec
-
create a menu for the receiver from a spec
-
startUpMenu: aMenu
-
private
-
componentsContainingX: x y: y do: aBlock
-
-
computeInnerClip
-
compute, but do not set the inside clip-area
-
cornerFromRelativeCorner
-
compute & return pixel corner from relativeCorner
-
cornerFromRelativeCorner: aPoint
-
compute & return pixel corner from a relativeCorner, aPoint
-
detectViewAt: aPoint
-
find the subView which contains aPoint - invisible components are ignored.
This is almost the same as #componentContainingX:y: (if that existed)
-
detectViewAt: aPoint ignoreInvisible: ignoreInvisible
-
find the subView which contains aPoint - invisible components are ignored if
the ignoreInvisible argument is false.
This is almost the same as #componentContainingX:y: (if that existed)
-
explicitExtent: aBoolean
-
set the exeplicit extent flag to aBoolean.
-
extentFromRelativeExtent
-
compute & return pixel extent from relativeExtent
-
extentFromRelativeExtent: aPoint
-
compute & return pixel extent from relativeExtent, aPoint
-
originFromRelativeOrigin
-
compute & return pixel origin from relativeOrigin
-
originFromRelativeOrigin: aPoint
-
compute & return pixel origin from relativeOrigin, aPoint
-
pixelCorner: corner
-
set the views corner in pixels
-
pixelExtent: extent
-
set the views extent in pixels
-
pixelOrigin
-
return the views origin in pixels. For subviews. the origin is relative
to the superviews top-left. For topViews, its the screen origin.
-
pixelOrigin: origin
-
set the views origin in pixels. For subviews. the origin is relative
to the superviews top-left. For topViews, its the screen origin.
-
pixelOrigin: origin corner: corner
-
set the views origin and corner in pixels
-
pixelOrigin: origin extent: extent
-
set the views origin and extent in pixels
-
pointFromRelative: p
-
compute absolute coordinate from p
-
setBorderColor
-
set my borderColor in the physical view (if supported by the device)
-
setInnerClip
-
compute, and set the inside clip-area
-
setShown: aState
-
-
setViewShape
-
-
windowGroupClass
-
queries
-
canHandle: aKey
-
return true, if I like to handle the key (from a keyPress event).
OBSOLETE: do not use & depend on this method, it is a historic
leftOver and will be removed. Use the delegation mechanism for this.
-
canHandle: aKey from: aView
-
return true, if I like to handle the key (from a keyPress event)
in aView.
OBSOLETE: do not use & depend on this method, it is a historic
leftOver and will be removed. Use the delegation mechanism for this.
-
computePreferredExtent
-
compute answer the preferred extent, disregarding
an explicit or cached preferred extent for the computation
-
cornerChangedFlag
-
^ cornerChangedFlag == true
-
cornerChangedFlag: aBoolean
-
cornerChangedFlag := aBoolean
-
delegatesTo: someone
-
return true, if I delegate events to someone
-
escapeIsCancel
-
return the escapeIsCancel setting - defaults to true for popupViews here.
-
extentChangedBeforeCreatedFlag
-
-
extentChangedBeforeCreatedFlag: aBoolean
-
-
extentChangedFlag
-
^ extentChangedFlag == true
-
extentChangedFlag: aBoolean
-
extentChangedFlag := aBoolean
-
hasExplicitFocus
-
return true, if the receiver has the keyboard focus
via the focusView mechanism in the windowGroup
-
hasFocus
-
return true, if the receiver has the keyboard focus
(either via the focusView mechanism in the windowGroup,
or via delegation)
-
is3D
-
return true, if my style is some kind of 3D style
This is OBSOLETE and will be removed.
-
isBorderedWrapper
-
-
isComponentOf: aViewOrComponent
-
return true, if I am a (direct or indirect) component of aViewOrComponent
-
isCursorKeyConsumer
-
return true, if the receiver can be controlled by cursor keys;
i.e. it can handle some keyboard input,
isCursorKeyConsumer are potential candidates for getting the keyboard
focus initially within dialogBoxes, or when the focus-follows-pointer
mode is off.
Return false here, this is redefined in SelectionInListView.
-
isDefault
-
return true, if I am a default widget;
Used with autoAccept. Currently only default buttons are supposed to return
true here
-
isExternalTopView
-
return true, if this is an external topView - always false here
-
isInputField
-
return true, if the receiver is some kind of input view,
i.e. it should (can) be part of an enterGroup.
Return false here, this is redefined in EnterField.
-
isJavaView
-
-
isKeyboardConsumer
-
return true, if the receiver is a keyboard consumer;
i.e. it can handle (non-shortkey) keyboard input,
keyboardConsumer are potential candidates for getting the keyboard
focus initially within dialogBoxes, or when the focus-follows-pointer
mode is off.
Return false here, this is redefined in EditTextView and EditField.
-
isLayoutWrapper
-
answer true, if this view defines the layout of it's subviews
-
isMDIClientView
-
-
isModal
-
return true, if the receiver has been opened modal.
For compatibility with topView (if regular views are the window of an application),
return false here.
-
isSameOrComponentOf: aView
-
return true, if I am aView or a (direct or indirect) component of aView
-
isScrollWrapper
-
answer true if this view wraps a possibly larger view and has scroll bars
-
isSubViewOf: aView
-
return true, if I am a (direct or indirect) subview of aView
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
isTextView
-
I am not showing text (showing lines)
-
isTransparentBox
-
-
isWrapper
-
-
originChangedFlag
-
^ originChangedFlag == true
-
originChangedFlag: aBoolean
-
originChangedFlag := aBoolean
-
originChangedFlag: originChanged extentChangedFlag: extentChanged
-
-
originChangedFlag: originChanged extentChangedFlag: extentChanged cornerChangedFlag: cornerChanged
-
-
originOrExtentChanged
-
^ originChanged or:[extentChanged].
-
originOrExtentOrCornerChanged
-
^ originChanged or:[extentChanged or:[cornerChanged]].
-
preferredBounds
-
ST-80 compatibility.
-
preferredExtent
-
return my preferred extent - this is the minimum size I would like to have.
If the preferredExtent has been set, that one is returned.
Otherwise, if there are any components, a rectangle enclosing them
is returned. Otherwise, the actual extent is returned.
-
preferredHeight
-
-
preferredWidth
-
-
reallyRealized
-
return true, if the receiver is realized and all containers
are realized.
-
resources
-
return the views resources -
that's a ResourcePack containing national language strings
-
sizeFixed
-
return true, if this vew wants its size to remain unchanged.
Used by panels, to check if their components want to keep their size.
-
tabRequiresControl
-
returns true, if a focus tabbing requires a control-key to be pressed.
The default is true for editTextView, false for other widgets,
to allow for easier text entry
-
window
-
for compatibility with applicationModels ... return the receiver
queries-delegation
-
handlesMouseWheelMotion: event inView: aView
-
we do not handle delegated mousewheel events - subclasses may handle them
queries-events
-
buttonMotionEventPending
-
return true, if a button motion event is pending.
Normally, you dont want to use this, since no polling is needed
(not even for mouse-tracking).
Actually, its a historical leftover
queries-internal
-
nativeWindowType
-
return a symbol describing my native window type - here, nil is returned
(may be used internally by the device as a native window creation hint)
-
specClass
-
fallback - heuristics to get a specClass for some viewClass.
Based upon my className, look for a corresponding Spec-class.
If there is none, return ArbiraryComponentSpec as a fallBack
-
windowStyle
-
return a symbol describing my style (one of: #dialog, #popUp or #normal)
-
windowType
-
return a symbol describing my type (one of: #mdichild or nil)
realization
-
closeCancel
-
for protocol compatibility with modal dialogs
-
create
-
create (i.e. tell my device about me) if not already created.
This does not make the view visible (needs a #map for that)
-
createWithAllSubViews
-
create, then create all subviews
-
fetchDeviceResources
-
fetch all device specific resources. This is invoked,
when the view is made visible on some device for the very first
time, to allocate device specific colors, fonts, bitmaps etc.
The view may keep those in instance variables, to avoid reallocating
those with every redraw.
If you ommit to do this, the views will still be able to display themself,
but possibly slower, since resources are reallocated over and over.
If you redefine this method, make certain that 'super fetchDeviceResources'
is always sent.
-
fixSize
-
This is called right before the view is made visible.
Adjust the size of the view according to either relative/abs or
block extent; also set origin. Also, subclasses may redefine this
method to adjust the size based on some extent (for example, PopUpMenus
do so to take care of changed number of menu entries).
-
forceResize
-
force resizing - even if already done
-
hide
-
only useful with modal views: hide the view and return control
back to the suspended main view. Ignored for non-modal views.
-
hideForAction
-
for popUpMenu compatibility;
this is invoked to hide a when it is going to perform its action
(in contrast to the generic hide).
-
hideRequest
-
for protocol compatibility with modal dialogs;
ignored here.
-
map
-
make the view visible on the screen.
For topViews, the windowManager will choose (or ask for) the
views position on the screen.
Notice:
Actually, this method is only valid for topViews;
however, it is defined here to allow things like 'Button new realize'
-
mapAt: aPoint
-
make the view visible on the screen.
For topViews, if aPoint is nonNil, the views origin is located there
(unless you have a dictator as windowManager ;-)
Notice:
Actually, this method is only valid for topViews;
however, it is defined here to allow things like 'Button new realize'
-
mapAt: aPoint iconified: iconified
-
make the view visible on the screen.
For topViews, if aPoint is nonNil, the views origin is located there
(unless you have a dictator as windowManager ;-).
If the iconified argument is true, the window is created as icon initially.
Notice:
Actually, this method is only valid for topViews;
however, it is defined here to allow things like 'Button new realize'
-
mapIconified
-
make the view visible on the screen.
For topViews, the view is created in iconified state
-
physicalCreate
-
common code for create & recreate:
physically create (but do not map) the view on the device.
-
postRealize
-
invoked after a view was realized.
Can be redefined in subclasses to perform delayed actions.
-
preRealize
-
invoked right before a view is realized.
Can be redefined in subclasses to perform delayed actions.
-
realize
-
realize - make visible;
realizing is done very late (after layout is fixed) to avoid
visible rearranging of windows on the screen
-
realizeAllSubViews
-
realize all my subviews - but not myself.
-
realizeAt: aPoint
-
realize - make visible;
realizing is done very late (after layout is fixed) to avoid
visible rearranging of windows on the screen
-
realizeInGroup
-
special realize - leave windowgroup as is;
This allows a view to be realized in any windowgroup;
for special applications, like the kill button in the Filebrowser which has
a windowGroup different from its superview's and is handled as a separate process.
-
realizeKeepingGroup: keepGroupAsIs at: position iconified: iconified
-
common helper for realize and realizeInGroup.
Create the view; if the keepGroupAsIs argument is not true,
assign my windowGroup.
-
recreate
-
recreate (i.e. tell X about me) after a snapin or a migration
-
remap
-
make the view visible on the screen at its previous position.
In contrast to map, this asks the windowManager to show the view
immediately (instead of asking for a frame). However, some windowManagers
are known to ignore this ...
-
rerealize
-
rerealize at old position in (a possibly different) windowGroup.
-
rerealizeInGroup: aWindowGroup
-
rerealize at old position in (a possibly different) windowGroup.
-
rerealizeWithAllSubViews
-
rerealize myself with all subviews
-
resize
-
resize myself to make everything fit into me.
Here, nothing special is done (except for setting my extent to the
preferredExtent), but may be redefined in some subclasses.
-
unmap
-
unmap the view - the view stays created (but invisible), and can be remapped again later.
-
unrealize
-
alias for unmap, for historic reasons
** This is an obsolete interface - do not use it (it may vanish in future versions) **
redrawing
-
clearExposedAreaInRedraw
-
return true here, if the exposed area should be cleared here
or not. In almost every situation, it makes sense to do so...
-
flash
-
flash the view - fill it black, then white, finally
redraw completely.
Can be used to wakeup the user :-)
when problem or warning conditions arise.
Someone may redefine this to flash its contents (instead of black/white).
-
invalidate
-
add a damage to redraw the recevier to its input event queue.
This is preferable to calling redraw directly, in that the drawing is done by
the views process itself, and there is a possibilty to merge
multiple damage rectangles into single redraws.
However, be aware, that the redrawing may be delayed for some time,
until the receivers windowGroupProcess gets rescheduled.
-
invalidate: aRectangle
-
add a damage to redraw part of the recevier, to its input event queue.
This is preferable to calling redraw directly,
in that the drawing is done by the views process itself,
and there is a possibilty to merge multiple damage rectangles into
single redraws.
However, be aware, that the redrawing may be delayed for some time,
intil the receivers windowGroupProcess gets rescheduled.
-
invalidate: aRectangle repairNow: doRepairNow
-
add a damage to redraw part of the receiver, to its input event queue.
and (if repairNow is true), force the receiver to repair all of its
damaged areas right now.
The given rectangle is in logical coordinate space.
-
invalidateDeviceRectangle: aRectangle repairNow: doRepairNow
-
add a damage to redraw part of the receiver, to its input event queue.
and (if repairNow is true), force the receiver to repair all of its
damaged areas right now.
The given rectangle is in device coordinate space.
-
invalidateRepairNow: doRepair
-
add a damage to redraw all of the receiver, to its input event queue.
and (if repairNow is true), force the receiver to repair all of its
damaged areas right now.
-
invalidateX: x y: y width: w height: h
-
add a damage to redraw all of the receiver, to its input event queue.
-
invalidateX: x y: y width: w height: h repairNow: doRepair
-
add a damage to redraw all of the receiver, to its input event queue.
and (if repairNow is true), force the receiver to repair all of its
damaged areas right now.
-
redraw
-
redraw myself completely - this is sent by redrawX:y:width:height:
as a fallback.
Cannot do much here - is redefined in subclasses which dont care for
updating regions but instead update everything.
-
redraw: aRectangle
-
redraw a part of the view immediately.
-
redrawComponentsIn: aRectangle
-
-
redrawDeviceX: x y: y width: w height: h
-
have to redraw part of the view.
The coordinates are in device space - if there is a transformation,
must inverse-transform back to logical coordinates. (since the view thinks
in its coordinate space)
-
redrawX: x y: y width: w height: h
-
redraw part of myself immediately, given logical coordinates
(if transformation is nonNil)
The default here is to redraw everything
- subclasses usually redefine this, adding more intelligence
-
renderOrRedraw
-
-
repairDamage
-
force the receiver to repair all of its
damaged areas right now.
-
showActive
-
redraw myself as active (i.e. busy).
Nothing done here, but redefined in some classes.
-
showPassive
-
redraw myself as inactive (i.e. nonbusy).
Nothing done here, but redefined in some classes.
scrolling
-
halfPageDown
-
scroll down half a page
-
halfPageUp
-
scroll up half a page
-
horizontalScrollStep
-
return the amount to scroll when stepping left/right.
Subclasses may want to redefine this.
-
pageDown
-
-
pageLeft
-
-
pageRight
-
-
pageUp
-
-
scrollDown
-
scroll down by some amount; this is called when the scrollbars
scroll-step down button is pressed.
-
scrollDown: nPixels
-
change origin to scroll down some pixels
-
scrollHorizontalTo: aPixelOffset
-
change origin to make aPixelOffset be the left col
-
scrollHorizontalToPercent: percent
-
scroll to a position given in percent of total
-
scrollLeft
-
scroll left by some amount; this is called when the scrollbars
scroll-step left button is pressed.
-
scrollLeft: nPixels
-
change origin to scroll left some pixels
-
scrollRight
-
scroll right by some amount; this is called when the scrollbars
scroll-step right button is pressed.
-
scrollRight: nPixels
-
change origin to scroll right some pixels
-
scrollToBottom
-
-
scrollToLeft
-
move viewOrigin to the left
-
scrollToPercent: originAsPercent
-
scroll to a position given in percent of total (x and y as a Point)
-
scrollToRight
-
move viewOrigin to the right
-
scrollToTop
-
move viewOrigin to top
-
scrollToTopLeft
-
move viewOrigin to top/left
-
scrollUp
-
scroll up by some amount; this is called when the scrollbars
scroll-step up button is pressed.
-
scrollUp: nPixels
-
change origin to scroll up (towards the origin) by some pixels
-
scrollVerticalTo: aPixelOffset
-
change origin to make aPixelOffset be the top line
-
scrollVerticalToPercent: percent
-
scroll to a position given in percent of total
-
verticalScrollStep
-
return the amount to scroll when stepping up/down (also used for mouseWheel).
Subclasses may want to redefine this.
-
widthForScrollBetween: yStart and: yEnd
-
return the width in pixels for a scroll between yStart and yEnd
- return full width here since we do not know how wide contents is.
Views which only use part of their space (short lists, text) may redefine
this method and return the number of pixels that have to be scrolled.
On slow displays, this may make a difference; on fast ones you will probably
not notice any difference.
scrolling-basic
-
scrollTo: newOrigin
-
change origin to have newOrigin be visible at the top-left.
The argument defines the integer device coordinates of the new top-left
point.
-
scrollTo: newOrigin redraw: doRedraw
-
change origin to have newOrigin be visible at the top-left.
The argument defines the integer device coordinates of the new top-left
point.
-
scrollTo: newOrigin redraw: doRedraw allowScrollBehondContents: allowScrollBehondContents
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
scrollTo: newOrigin redraw: doRedraw allowScrollBeyondContents: allowScrollBehondContents
-
change origin to have newOrigin be visible at the top-left.
The argument defines the integer device coordinates of the new top-left
point.
startup
-
open
-
open up the view - for normal views, this is a modeless open
(i.e. the new view comes up as independent process).
Although #open is only to be sent to topviews (i.e. it could have been
implemented in TopView), it is implemented here - therefore, every view
can be opened as a topView.
This is redefined in ModalBox, which comes up modal (i.e.
control is under the current process, so that interaction with the
current group is blocked while the modalBox is active).
Notice: after the open, you cannot be sure that the view is really open and
visible, since #open forks a new process, which does the actual window opening.
To ensure visibility, use #openAndWait or waitUntilVisible after the open.
-
openAndWait
-
open up the view - wait until it is visible.
In normal applications, you do not need to wait till the view is
open - it should do all of its drawing itself when it gets the
first expose event.
However, if you want to 'manually' draw into the view (for example,
in doIt expressions) the view must be visible (realized) before doing so.
Use this open in those situations.
-
openAt: aPoint
-
open up the view modeless - positions the view
-
openAtCenter
-
open up the view modeless - positions the view
-
openAutonomous
-
create and schedule a new windowgroup for me and open the view.
The view will be handled by its own process, effectively running in
parallel.
Notice:
This entry is for NON-topviews, which want to be served
autonomous from their real topview.
(see the fileBrowsers kill-button
when executing unix commands as an example)
-
openInGroup: aGroup
-
special open within another windowGroup.
This allows a view to be realized in any windowgroup;
for applications where multiple views act as a group
(i.e. close and iconify together).
-
openModal
-
create a new windowgroup, but start processing in the current process
actually suspending event processing for the currently active group.
Stay in the modalLoop while the view is visible.
(i.e. control is returned to the sender when the receiver is closed)
-
openModal: aBlock
-
create a new windowgroup, but start processing in the current process -
actually suspending event processing for the currently active group.
Stay in this modal loop while aBlock evaluates to true AND the receiver is
visible.
(i.e. control is returned to the sender when the receiver is closed)
This makes any interaction with the current window impossible -
however, other views (in other windowgroups) still work.
-
openModal: aBlock inGroup: aWindowGroup
-
create a new windowgroup, but start processing in the current process -
actually suspending event processing for the main group.
Stay in this modal loop while aBlock evaluates to true AND the receiver is
visible.
(i.e. control is returned to the sender when the receiver is closed)
This makes any interaction with the current window impossible -
however, other views (in other windowgroups) still work.
-
openModalAt: aPoint
-
open up the view modeless - positions the view
(i.e. circumvents window managers positioning)
-
openModalAtCenter
-
open up the view modeless - positions the view
(i.e. circumvents window managers positioning)
-
openModeless
-
create and schedule a new windowgroup for me and open the view.
The view will be handled by its own process, effectively running in
parallel (i.e. control is returned to the sender immediately).
-
openModelessAt: aPoint
-
open up the view modeless - positions the view
(i.e. tries to circumvent the window managers positioning)
Notice: some windowManagers seem to ignore this and always
ask the user to position the view.
-
openModelessAt: aPoint iconified: iconified
-
open up the view modeless - positions the view
(i.e. tries to circumvent the window managers positioning)
Notice: some windowManagers seem to ignore this and always
ask the user to position the view.
-
openModelessAtCenter
-
open up the view modeless - positions the view
(i.e. circumvents window managers positioning)
-
waitUntilVisible
-
wait until the receiver visible.
In normal applications, you do not need to wait till a view is
open - it should do all of its drawing itself when it gets the
first expose event.
However, if you want to 'manually' draw into the view (for example,
in doIt expressions), or subsequent views depend on some state of
another view (which is only available once visible),
use this to suspend the current process until the receiver is shown.
Caveat:
we poll here for the view to be shown - we need a semaphore
which is raised by the view in order to do it right.
user interaction & notifications
-
warn: aString
-
like Objects warn, but translates the string via the
resourcePack, thus giving a translated string automatically
-
warn: aString with: argument
-
like Objects warn, but translates the string via the
resourcePack, thus giving a translated string automatically
-
warn: aString with: arg1 with: arg2
-
like Objects warn, but translates the string via the
resourcePack, thus giving a translated string automatically
-
warn: aString with: arg1 with: arg2 with: arg3
-
like Objects warn, but translates the string via the
resourcePack, thus giving a translated string automatically
AboutToOpenBoxNotificationSignal
ArbitraryViewShape
RoundViewShape
ViewShape
(all examples below use different viewBackgrounds,
to make the individual subviews visible)
a subView in a topView:
|top v|
top := StandardSystemView new.
v := View new.
v origin:0.25 @ 0.25 corner:0.75 @ 0.75.
top addSubView:v.
top open
|
the same, a bit more compact:
|top v|
top := StandardSystemView new.
v := View origin:0.25 @ 0.25 corner:0.75 @ 0.75 in:top.
top open
|
fixed position/size:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View origin:10@10
corner:50@50
in:top.
v2 := View origin:60@10
corner:150@100
in:top.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top open
|
same, using ST-80 way of bulding up view hierarchies
(recommended, if you plan to port applications later)
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v1 origin:10@10 corner:50@50.
v2 := View new.
v2 origin:60@10 corner:150@100.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1.
top add:v2.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top open
|
fixed origin, variable size:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v1 origin:10@10 corner:50@0.5.
v2 := View new.
v2 origin:60@10 corner:150@0.5.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1.
top add:v2.
top open
|
fixed origin, variable size,
bottomInset for constant distance from bottom:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v1 origin:10@10 corner:50@1.0.
v1 bottomInset:10.
v2 := View new.
v2 origin:60@10 corner:150@1.0.
v2 bottomInset:10.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1.
top add:v2.
top open
|
variable origin, variable size,
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v1 origin:0.0@0.0 corner:0.5@0.5.
v2 := View new.
v2 origin:0.5@0.0 corner:1.0@0.5.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1.
top add:v2.
top open
|
variable origin, variable size,
insets for some constant distance
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v1 origin:0.0@0.0 corner:0.5@0.5.
v1 rightInset:5.
v2 := View new.
v2 origin:0.5@0.0 corner:1.0@0.5.
v2 leftInset:5.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1.
top add:v2.
top open
|
using layout objects (ST-80 style):
fully specifying the frame
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v2 := View new.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1 in:(LayoutFrame new
leftFraction:0.25;
rightFraction:0.75;
topFraction:0.0;
bottomFraction:0.5).
top add:v2 in:(LayoutFrame new
leftFraction:0.5;
rightFraction:1.0;
topFraction:0.5;
bottomFraction:0.75).
top open
|
another one, with offsets:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v2 := View new.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1 in:(LayoutFrame new
leftFraction:0.0 offset:10;
rightFraction:1.0 offset:-10;
topFraction:0.0 offset:10;
bottomFraction:0.5).
top add:v2 in:(LayoutFrame new
leftFraction:0.0 offset:30;
rightFraction:1.0 offset:-30;
topFraction:0.5 offset:10;
bottomFraction:0.75).
top open
|
specifying origin only. Extent is views preferred
(notice, that plain views have some defaultExtent of 100@100)
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v2 := View new.
v1 viewBackground:(Color red).
v2 viewBackground:(Color yellow).
top add:v1 in:(LayoutOrigin new
leftFraction:0.25;
topFraction:0.0).
top add:v2 in:(LayoutOrigin new
leftFraction:0.5;
topFraction:0.5).
top open
|
same example, using buttons which compute their preferredBounds:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := Button label:'foo'.
v2 := Button label:'a very long buttonLabel'.
v1 backgroundColor:(Color red).
v2 backgroundColor:(Color yellow).
top add:v1 in:(LayoutOrigin new
leftFraction:0.25;
topFraction:0.0).
top add:v2 in:(LayoutOrigin new
leftFraction:0.5;
topFraction:0.5).
top open
|
border:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
top add:v1 in:(10@10 corner: 30@30).
v2 := View new.
top add:v2 in:(30@30 corner: 50@50).
v1 border:(SimpleBorder width:1 color:Color red).
v2 border:(SimpleBorder width:1 color:Color blue).
top open
|
|