eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PopUpView':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: PopUpView


Inheritance:

   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

Description:


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

copyright

COPYRIGHT (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.

Class protocol:

defaults
o  defaultExtent
return the default extent of my instances.
The value returned here is usually ignored, and
the value from preferredExtent taken instead.

o  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.

o  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.

o  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.

o  updateStyleCache
extract values from the styleSheet and cache them in class variables


Instance protocol:

accessing
o  exclusivePointer: aBoolean
set/clear the exclusive pointer flag;
DANGER: if set, no interaction with other views is possible,
while the popUp is active

o  haveControl: aBoolean
set the flag which tells me that I have control (focus)

o  noShadow
turn off the shadow

activation & deactivation
o  open
default for popUpViews is to come up modal

o  show
realize the view at its last position

o  showAt: aPoint
realize the view at aPoint

o  showAt: aPoint resizing: aBoolean
realize the view at aPoint

o  showAtPointer
realize the view at the current pointer position

o  showCenteredIn: aView
make myself visible at the screen center.

defaults
o  defaultShadow
obsoleted by PopUpView defaultShadowOn:aDevice

** This is an obsolete interface - do not use it (it may vanish in future versions) **

event handling
o  keyPress: key x: x y: y
(comment from inherited method)
notice: this ought to be moved into the upcoming
StandardSystemViewController.

grabbing
o  grabKeyboard
Transcript show:'k-ggg by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousKeyboardGrab printString.

o  grabPointerWithCursor: aCursorOrNil
Transcript show:'ggg by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousPointerGrab printString.

o  ungrabKeyboard
Transcript show:'k-uuu by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousKeyboardGrab printString.

o  ungrabPointer
Transcript show:'uuu by '; show:self; show:'[',self identityHash printString,']'; showCR:' - previous is ' , previousPointerGrab printString.

initialization & release
o  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)

o  destroy
(comment from inherited method)
the receiver is to be destroyed - look for partners and slaves

o  initStyle
setup viewStyle specifics

o  initialize
(comment from inherited method)
initialize the topViews position for the screens center

o  releaseDeviceResources

o  releasePointer
release the mouse pointer

o  releasePointerAndKeyboard
release the pointer and keyboard

private
o  regainControl
get exclusive access to pointer and keyboard

queries
o  grabWhenMapped
return true, if I should perform a grab when mapped.
Redefinable for subclasses.

o  isPopUpView
return true, since I want to come up without decoration
and raise to top immediately.

realize & unrealize
o  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.

o  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.

o  realize
device zoom:(device pointerPosition extent:1@1)to:(self bounds) duration:10.

o  unmap
(comment from inherited method)
unmap the view - the view stays created (but invisible),
and can be remapped again later.



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 14:31:50 GMT