|
Class: SimpleView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--ClockView
|
+--DSVLabelView
|
+--DigitalClockView
|
+--FilenameWidgetWithHistory
|
+--FramedBox
|
+--InputView
|
+--InspectorView
|
+--PanelView
|
+--ScrollBar
|
+--ScrollableView
|
+--Separator
|
+--ShadowView
|
+--SyncedMultiColumnTextView
|
+--SystemStatusMonitor
|
+--TabSpecRuler
|
+--Tools::CodeView2
|
+--Tools::CodeView2::GutterView
|
+--VariablePanel
|
+--View
|
+--ViewScroller
|
+--ViewWithAcceptAndCancelBar
|
+--ViewWithAcceptAndCancelBar::AcceptAndCancelBar
|
+--VisualRegion
|
+--XEmbedContainerView
|
+--XEmbedContainerView::ClientView
|
+--XWorkstation::WindowGroupWindow
- Package:
- stx:libview
- Category:
- Views-Basic
- Version:
- rev:
1.1102
date: 2024/04/28 08:12:39
- user: cg
- file: SimpleView.st directory: libview
- module: stx stc-classLibrary: libview
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)
unused_hiddenOnRealize <Boolean> don't show automatically when superview is realized.
now encoded in the flags.
(kept to keep the instVar size constant)
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 currently unused; will be responsible for
child layout management
visibilityChannel valueHolder to control the visiblity
helpKey for tooltips
dropTarget for drag&drop
(*) 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.
copyrightCOPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
examples_MDICurrently, these are experimental and work under Windows only
an MDI child:
[exBegin]
|top v1 v2|
top := StandardSystemView new.
top extent:450 @ 300.
top name:'MDI Client'.
top beMDIClientView.
top open.
v1 := View new.
v1 viewBackground:Color red.
v1 origin:50 @ 50 corner:150 @ 100.
v1 beMDIChildView.
top addSubView:v1.
v2 := View new.
v2 viewBackground:Color green.
v2 origin:50 @ 50 corner:150 @ 100.
v2 beMDIChildView.
top addSubView:v2.
[exEnd]
layoutComputationDue to historic reasons, there are 2 mechanisms to resize a view:
- (old, to be eliminated mechanism)
based upon info found in
relativeOrigin / relativeCorner / relativeExtent
originRule / cornerRule / extentRule
- (new, will migrate to that one)
letting a layoutObject compute things
Actually, the old mechanism is just as powerful, as the new (layoutObject
based) mechanism; with the help of block=rules, you can compute whatever
geometry is desired.
However, having 6 instance variables in every view creates some overhead,
which can be avoided in most cases (most views are either fixed-size or
relative-sized).
Therefore (and also to make porting of ST-80 apps easier), ST/X will migrate
to use layoutObjects.
You will not see a difference at the view's protocol level, since
existing interfaces will (silently) create layoutObjects as appropriate.
However, you should remove all direct accesses to the above mentioned
instance variables, to be prepared for that change.
Notice, that a view recomputes its size whenever its superview
changes size. This is done via:
sizeChanged
-> allSubviews: superViewChangedSize
If the geometry computation as performed in superViewChangedSize
is not powerful enough for your application, you can either:
- redefine superViewChangedSize
- create a special layoutObject which computes a new layout.
popupMenusDue to historic reasons, there are multiple mechanisms for popupMenu
definition:
- static menus
- dynamic menus from the view
- dynamic menus from the model / menuHolder
static menus
------------
The easiest to use is a static menu; this is useful, if some view
has a constant menu which never changes.
It can be defined at initialization time or redefined any time later.
The menu is defined with:
someView middleButtonMenu:<aPopUpMenu>
Compatibility note:
static menus should no longer be used - their operation
is incompatible with ST-80 and ST/X's dynamic menus.
Do not use them if you care for compatibility.
Also, they do not care for any menuPerformers or menuHolders.
(instead, they use a receiver instance variable, which gets the messages).
example:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top.
v1 viewBackground:Color red.
v2 := View origin:0.5@0.0 corner:1.0@1.0 in:top.
v2 viewBackground:Color yellow.
v1 middleButtonMenu:(
PopUpMenu
labels:#('foo' 'bar')
selectors:#(foo bar)
receiver:v1
).
top open.
dynamic menus
-------------
A dynamic menu can be provided by the view itself, or by the model.
In addition, TextViews allow a separate menuHolder to provide the menu
(i.e. it may be different from the model).
If the model shall provide the menu, set the view's menuMessage to a selector
which is sent to the model. This message should return a popUpMenu.
For textViews, the above is also valid, except if the menuHolder is explicitely
set - in this case, that one provides the menu; not the model.
Don't get confused by the fact that menuHolders are only supported
by textViews.
example: (in your application, the plug would be your application, topView or model)
Notice, that all menu messages are sent to the view (because no model was set)
- so the textView still performs the copy-function correctly
(but of course, does not respond to the fooBar messages).
If a model was set, the menu would try the model first, but send its messages
to the view IFF the model would not respond to the menu message.
(this allows mixing of menu messages for the view AND the model).
|top v1 v2 holder|
holder := Plug new.
holder respondTo:#menu1
with:[
v1 menuMessage:#otherMenu1.
PopUpMenu
labels:#('foo' 'bar')
selectors:#(foo bar).
].
holder respondTo:#otherMenu1
with:[
v1 menuMessage:#menu1.
PopUpMenu
labels:#('other foo' 'other bar')
selectors:#(foo bar).
].
holder respondTo:#menu2
with:[ PopUpMenu
labels:#('copy' 'bar2')
selectors:#(copySelection bar2)
].
top := StandardSystemView new.
top extent:300@300.
v1 := View origin:0.0@0.0 corner:0.5@1.0 in:top.
v1 viewBackground:Color red.
v2 := TextView origin:0.5@0.0 corner:1.0@1.0 in:top.
v2 contents:'pop me up'.
v1 model:holder; menuMessage:#menu1.
v2 menuHolder:holder; menuMessage:#menu2.
top open.
an additional goody is the possibility, to change the menuPerformer (textViews only).
If defined, that one will get the menus message (instead of the model/view).
However, like above, if it does not respond to the message, its still sent to
the view. Notice, that with non-textViews, the menuPerformer is always the model.
example:
(Notice: the executor understands the #copySelection message - therefore, the
views built-in copy is NOT performed
- it could be forwarded to the view, though.
This could be useful to intercept/filter things).
|top v menuProvider menuExecutor |
menuProvider := Plug new.
menuProvider respondTo:#menu
with:[ PopUpMenu
labels:#('copy' 'foo')
selectors:#(copySelection foo)
].
menuExecutor := Plug new.
menuExecutor respondTo:#copySelection
with:[Transcript showCR:'copy function'].
menuExecutor respondTo:#foo
with:[Transcript showCR:'foo function'].
top := StandardSystemView new.
top extent:300@300.
v := TextView origin:0.0@0.0 corner:1.0@1.0 in:top.
v contents:'pop me up'.
v menuHolder:menuProvider; menuMessage:#menu.
v menuPerformer:menuExecutor.
top open.
Signal constants
-
aboutToOpenBoxNotificationSignal
-
the following allows for knowledgable programmers to suppress dialog boxes,
(by proceeding with #abort) or to patch common controls right before opening...
-
boxClosedNotificationSignal
-
the following allows for knowledgable programmers to handle closed dialog boxes,
this is raised right after closing...
-
closeBoxNotificationSignal
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
closeBoxRequestSignal
-
this can be used (by some) to force closing a box
without terminating the modal action.
Special: useful only if another modal box is shown from inside a modal box,
where the second opened box wants to hide the first one.
This cannot be done via abort, as that would close both boxes.
Instead, use this signal to hide the first box, while the second is shown,
and still handled by a still-alive windowGroup.
Currently, the only box which supports this is the ProgressIndicator;
code will be moved to support all dialog boxes in the near future.
change & update
-
update: something with: aParameter from: changedObject
-
flush resources on language changes
defaults
-
defaultBackgroundColor
-
return the default background color for drawing - usually,
that is the same as the viewBackgroundColor.
Usage example(s):
View defaultBackgroundColor
|
-
defaultExtent
-
return the default extent of my instances.
The value returned here is usually ignored, and
the value from preferredExtent taken instead.
-
defaultFont
-
(comment from inherited method)
get the default font used for drawing
-
defaultFont: aFont
-
set the default font used for drawing
-
defaultForegroundColor
-
return the default background color for drawing - usually,
that is the same as the viewBackgroundColor.
Usage example(s):
View defaultForegroundColor
|
-
defaultStyle
-
return the default view style
Usage example(s):
-
defaultStyle: aStyle
-
set the view style for new views
Usage example(s):
View defaultStyle:#next. SystemBrowser start
View defaultStyle:#motif. SystemBrowser start
View defaultStyle:#iris. SystemBrowser start
View defaultStyle:#st80. SystemBrowser start
View defaultStyle:#normal. SystemBrowser start
|
-
defaultViewBackgroundColor
-
return the default view background
Usage example(s):
View defaultViewBackgroundColor
|
-
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
Usage example(s):
self readStyleSheetAndUpdateAllStyleCaches
|
-
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.
Usage example(s):
Dialog returnFocusWhenClosingModalBoxes:false
Dialog returnFocusWhenClosingModalBoxes:true
|
-
setDefaultStyle
-
set a default style as appropriate for the underlying system.
This is used if no setting is coming from a startup file or a preferences,
i.e. for standalone apps (with no .rc file)
-
styleSheet
-
return the view style sheet information (a dictionary).
Notice: returns a dummy styleSheet if headless
Usage example(s):
-
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.
Reminder: updateStyleCache is only called for those who implement it!
(i.e. it is not required to inherit it)
Usage example(s):
View updateAllStyleCaches
|
-
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
help specs
-
helpSpec
-
default is: no help-spec (should be redefined by concrete class if help is wanted).
initialization
-
initialize
-
to get language changes
-
postAutoload
-
(comment from inherited method)
postAutoload is sent to a class after it has been autoloaded.
This gives it a chance to arrange for automatic unloading to be done
after a while ...
This is NOT sent to statically compiled in or explicitely filedIn
classes.
The default action here is to do nothing.
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 it's 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
Usage example(s):
although this one does not know about models,
it can still send the model-assign message. This was done
to catch obsolete calls to on:aDevice.
|
-
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
-
onDevice:Screen current.
-
origin: origin in: aView
-
create a new view as a subview of aView with given origin
misc ui support
-
iconInBrowserSymbol
( an extension from the stx:libtool package )
-
the browser will use this as index into the toolbariconlibrary
resources
-
classResources
-
if not already loaded, get the classes resourcePack and return it
-
classResources: aResourcePack
-
allow setting of the cached classResources
-
flushAllClassResources
-
flush all classes resource translations.
Needed after a resource file has changed.
Usage example(s):
View flushAllClassResources
|
Usage example(s):
to change the language:
Language := #en.
Smalltalk changed:#Language.
View flushAllClassResources
or:
Language := #de.
Smalltalk changed:#Language.
View flushAllClassResources
|
-
flushClassResources
-
flush classes resource string translations.
Needed whenever a resource file or language has changed
-
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.
Usage example(s):
FileBrowser openOnXScreenNamed:'bitsy:0'
FileBrowser openOnXScreenNamed:':0'
View openOnXScreenNamed:'bitsy:0'
|
testing
-
hasOwnScrollbars
-
a hack for codeView2, which behaves like a TextView, but has its own
scrollbars embedded - sigh (an extra load one).
This allows for the UIBuilder to avoid creating an extra set around such
a view (as is the case with TextSpec with scrollbars when using CodeView2)
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
-
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
-
isVisualWorksController
-
-
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
-
openInWorld
-
accessing
-
actionAt: aPoint
-
if aPoint is over a clickable (anchor-) link, return its action.
Otherwise, return nil.
The action will be something responding to #value;
i.e. a block or Explainer::ActionWithInfo or similar
-
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
-
The helpKey (symbol) or nil.
This can be set programatically, in views which are constructed
'by hand' - i.e. not via the UI painter.
When constructed from a UI-spec, this key is typically specified there (activeHelpKey)
(however, special apps may change it dynamically, if a component changes
its semantic meaning dynamically)
-
helpKey: aSymbolOrNil
-
The helpKey (symbol) or nil.
This can be set programatically, in views which are constructed
'by hand' - i.e. not via the UI painter.
When constructed from a UI-spec, this key is typically specified there
(however, special apps may change it dynamically, if a component changes
its semantic meaning dynamically)
-
helpText
-
Any optional, dynamically assigned helptext.
If it was never set (via helpText:), then the normal mechanism
(using a helpKey and asking the app for the corresponding text) is used.
-
helpText: aString
-
Any optional, dynamically assigned helptext.
If it is never set (via helpText:), then the normal mechanism
(using a helpKey and asking the app for the corresponding text) is used.
Warning:
Only use explicit helpTexts for very dynamic tooltips, which cannot be generated via
the regular (language-xlated) helpKey mechanism.
-
helpTextAt: srcPoint
-
fallback to avoid DNU for those which do a super (which they should not)
-
keyboardProcessor
-
return my keyboard processor.
If non-nil, that one gets a chance to intercept and deal with things like
escape or return in modal boxes.
accessing-behavior
-
deadKeysEnabled: aBoolean
-
set to true if dead key processing is to be enabled
(for all windows - not only for me)
-
disable
-
alternative method; redirected to basic mechanism
-
disableDeadKeys
-
disable dead key processing
(for all windows - not only for me)
-
enable
-
alternative method; redirected to basic mechanism
-
enableDeadKeys
-
enable dead key processing
(for all windows - not only for me)
-
enabled
-
views are enabled by default
-
enabled: bool
-
this is the basic machanism to enable/disable a view.
empty in this class; redefined by many subclasses
-
isEnabled: aBoolean
-
ST-80 compatibility; set enabled state
-
preferFirstInputFieldWhenAssigningInitialFocus
-
define the focus behavior for dialogs.
If true is returned, input fields take precedence over other keyboard consumers.
This used to return true, but the behavior is somewhat ugly.
-
readOnly: aBoolean
-
ignored here; present for compatibility with some textView subclasses,
so that UIPainter can handle it in its TextView spec (which contains a
readOnly field)
accessing-bg & border
-
allSubViewsBackground: aColorOrImageOrForm
-
set the viewBackground to aColorOrImageOrForm, a color, image or form,
recursively in all of my subviews
-
allSubViewsBackground: aColorOrImageOrForm if: condition
-
set the viewBackground to aColorOrImageOrForm, a color, image or form,
recursively in all of my subviews
-
allSubViewsForeground: aColorOrImageOrForm
-
set the foreground to aColorOrImageOrForm, a color, image or form,
recursively in all of my subviews
-
allViewBackground: aColorOrImageOrForm
-
set the viewBackground to aColorOrImageOrForm, a color, image or form,
in myself and recursively in all of my subviews
-
allViewBackground: aColorOrImageOrForm if: condition
-
set the viewBackground to aColorOrImageOrForm, a color, image or form,
in myself and recursively in all of my subviews
-
allViewForeground: aColorOrImageOrForm
-
set the foreground to aColorOrImageOrForm, 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
Usage example(s):
-
borderColor: aColor
-
set my borderColor
-
borderShape: aForm
-
set the borderShape to aForm
-
borderWidth
-
return my borderWidth
-
borderWidth: aNumberOrNil
-
set my borderWidth
-
borderWidth: bwNumberOrNil level: levelIntegerNr
-
set my borderWidth and level
-
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: anInteger
-
set my 3D effect level relative to superView in nr of pixels
-
lightColor
-
return 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
-
return the color to be used for shadowed edges (3D only)
-
shadowColor: aColorOrImage
-
set the color to be used for shadowed edges (3D only)
-
viewBackground: aColorOrFormOrViewBackground
-
set the viewBackground to something, a color, image or form.
If it's 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.
-
viewBackground: aColorOrImageOrForm if: condition
-
set the viewBackground to aColorOrImageOrForm, a color, image or form,
in myself and recursively in all of my subviews
-
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 it's 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
-
heightOfContentsDependsOnWidth
-
a very special query which is used by the scrollableView,
to check if it should NOT automatically hide scrollbars, when the
pointer leaves the view.
Currently, there are only a small number of views which return true here,
one being the HTML view, which rearranges its text depending on the width,
and therefore, it is a bad idea to hide/show scrollbars dynamically
(as this might lead to annoying flicker if the hiding of the scrollbar
rearranges the contents)
-
widthOfContentsDependsOnHeight
-
a very special query which is only used by the scrollableView,
to check if it should NOT automatically hide scrollbars, when the
pointer leaves the view.
Currently, there is no view, which returns true
(maybe if we ever support chinese writing top to bottom...
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 corner's y position;
leaves the top unchanged
-
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).
-
computePreferredExtent
-
return my computed preferred extent - this is the minimum size I would like to have.
If there are any components, a rectangle enclosing them
is returned. Otherwise, the actual extent is returned.
-
corner
-
return the lower right corner-point (in pixels)
-
corner: corner
-
set the view's 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 view's 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 view's 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
-
flushCachedPreferredExtent
-
-
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
-
If set, this prevents the extent from being changed automatically
-
height: aNumber
-
set the view's 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 view's extent, but don't change its explicitExtent setting.
a variant of #extent.
-
initialHeight: aNumber
-
set the view's height in pixels, but don't change its explicitExtent setting
-
initialWidth: aNumber
-
set the view's width in pixels, but don't 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.
-
layoutChanged
-
-
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.
-
leftInset: lNumber rightInset: rNumber
-
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 necessary.
-
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
-
maxExtent
-
(comment from inherited method)
return the view's maximum extent - this is nil here.
Only standardSystemViews support this.
-
maxExtent: aPoint
-
(comment from inherited method)
set the view's maximum extent - ignored here.
Only standardSystemViews support this.
-
minExtent
-
(comment from inherited method)
return the view's minimum extent - this is nil here.
Only standardSystemViews support this.
-
minExtent: aPoint
-
(comment from inherited method)
set the view's minimum extent - ignored here.
Only standardSystemViews support this.
-
origin
-
return the origin (in pixels)
-
origin: origin
-
set the view's 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.
Usage example(s):
|top sub1 sub2 sub2ScreenOrg|
top := StandardSystemView new.
top origin:0@0 extent:200@200.
sub1 := View origin:0.2 @ 0.2 corner:0.8 @ 0.8 in:top.
sub2 := Button origin:0.3 @ 0.3 corner:0.7 @ 0.7 in:sub1.
top openAndWaitUntilVisible.
Transcript show:'button in top:'; showCR:(sub2 originRelativeTo:top).
sub2ScreenOrg := sub2 originRelativeTo:nil.
Transcript show:'button on screen:'; showCR:sub2ScreenOrg.
Transcript show:'move to: %1' with:sub2ScreenOrg.
top device setPointerPosition:sub2ScreenOrg.
Transcript show:'pointer now at %1' with:top device pointerPosition.
|
-
originRelativeToTopView
-
return the origin (in pixels) within my topView
-
originRule
-
return the origin block - non public; this will vanish without notice
-
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 already, that one is returned.
Otherwise, if there are any components, a rectangle enclosing them
is returned.
Otherwise, the actual extent is returned.
Usage example(s):
If I have an explicit preferredExtent..
|
Usage example(s):
If I have a cached preferredExtent value..
|
Usage example(s):
Transcript showCR: e'{self className} preferred:{preferredExtent}'.
|
-
preferredExtent: anExtentPoint
-
override the view's own preferredExtent computation,
and let it prefer the size given by the argument.
-
preferredHeight
-
-
preferredHeightIncludingBorder
-
return my preferred height including border
(this is my preferred height as seen from the outside view;
while #preferredHeight returns the height as seen by myself)
-
preferredWidth
-
-
preferredWidthIncludingBorder
-
return my preferred width including border
(this is my preferred width as seen from the outside view;
while #preferredWidth returns the width as seen by myself)
-
relativeCorner
-
return the relative corner or nil
-
relativeCorner: aPoint
-
set the relative corner;
does not resize the view (i.e. to be done before the view is shown,
or must be followed by containerChangedSize to force it)
-
relativeExtent
-
return the relative extent or nil.
Obsolete: please use a layout object.
-
relativeExtent: aPoint
-
set the relative extent.
does not resize the view (i.e. to be done before the view is shown,
or must be followed by containerChangedSize to force it).
Obsolete: please use a layout object.
-
relativeOrigin
-
return the relative corner or nil
-
relativeOrigin: aPoint
-
set the relative origin.
does not resize the view (i.e. to be done before the view is shown,
or must be followed by containerChangedSize to force it).
-
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
-
return true, if this view wants its size to remain unchanged
(or it was explicitly set for a panel to not resize it in a fit layout).
Used by panels, to check if their components want to keep their size.
-
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 view's 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
-
-
unmarkAsUnmappedModalBox
-
accessing-hierarchy
-
components
-
return the collection of non-view components.
For now, ST/X does not use those (instead real native views are used).
However, this is provided as a hook for VW compatible applications.
-
container
-
return my container
-
container: aContainer
-
set my container (i.e. superView) to be aContainer
-
hierarchicalIndex
-
-
hierarchicalIndexInList: aViewCollection
-
no conflict
-
hierarchicalIndexOfChild: aView
-
-
hierarchicalUUID
-
-
lower
-
bring to back
Usage example(s):
-
raise
-
bring to front
Usage example(s):
-
scrolledView
-
for compatibility with scrolledView, return myself.
So you can ignore the scrollability of a component when accessing it,
without a need to ask for being a scrollwrapper first.
Eg, you can send someView scrolledView to get the underlying view,
without a danger of a DNU, if the component is not scrolled.
-
setContainer: aContainer
-
set my container (i.e. superView) to be aContainer
-
subViews
-
return the collection of subviews
-
subViews: aListOfViews
-
set the collection of subviews
** 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 - that's the one with no superview.
For ST-80 compatibility.
-
topView
-
return the topView - that's the one with no superview
-
uuidStringOrName
-
-
view
-
return my view - for real views, that's 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 acquire 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 - that's the direction where the contents will move
when the view is resized.
-
bitGravity: gravity
-
set the bitGravity - that's the direction where the contents will move
when the view is resized.
-
clippingBounds: aRectangleOrNil
-
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
-
fullXPath
-
return my full xPath 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 for my process in the
process monitor. This has no semantic meaning, but exists
for your convenience only.
Normally, we should not arrive here, as this is defined in StandardSystemView;
however, just in case another view is opened as non-modal top view.
-
reverseOrderIfOKAtLeft: aBoolean
-
for compatibility with PanelView - so this message can be sent to any view
-
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.
-
viewGravity
-
return the viewGravity - that's the direction where the view will move
when the superView is resized.
-
viewGravity: gravitySymbol
-
Modified (format): / 05-04-2021 / 10:23:03 / cg
accessing-mvc
-
application
-
return the application, under which this view was opened,
or nil, if there is no application
-
controller
-
return the controller. For views which implement the controller
functionality themself, return the receiver itself
-
controller: aController
-
set the controller - that's the one handling user events
-
model
-
return nil - simpleViews have no model (only providing geometric)
-
sensor
-
return the view's sensor.
Attention: if there is no windowGroup yet
(i.e. the view is initializing and not yet realized),
then a synchronous sensor is returned in order to handle
pushed events.
Don't use this to check for a sensor being present.
Use sensorOrNil for that.
Usage example(s):
The synchronous sensor would execute the pushed action immediately.
|
Usage example(s):
Logger warn:'Sensor assumes active WG''s sensor'.
|
Usage example(s):
-
sensorOrNil
-
return the view's sensor if there is one.
Attention: if there is no windowGroup yet
(i.e. the view is initializing and not yet realized),
then nil is returned
-
setController: aController
-
set the controller but do not affect the model/view releationship
-
setWindowGroup: aGroup
-
set the window group.
Unsafe; do not use.
-
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 bottoms
-
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; that's 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)
Usage example(s):
|top topFrame check list|
top := StandardSystemView new.
top extent:150@400.
topFrame := VerticalPanelView origin:0.0@0.0 corner:1.0@0.4 in:top.
topFrame horizontalLayout:#leftSpace.
topFrame add:(check := CheckBox label:'hidden').
check pressAction:[list beInvisible].
check releaseAction:[list beVisible].
list := ScrollableView for:SelectionInListView.
list origin:0.0@0.4 corner:1.0@1.0.
list list:#('foo' 'bar' 'baz').
top add:list.
check turnOn.
list beInvisible.
top open
|
-
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.
Notice: if there is a visibilityChanne, this static flag is ignored.
For ST-80 compatibility, please use #beVisible / #beInvisible.
-
isBeingDestroyed
-
a flag which is set, when the view is being destroyed.
Can be checked to avoid some resizing and other layout reorganizations
(especially in panels), which otherwise occur while subviews are removed.
-
isBeingDestroyed: aBoolean
-
a flag which is set, when the view is being destroyed.
Can be checked to avoid some resizing and other layout reorganizations
(especially in panels), which otherwise occur while subviews are removed.
-
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.
Notice: if there is a visibilityChanne, the static flag is ignored.
-
isReallyShown
-
return true, if the view is visible AND all of its containers are
-
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
Usage example(s):
|v h|
v := View new.
v visibilityChannel:(h := ValueHolder with:true).
v open.
Delay waitForSeconds:2.
h value:false.
Delay waitForSeconds:2.
h value:true.
Delay waitForSeconds:2.
|
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.
Don't use this right now for non-views
-
addSubView: newView
-
add a view to the collection of subviews
-
addSubView: newView after: aViewOrNil
-
add a view to the collection of subviews after another view.
If the argument aViewOrNil is nil, the newView is added at the end.
This makes sense, in Panels and other layout views, to enter a new
element at some defined place.
-
addSubView: newView before: aViewOrNil
-
add a view to the collection of subviews before another view.
If the argument aViewOrNil is nil, the newView is added at the beginning.
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.
Don't use this right now for non-views
-
destroySubViews
-
remove all subviews
-
removeComponent: aComponent
-
components (i.e. gadgets or lightweight views) are being prepared.
Don't 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
-
accept
-
accept the current contents by executing the accept-action and/or changeMessage.
-
acceptIsUserAction: isUserAction
-
accept the current contents by executing the accept-action and/or changeMessage.
isUserAction is false, if indirectly accepted
(only when coming via a dialog's ok button)
-
borderChanged
-
top margin
-
borderChanged: aspect
-
top margin
-
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
-
intentionally empty
-
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.
Usage example(s):
View new realize showBusyWhile:[ Delay waitForSeconds:5 ]
Transcript showBusyWhile:[ Delay waitForSeconds:5 ]
|
dependents access
-
addDependent: anObject
-
make the argument, anObject be a dependent of the receiver
-
breakDependents
-
remove all dependencies from the receiver
-
dependents
-
return a Collection of dependents.
Views keep them in an instance variable to avoid overhead.
-
dependents: aCollectionOrNil
-
set the collection of dependents.
Views keep them in an instance variable to avoid overhead.
-
dependentsDo: aBlock
-
evaluate aBlock for all of my dependents.
Views keep them in an instance variable to avoid overhead.
-
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 invoked for internal (stx->stx) drops).
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: aDropContext
-
called by the DragAndDropManager to scroll during a drag/drop operation
if required (decided by the widget itself).
If a scroll is done, return true;
otherwise false (used to restore the background).
-
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 must be redefined in concrete classes (subclassResponsibility) **
-
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 must be redefined in concrete classes (subclassResponsibility) **
-
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 (a DropTarget instance) or nil.
Can be either set statically (at init time), or created dynamically,
(by redefining this method to return a DropTarget instance).
The dropTarget object provides info about enter/leave/over/drop selectors,
to be sent to the view for a drag&drop operation.
If nil is returned, a default dropTarget instance is created by the DnD manager.
Notice, that if it is created dynamically, it should be remembered somewhere
inside the instance, and the identical object should be returned as long as
the drop operation is moving over the same item within a view.
Otherwise (if new objects are returned), the old dropTarget will get a
dropLeave and the new one a dropEnter with every motion.
Notice that the dropTarget is explicitly cleared at the end of the d&d operation.
-
dropTarget: aDropTragetOrNil
-
set the dropTarget (a DropTarget instance) or nil.
The dropTarget object provides info about enter/leave/over/drop selectors,
to be sent to the view for a drag&drop operation.
If nil is returned, a default dropTarget instance is created by the DnD manager.
Notice that the dropTarget is explicitly cleared at the end of the d&d operation.
edge drawing
-
drawBottomEdge
-
draw bottom 3D edge into window frame
-
drawBottomEdgeLevel: levelArg shadow: shadowColorArg light: lightColorArg halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawEdges
-
draw all of my 3D edges
-
drawEdgesForX: x y: y width: w height: h level: level
-
draw 3D edges into a rectangle
-
drawLeftEdge
-
draw left 3D edge into window frame
-
drawLeftEdgeLevel: levelArg shadow: shadowColorArg light: lightColorArg halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawRightEdge
-
draw right 3D edge into window frame
-
drawRightEdgeLevel: levelArg shadow: shadowColorArg light: lightColorArg halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawTopEdge
-
draw top 3D edge into window frame
-
drawTopEdgeLevel: levelArg atY: y shadow: shadowColorArg light: lightColorArg halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawTopEdgeLevel: level shadow: shadowColor light: lightColor halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
drawTopEdgeLevel: levelArg y: y shadow: shadowColorArg light: lightColorArg halfShadow: halfShadowColor halfLight: halfLightColor style: edgeStyle
-
-
redrawEdges
-
redraw my edges (if any)
enumerating view hierarchy
-
allSubViewsChildrenFirstDo: aBlock
-
evaluate aBlock for all subviews (recursively);
subviews are evaluated before superviews
-
allSubViewsDetect: aBlock ifNone: exceptionValue
-
find a subview for which aBlock returns true (recursively).
If there is none, return the value from exceptionValue
-
allSubViewsDo: aBlock
-
evaluate aBlock for all subviews (recursively)
-
allSuperViewsDetect: aBlock ifNone: exceptionValue
-
find a container for which aBlock returns true (recursively).
If there is none, return the value from exceptionValue
-
allSuperViewsDo: aBlock
-
evaluate aBlock for all superviews (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.
-
subViewsDo: aBlock
-
evaluate aBlock for all of my direct subviews (non-recursively)
-
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.
-
buttonMotion: state x: x y: y
-
button was moved
-
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.
Normally, this is not needed/called in subviews;
however, it is defined here to allow for any view to be
opened as a topView; i.e. (Button label:'foo') open
-
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.
Usage example(s):
-
containerUnmapped
-
my container was unmapped
- this implies that the receiver 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)
-
createWindowX: x y: y width: w height: h
-
A window has been created in myself, nothing to do here.
Note, that SubstructureNotify events must be enabled to get
this event. To enable, do:
self enableEvent: #substructureNotify
-
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
-
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.
-
keyboardZoom: largerBoolean
-
ALT+/- (was: CTRL+/-) action.
ignored here - redefined in views which can zoom
-
keyboardZoomInAllViews: largerBoolean
-
CTRL+/- zoom action for this windowGroup.
Sent to all windows; some may ignore it.
-
keyboardZoomReset
-
CTRL0 action
-
keyboardZoomkeyboardZoomReset
-
CTRL0 action.
ignored here - redefined in views which can zoom
-
mapped
-
the view has been mapped (by some outside
action - i.e. window manager de-iconified me)
Usage example(s):
the old code was:
realized := true.
shown := true.
...
this created a race condition, if the view was
realized and shortly after unrealized - before the mapped event
arrived. This lead to realized being set to true even thought the
view was not.
Boy - that was a bad one (hard to reproduce and hard to find).
|
Usage example(s):
Also, when remapped, X11 only sends a mapped event for the topView.
|
-
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 view's contents (but never too much);
If ctrl is pressed, always scroll one page;
this can be changed to zoom in/out with ctrl (as in OSX)
by:
UserPreferences current allowMouseWheelZoom:false
UserPreferences current allowMouseWheelZoom:true
If shift is pressed, always scroll a single scroll-step;
this can be changed to scroll horizontally with shift (as in OSX)
by:
UserPreferences current shiftMouseWheelScrollsHorizontally:false
UserPreferences current shiftMouseWheelScrollsHorizontally:true
-
mouseWheelZoom: amount
-
CTRL-wheel action.
ignored here - redefined in views which can zoom
-
openDocumentation
-
sent by the tooltip manager (FlyByHelp), when F1 is pressed
-
pointerEnter: state x: x y: y
-
mouse pointer entered - request the keyboard focus (sometimes)
-
pointerLeave: buttonState
-
mouse pointer left
-
processOutsideButtonEventWhileModal: anEvent
-
a button event (press/release) arrived for another view,
while I (a topView) am open as modal view.
Can be redefined to react on clicks outside (eg. CriticsWindow);
if handled, the redefining method should return true.
If not handled, it should return false.
-
propertyChange: propertyId state: state
-
A property has changed, nothing to do here.
Note:
This is very X specific. PropertyChange events must be enabled
to get this event. To enable, do:
self enableEvent: #propertyChange
-
reparented
-
the view has changed its parent by some outside
action - i.e. window manager has added a frame.
nothing done here
-
requestAutoAccept
-
request to accept: this is invoked when a dialog closes via accept or cancel.
This forces my value to be accepted into my model.
Any widget may suppress the ok/cancel, by returning false.
-
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.
-
scaleMouseWheelHorizontalScrollAmount: amountToScroll
-
scale a mouse-wheel scrollAmount according
to the width of the scrolled view
-
scaleMouseWheelScrollAmount: amountToScroll
-
scale a mouse-wheel scrollAmount according
to the height of the scrolled view
-
sizeChanged: how
-
my view has changed the size (not the contents);
tell subviews that I changed size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity)
-
sizeChanged: how from: oldExtent
-
my view has changed the size (not the contents)
Tell subviews that I changed size.
How is either #smaller, #larger or nil, and is used to control the order,
in which subviews are notified (possibly reducing redraw activity).
In previous versions, there was only one argument, how,
which was either #smaller or #larger or nil (if not known).
This argument was used in some widgets to optimize (avoid) some recomputations.
However, it was too unspecific on which dimension changed;
therefore, now this method is called.
For backward compatibility, it calls the old sizeChanged: method.
If you redefine this, make sure to either call super sizeChanged:,
not super sizeChanged:from: or to not redefine sizeChange:,
to avoid an endless recursion.
-
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: aSelectorOrWindowEvent
-
if the argument is a windowEvent, push it onto my event queue;
Otherwise, it must be a message selector,
and a messageSend to myself is pushed onto 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).
Also useful to synchronize access to critical objects inside an app or view,
eg. if coming via a change-update notification)
Usage example(s):
|v|
v := View new openAndWaitUntilVisible.
v fill:Color red.
v pushEvent:#redraw
|
-
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).
Also useful to synchronize access to critical objects inside an app or view,
eg. if coming via a change-update notification)
-
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).
Also useful to synchronize access to critical objects inside an app or view,
eg. if coming via a change-update notification)
-
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.
Also useful to synchronize access to critical objects inside an app or view,
eg. if coming via a change-update notification)
Usage example(s):
|v|
v := (Button label:'hello') openAndWaitUntilVisible.
Delay waitForSeconds:1.
v pushEvent:#buttonPress:x:y: withArguments:#(1 10 10).
Delay waitForSeconds:1.
v pushEvent:#buttonRelease:x:y: withArguments:#(1 10 10).
|
-
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
-
assignKeyboardFocusTo: aConsumer
-
assign the keyboard focus to me or one of my subviews
-
assignKeyboardFocusToFirstInputField
-
assign the keyboard focus to the first first keyboardConsumer.
(in older versions, this used to favour inputfields over editFields;
see (or redefine) preferFirstInputFieldWhenAssigningInitialFocus)
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
assignKeyboardFocusToFirstKeyboardConsumer
-
assign the keyboard focus to the first first keyboardConsumer.
(in older versions, this used to favour inputfields over editFields;
see (or redefine) preferFirstInputFieldWhenAssigningInitialFocus)
-
canTab
-
returns true if the widget is tabable
Usage example(s):
-
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
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
requestDoNotFocusOnPointerEnter: aBoolean
-
very bad naming - wrong english
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
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
-
takeFocusWhenMapped
-
-
takeFocusWhenMapped: aBoolean
-
-
topViewWasMapped
-
invoked when my topView is mapped
-
wantsFocusWithButtonPress
-
views which do not like to take the keyboard focus
with buttonPress can do so by redefining this
to return false
(actually: they should, because it is quite annoying
in the UI, if a menuPanel or button takes my keyboard focus.
So we should consider making the default false here, so every
widget writer has to think twice...
Can we do such a major change?)
-
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 I was not the grabber
-
forceUngrabPointer
-
force a pointer ungrab - even if I was not the grabber
-
grabKeyboard
-
grab the keyboard - that is: report all keyboard events to myself,
even if the mouse moved out of myself.
Returns true if the grab was successful (could fail, if some other
application has a grab - but that is 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 successful (could fail, if some other
application has a grab - but that is 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 successful (could fail, if some other
application has a grab - but that is 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 my contents changes its 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 the viewOrigin changes -
gives subclasses a chance to catch scrolls easily
(for example to hide the cursor before the scroll)
initialization & release
-
defaultControllerClass
-
Controller
-
defaultExtent
-
return the default extent of my instances.
-
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.
If redefined, make sure that super initStyle is sent
-
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)
Usage example(s):
fill in some defaults - some of them are usually redefined in subclasses
initialize methods
|
-
initializeAndAddTo: aView
-
add me (uninitialized) 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 it's later realized and no superview has ever been set,
it will come up as a topview.
-
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.
-
initializeResources
-
-
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
-
subViewsHaveBeenReparented
-
inspecting
-
inspectorExtraAttributes
( an extension from the stx:libtool package )
-
extra (pseudo instvar) entries to be shown in an inspector.
-
inspectorExtraMenuOperations
( an extension from the stx:libtool package )
-
extra operation-menu entries to be shown in an inspector.
Answers a collection of pairs containing aString and action aBlock.
aString is the label of the menu item.
aBlock is evaluated when the menu item is selected.
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
Usage example(s):
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'hello' ) last
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he&llo' ) last
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he&&llo' ) last
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he& llo' ) last
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'he&123llo' ) last
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'hello &' ) last
Transcript showCR:(self basicNew shortcutAndTranslatedStringFrom:'hello &&' ) last
|
-
shortcutKey
-
get the shortcut key
-
shortcutKey: aSymbolOrNil
-
set or clear the shortcut key
menu & menu actions
-
fontLargerOrSmaller: largerBoolean
-
sent via the CTRL+/CTRL- or SHIFT-CTRL+ / SHIFT-CTRL- keys.
Make my font larger or smaller (within a reasonable range)
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 following 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 view's 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
-
native widget support
-
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,
iff native windows are enabled AND the device supports it)
printing & storing
-
displayOn: aGCOrStream
-
redefined to also give a hint of where I am
private
-
componentsContainingX: x y: y do: aBlock
-
delegated
-
computeInnerClip
-
compute, but do not set the inside clip-area, in device coordinates
-
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 true.
This is almost the same as #componentContainingX:y: (if that existed)
-
explicitExtent: aBoolean
-
marked as obsolete by cg at 24-Aug-2021
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
extentFromRelativeExtent
-
compute & return pixel extent from relativeExtent
-
extentFromRelativeExtent: aPoint
-
compute & return the pixel extent from relativeExtent, aPoint
-
hasExplicitExtent: aBoolean
-
set the has explicit extent flag to aBoolean.
If set, this prevents the extent from being changed automatically
-
originFromRelativeOrigin
-
compute & return pixel origin from relativeOrigin
-
originFromRelativeOrigin: aPoint
-
compute & return pixel origin from relativeOrigin, aPoint
-
pixelCorner: corner
-
set the view's corner in pixels
-
pixelExtent: extent
-
set the view's extent in pixels
-
pixelOrigin
-
return the view's origin in pixels. For subviews. the origin is relative
to the superview's top-left. For topViews, it's the screen origin.
-
pixelOrigin: origin
-
set the view's origin in pixels. For subviews. the origin is relative
to the superview's top-left. For topViews, it's the screen origin.
-
pixelOrigin: origin corner: corner
-
set the view's origin and corner in pixels
-
pixelOrigin: origin extent: extent
-
set the view's 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: aBoolean
-
Modified (format): / 04-02-2017 / 21:34:42 / cg
-
setViewShape
-
-
windowGroupClass
-
queries
-
anyComponentHasFocus
-
return true, if the receiver or any of my components has the keyboard focus
(either via the focusView mechanism in the windowGroup,
or via delegation)
-
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.
-
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
-
marked as obsolete by Stefan Vogel at 5-Okt-2023
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
isActive
-
true, if I have the focus (w.r.t the windowing system);
i.e. if one of my subViews actually has the real focus.
With click-to-focus behavior, this is obviously the current application.
Use this query with caution, for example, to suppress tooltips for inactive apps.
-
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.
-
isICCCWindowGroupWindow
-
needed for checkForEndOfDispatch
-
isReadOnly
-
stupid default - there are queries for this in keyboardProcessor
-
isSameOrComponentOf: aView
-
return true, if I am aView or a (direct or indirect) component of aView
-
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) **
-
mainWindow
-
for compatibility with applicationModels ... return the receiver's topView
-
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]].
-
reallyRealized
-
return true, if the receiver is realized and all containers are realized.
Realized means that it has been mapped (i.e. made visible) on
the display (as opposed to being only created and possibly invisible)
-
resources
-
return the view's resources -
that's a ResourcePack containing national language strings
-
startWindowMoveOnButtonPress
-
if another view is used as topView
-
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
-
windowSensor
-
for compatibility with applicationModels...
queries-contents
-
heightOfContents
-
return the height of the contents in logical units
- defaults to view's 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 view's 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 view's actual width.
The value returned here must be based on a scale of 1, since users
of this will scale as appropriate.
queries-events
-
buttonMotionEventPending
-
return true, if a button motion event is pending.
Normally, you don't want to use this, since no polling is needed
(not even for mouse-tracking).
Actually, its a historical leftover
queries-internal
-
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
Usage example(s):
-
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
-
activate
-
noop for protocol compatibility with TopViews (in case you do a Button new open)
-
basicUnmap
-
unmap the view, independent of its mapped state.
The view stays created (but invisible),
and can be remapped again later.
This can be called even if a map operation is underway,
and the view is not yet mapped in the Display
-
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)
Usage example(s):
make certain that superview is created also
|
Usage example(s):
this view was created (and therefore, no sizeChangeEvent
|
Usage example(s):
this is the first create,
force sizechange messages to be sent to the view
|
-
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 omit 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.
Usage example(s):
this is a kludge for IRIS and others which do not provide backingstore:
when we hide a modalbox (such as a searchbox) which covered
a scrollbar, the scrollbar's bitblt-method will copy from the
not-yet redrawn area - effectively clearing the scroller.
We need a short delay here, since at this time, the expose event has
not yet arrived.
|
-
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 view's 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 view's 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
Usage example(s):
in case a view gets rerealized
|
-
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
-
recursiveRealizeAllSubViews
-
realize all my subviews and all of their subviews - but not myself.
-
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 ...
-
remap: id atX: x y: y
-
separat to allow redefinition in StandardSystemView
-
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.
-
setForegroundWindow
-
noop for protocol compatibility with TopViews (in case you do a Button new open)
-
unmap
-
unmap the view - the view stays created (but invisible),
and can be remapped again later.
Usage example(s):
unmap is an asynchronous operation.
|
Usage example(s):
(shown is cleared also in unmapped event)
|
Usage example(s):
|top sub|
top := StandardSystemView new.
top extent:200@200.
sub := View
origin:0.2@0.2
corner:0.8@0.8
in:top.
sub viewBackground:Color red.
sub hiddenOnRealize:true.
top open.
(Delay forSeconds:5) wait.
sub map.
(Delay forSeconds:3) wait.
sub unmap.
sub viewBackground:(Color green).
(Delay forSeconds:3) wait.
sub map.
|
-
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).
Usage example(s):
|v|
v := View new openAndWaitUntilVisible.
Delay waitForSeconds:2.
v flash.
Delay waitForSeconds:2.
v destroy
|
-
flash: messageOrNil
-
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).
Usage example(s):
|v|
v := View new openAndWaitUntilVisible.
Delay waitForSeconds:2.
v flash:'Hello World'.
Delay waitForSeconds:2.
v destroy
|
-
flash: messageOrNil withColor: flashColor
-
flash the view - fill it flashColor, 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).
Usage example(s):
|v|
v := View new openAndWaitUntilVisible.
Delay waitForSeconds:2.
5 timesRepeat:[ v flash:'Hello World' withColor:Color red. Delay waitForSeconds:0.5].
Delay waitForSeconds:2.
v destroy
|
-
flashReadOnly
-
flash the view and show 'Read Only' for a moment.
-
flashRectangle: rect
-
flash part of the view - fill it black, then white, finally redraw.
Can be used to bring attention to some line/part of view
Usage example(s):
|v|
v := View new openAndWaitUntilVisible.
Delay waitForSeconds:2.
v flashRectangle:(10@10 corner:50@50).
Delay waitForSeconds:2.
v destroy
|
-
flashRectangle: rect withColor: flashColor
-
flash part of the view - fill it flashColor, then white,
finally redraw.
Can be used to bring attention to some line/part of view
Usage example(s):
|v|
v := View new openAndWaitUntilVisible.
Delay waitForSeconds:2.
v flashRectangle:(10@10 corner:50@50) withColor:Color red.
Delay waitForSeconds:2.
v destroy
|
-
invalidate
-
add a damage to redraw the receiver to its input event queue.
This is preferable to calling redraw directly, in that the drawing is done by
the view's 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 receiver's windowGroupProcess gets rescheduled.
-
invalidate: aRectangle
-
add a damage to redraw part of the receiver, to its input event queue.
This is preferable to calling redraw directly,
in that the drawing is done by the view's 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 receiver's 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 don't care for
updating regions but instead update everything.
-
redraw: aRectangle
-
redraw a part of the view immediately.
-
redrawComponentsIn: aRectangle
-
Modified (format): / 25-10-2023 / 17:58:24 / Stefan Vogel
-
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
-
experimental feature
-
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.
-
mouseWheelScrollDown: units
-
-
mouseWheelScrollLeft: units
-
-
mouseWheelScrollRight: units
-
-
mouseWheelScrollUp: units
-
-
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
-
scrollRelative: nPixels
-
change origin to scroll up (nPixels < 0) or down (nPixels > 0)
-
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
-
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.
If doRedraw is true, and any new areas are exposed, these are invalidated
(i.e. there may be pending redraw events in the event queue).
-
scrollTo: newOrigin waitForDrawingFinished: doWait
-
change origin to have newOrigin be visible at the top-left.
The argument defines the integer device coordinates of the new top-left
point.
If any new areas are exposed, invalidate them.
If doWait is true, wait until all draws are completed,
otherwise, possible redraws may still be in the event queue.
-
scrollToBottom
-
scroll to the left
and last shown viewfull of my contents
-
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
-
scrollVerticalToBottom
-
scroll to the last shown viewfull of my contents,
keeping the horizontal scroll position
-
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 redraw: doRedraw allowScrollBeyondContents: allowScrollBeyondContents
-
change origin to have newOrigin be visible at the top-left.
The argument defines the integer device coordinates of the new top-left
point.
If doRedraw is true, and any new areas are exposed, these are invalidated
(i.e. there may be pending redraw events in the event queue).
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 #openAndWaitUntilVisible or #waitUntilVisible after the open.
Usage example(s):
Usage example(s):
(Button label:'hello') open
|
Usage example(s):
|top|
top := StandardSystemView new.
top extent:200@200.
Button label:'hello' in:top.
top open
|
Usage example(s):
-
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 from 'outside'
(for example, in doIt expressions),
the view must be visible (realized) before doing so.
Use this in those situations, to ensure that the view is visible when drawing.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
openAndWaitUntilVisible
-
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 from 'outside'
(for example, in doIt expressions),
the view must be visible (realized) before doing so.
Use this in those situations, to ensure that the view is visible when drawing.
-
openAt: aPoint
-
open up the view modeless - positions the view
Usage example(s):
(Button label:'hello') open
(Button label:'hello') openAt:(100@100)
|
-
openAtCenter
-
open up the view modeless - positions the view
Usage example(s):
(Button label:'hello') open
(Button label:'hello') openAtCenter
|
-
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 fileBrowser's 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)
Usage example(s):
the same:
YesNoBox new open
YesNoBox new openModal
different:
(Button label:'hello') open
(Button label:'hello') openModal
|
-
openModal: stayInEventLoopCheckBlock
-
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: stayInEventLoopCheckBlock inGroup: activeWindowGroup
-
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.
-
openModal: stayInEventLoopCheckBlock inGroup: activeWindowGroup asPopup: asPopup
-
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)
Usage example(s):
View new openModalAt:100@100
|
-
openModalAtCenter
-
open up the view modeless - positions the view
(i.e. circumvents window managers positioning)
Usage example(s):
View new openModalAtCenter
|
-
openModalAtPointer
-
View new openModalAtPointer
-
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).
Usage example(s):
the same:
(Button label:'hello') open
(Button label:'hello') openModeless
different:
YesNoBox new open
YesNoBox new openModeless
|
-
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.
Usage example(s):
View new openModeless
View new openModelessAt:100@100
|
-
openModelessAt: aPoint iconified: iconified
-
open up the view modeless - positions the view
(i.e. tries to circumvent the window manager's positioning)
Notice: some windowManagers seem to ignore this and always
ask the user to position the view.
Usage example(s):
StandardSystemView new openModeless
StandardSystemView new openModelessAt:100@100
StandardSystemView new openModelessAt:100@100 iconified:true
|
-
openModelessAtCenter
-
open up the view modeless - positions the view
(i.e. circumvents window managers positioning)
Usage example(s):
View new openModeless
View new openModelessAtCenter
|
-
openModelessAtPointer
-
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).
Usage example(s):
(Button label:'hello') openModelessAtPointer
|
-
waitUntilVisible
-
wait until the receiver is 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.
Usage example(s):
Example where this is useful:
The following does not work, because the view is in its opening phase,
when we attempt to draw a line.
This either gives an error or will be drawn into the void, since
its internals are not yet correctly setup
(the view has its own async process, which gets forked with the open):
|v|
v := View new open.
v displayLineFrom:0@0 to:50@50
the following does work (since we wait until the view has completely finished its startup phase):
|v|
v := View new open.
v waitUntilVisible.
v displayLineFrom:0@0 to:50@50
or, a combined open and waitUntilVisible:
|v|
v := View new openAndWaitUntilVisible.
v displayLineFrom:0@0 to:50@50.
|
-
waitUntilVisibleWithTimeoutMS: timeoutMS
-
wait until the receiver is visible,but not longer than timeoutMS.
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.
Returns true if the view is shown, false if it is not (after a timeout).
With a timeoutMS of zero, this will result in a single poll;
with a nil timeoutMS,it will wait forever.
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.
testing
-
hasOwnScrollbars
-
a hack for codeView2, which behaves like a TextView, but has its own
scrollbars embedded - sigh (an extra load one).
This allows for the UIBuilder to avoid creating an extra set around such
a view (as is the case with TextSpec with scrollbars when using CodeView2)
-
isApplicationSubView
-
-
isCodeView2
( an extension from the stx:libtool package )
-
codeview2 seems to require some extra hacks
-
isComboView
-
true if I am a comboBox-like widget
-
isDefault
-
return true, if I am a default widget;
Used with autoAccept. Currently only default buttons are supposed to return
true here
-
isDialogBox
-
-
isExternalTopView
-
return true, if this is an external topView - always false here
-
isInfoOrWarningBox
-
-
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.
-
isLabel
-
-
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.
-
isPopUpList
-
-
isTextLabel
-
return true, if the receiver is a text label.
Return false here, this is redefined in Label.
-
isTextView
-
Returns true, if the view displays text
-
isTransparentBox
-
-
isWarningBox
-
-
isWrapper
-
user interaction & notifications
-
openHTMLDocument: anHTMLFilename
-
open a HTMLDocumentView on anHTMLFilename
-
showInfoInApplication: message
-
iff my application responds to showInfo:,
then send a message to it
-
showNotFound
-
something was not found - tell user by beeping and changing
cursor for a while (sometimes I work with a headset :-)
(used to be: tell user by changing cursor for a while).
Beep can be disabled via the settings
-
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
BoxClosedNotificationSignal
CloseBoxRequestSignal
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
| individual coordinates:
|top v1 v2|
top := StandardSystemView new.
top extent:300@300.
v1 := View new.
v1 viewBackground:(Color red).
v1 origin:(10@10).
v1 corner:(30@30).
top add:v1.
v2 := View new.
v2 viewBackground:(Color blue).
v2 origin:(30@30).
v2 corner:(50@50).
top add:v2.
top openAndWaitUntilVisible.
5 timesRepeat:[
Delay waitForSeconds:2.
v2 bottom:100.
Delay waitForSeconds:2.
v2 bottom:50.
]
|
|