|
Class: PopUpView
Object
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--TopView
|
+--PopUpView
|
+--CodeCompletionHelpMenuView::SimulatedMenuForHTMLView
|
+--ExtendedComboBox::MenuWrapper
|
+--PopUpBanner
|
+--PopUpMenu
- Package:
- stx:libview
- Category:
- Views-Basic
- Version:
- rev:
1.73
date: 2024/01/29 20:40:37
- user: cg
- file: PopUpView.st directory: libview
- module: stx stc-classLibrary: libview
this class implements an abstract superclass for all views which bypass the
window manager and pop up on top of the screen. A typical example is
a PopUpMenu. PopUpView itself is abstract, providing basic mechanisms.
They are not decorated by window managers.
Attention: by default (i.e. if not redefined), PopUpViews grab the mouse
and keyboard when opened, locking the display.
Make sure that you close the window some time afterwards.
[styleSheet parameters:]
popupShadow <Boolean> if true, popupViews show a shadow below
popupLevel <nil | Integer> 3D level
popupBorderWidth <nil | Integer> borderWidth
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.
defaults
-
defaultExtent
-
return the default extent of my instances.
The value returned here is usually ignored, and
the value from preferredExtent taken instead.
-
shadows
-
return the shadows-flag. False means: turned off.
Notice, that even when set to true, a particular device might
want to suppress this feature.
-
shadows: aBoolean
-
turn on/off shadows under popUpViews.
Notice, that even when set to true, a particular device might
want to suppress this feature.
On slow displays, turning them off makes menus appear a bit snappier.
The default is set via the styleSheet and changes when the viewStyle
is changed.
-
shadowsOnDevice: aDevice
-
return true, if shadows should be shown on aDevice.
Notice: this is a leftover from old times, when ST/X had to care for the
shadow itself; nowadays, this is usually done by the system,
and DefaultShadow is false.
-
updateStyleCache
-
extract values from the styleSheet and cache them in class variables
accessing
-
exclusivePointer: aBoolean
-
set/clear the exclusive pointer flag;
DANGER: if set, no interaction with other views is possible,
while the popUp is active
-
haveControl: aBoolean
-
set the flag which tells me that I have control (focus)
-
noShadow
-
turn off the shadow
activation & deactivation
-
open
-
default for popUpViews is to come up modal
-
show
-
realize the view at its last position
-
showAt: aPoint
-
realize the view at aPoint
-
showAt: aPoint resizing: aBoolean
-
realize the view at aPoint
-
showAtPointer
-
realize the view at the current pointer position
-
showCenteredIn: aView
-
make myself visible at the screen center.
defaults
-
defaultShadow
-
obsoleted by PopUpView defaultShadowOn:aDevice
** This is an obsolete interface - do not use it (it may vanish in future versions) **
event handling
-
keyPress: key x: x y: y
-
(comment from inherited method)
notice: this ought to be moved into the upcoming
StandardSystemViewController.
grabbing
-
grabKeyboard
-
Transcript show:'k-ggg by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousKeyboardGrab printString.
-
grabPointerWithCursor: aCursorOrNil
-
Transcript show:'ggg by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousPointerGrab printString.
-
ungrabKeyboard
-
Transcript show:'k-uuu by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousKeyboardGrab printString.
-
ungrabPointer
-
Transcript show:'uuu by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousPointerGrab printString.
initialization & release
-
create
-
(comment from inherited method)
create (i.e. tell my device about me) if not already created.
This does not make the view visible (needs a #map for that)
-
destroy
-
(comment from inherited method)
the receiver is to be destroyed - look for partners and slaves
-
initStyle
-
setup viewStyle specifics
-
initialize
-
(comment from inherited method)
initialize the topViews position for the screens center
-
releaseDeviceResources
-
-
releasePointer
-
release the mouse pointer
-
releasePointerAndKeyboard
-
release the pointer and keyboard
private
-
regainControl
-
get exclusive access to pointer and keyboard
queries
-
grabWhenMapped
-
return true, if I should perform a grab when mapped.
Redefinable for subclasses.
-
isPopUpView
-
return true, since I want to come up without decoration
and raise to top immediately.
realize & unrealize
-
hide
-
hide the view, leave its modal event loop
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 scrollbars 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.
|
-
mapped
-
grab the pointer here, when visible (but not control is already lost).
If the grab fails, try again and unmap myself if that fails too.
-
realize
-
device zoom:(device pointerPosition extent:1@1)to:(self bounds) duration:10.
-
unmap
-
(comment from inherited method)
unmap the view - the view stays created (but invisible),
and can be remapped again later.
|