eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TopView':

Home

everywhere
www.exept.de
for:
[back]

Class: TopView


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--GraphicsMedium
            |
            +--DisplaySurface
               |
               +--SimpleView
                  |
                  +--View
                     |
                     +--TopView
                        |
                        +--ExternalTopView
                        |
                        +--PopUpView
                        |
                        +--StandardSystemView

Package:
stx:libview
Category:
Views-Basic
Version:
rev: 1.127 date: 2009/06/10 13:30:54
user: ca
file: TopView.st directory: libview
module: stx stc-classLibrary: libview
Author:
Claus Gittinger

Description:


I am an abstract superclass of StandardSystemView and PopUpView;
i.e. views which have no superview.

Do not get confused by the name TopView - your applications
topViews are typically instances of StandardSystemView.

[instance variables:]
    type            <Integer>       encodes master/slave relationship:
                                        #normal, #master, #slave or #partner
                                    for modeless views
                                    (the #master-, #slave- or #partner-type links multiple views 
                                     into a windowManagers windowGroup -> for de-iconification)

                                    encodes window type:
                                        #normal, #dialog, #popup, #undecorated 


Related information:

    StandardSystemView
    PopUpView
    DialogBox
    [introduction to view programming]

Class protocol:

class initialization
o  initialize

defaults
o  defaultExtent
return the default extent of my instances.
Topviews extents is 2/3 of screen by default

o  forceModalBoxesToOpenAtCenter
return the flag which forces all modal views to be opened
at the screens center

o  forceModalBoxesToOpenAtCenter: aBoolean
set/clear a flag which forces all modal views to be opened
at the screens center

o  forceModalBoxesToOpenAtPointer
return the flag which forces all modal views to be opened
at the current pointer position

o  forceModalBoxesToOpenAtPointer: aBoolean
set/clear the flag which forces all modal views to be opened
at the current pointer position

o  takeFocusWhenMapped: aBoolean
if turned on, topViews will grab the keyboard when mapped.
This is useful on systems like openView or Win32, where a view needs a click
otherwise


Instance protocol:

Compatibility-ST80
o  displayBox

o  displayBox: aRectangle

accessing
o  keyboardProcessor
return my keyboard processor

o  keyboardProcessor: something
set my keyboard processor

o  label: labelString iconLabel: iconLabelString
ignored here - for compat. with StdSysViews

accessing-behavior
o  beDialogView
make me a Dialog Window; that is one which raises above all other ST/X views

o  beIndependent
make this an independent view; i.e. remove any master/slave or partner
attribute (this is the default).
However, the view remains in the current windowGroup

o  beMDIClientView

o  beMaster
make this a master-view.
All slave views within the same windowGroup will be closed if any master is closed
and also de/iconify together with their master(s).
(i.e. they follow their master(s)).

o  bePartner
make this a partner-view. Each partner-view will automatically
close other partner views (within the same windowGroup) when closed.

o  bePopUpView
the nonInteger handling code is for backward compatibility only.

o  beScreenDialog
make me a Screen-Dialog Window; that is one which raises above ALL other windows
(not only st/x ones)

o  beSlave
make this a slave-view. It will be closed automatically,
whenever any master of the windowgroup is closed.
See also: #bePartner

o  beToolDialog
the nonInteger handling code is for backward compatibility only.

o  beToolWindow
the nonInteger handling code is for backward compatibility only.

o  beUndecorated
make me an undecorated Window

o  focusSequence: aCollectionOfSubcomponents
define the sequence for stepping through my components.

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

accessing-look
o  addTrayIcon: anImageOrForm toolTipMessage: toolTipMessage
WIN32 only: add a tray icon for myself;
may then receive tray*-events in the future.

event handling
o  keyPress: key x: x y: y
notice: this ought to be moved into the upcoming
StandardSystemViewController.

o  showActivity: someMessage
some activityNotification shalt be communicated to the user.
Default for activity notifications here: ignore them

o  trayButtonDoubleClick: buttonNr
WIN32 only: double-click in the tray.
Nothing done here - must be redefined in a subclass

o  trayButtonPress: buttonNr
WIN32 only: button-press in the tray.
Nothing done here - must be redefined in a subclass

o  trayButtonRelease: buttonNr
WIN32 only: button-release in the tray.
Nothing done here - must be redefined in a subclass

o  trayMouseMotion
WIN32 only: mouse-motion in the tray.
Nothing done here - must be redefined in a subclass

help
o  flyByHelpDependsOnPositionIn: aView
subclasses where the help-text depends upon the pointer position might
want to redefine this

help stubs
o  flyByHelpTextFor: aSubView
this will vanish - its temporarily here to allow for stdSysViews to be
used as a masterApp for dialogs

o  helpTextFor: aSubView
this will vanish - its temporarily here to allow for stdSysViews to be
used as a masterApp for dialogs

o  showHelp: aHelpText for: aView
dummy - added in case a regular topView is installed
as a dialogs masterApplication.
Concrete application subclasses may redefine this to
display a help text in one of its message areas

initialization & release
o  addToCurrentProject
for compatibility with views which can

o  assignInitialKeyboardFocus
assign the initial keyboard focus to a 'useful' component.

o  assignKeyboardFocusToFirstInputField
assign the keyboard focus to the first first keyboardConsumer.
(in older versions, this used to favour inputfields over editFields;
see (or redefine) preferFirstInputFieldWhenAssigningInitialFocus)

o  destroy
the receiver is to be destroyed - look for partners and slaves

o  initialize
initialize the topViews position for the screens center

o  postRealize

o  realize

o  release

misc
o  raiseDeiconified
deiconify & bring to front

o  waitUntilClosed
wait until the receiver has been closed.
Can be used to synchronize multiple-window applications,
and (especially) to wait until an application session is finished
when invoking commands with the rDoit mechanism

o  withCursor: aCursor do: aBlock
evaluate aBlock while showing aCursor in all my views.
Return the value as returned by aBlock.

queries
o  beepWhenOpening

o  heightIncludingBorder
return the views overall-height

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

o  isCollapsed
ST80 compatibility: return true if the view is not shown (i.e. iconified)

o  isDialogView
return true if this is a dialog view

o  isMDIClientView

o  isMaster
return true, if this is a masterView

o  isModal
return true, if the receiver has been opened modal

o  isPartner
return true, if this is a partnerView

o  isPopUpView
return true if I am a popup view.
(i.e. I want to come up without decoration and popUp to top immediately)

o  isScreenDialog
return true if I am a screen dialog view.
(i.e. I want to come up anove all other windows

o  isSlave
return true, if this is a slaveView

o  isToolDialog
return true if I am a toolWindow dialog view.
(i.e. I want to come up with a smaller window-title area)

o  isToolWindow
return true if I am a toolWindow view.
(i.e. I want to come up with a smaller window-title area)

o  isTopView
return true, since I am a topView

o  isUndecoratedView
return true if I am an undecorated view.

o  preferredExtent
return my preferred extent - this is the minimum size I would like to have.
The default here is the classes default extent,
however many subclasses redefine this to compute the actual value
depending on the sizes of the contents or subcomponents.

o  widthIncludingBorder
return the views overall-width

o  windowStyle
return a symbol describing my style which should be one of
#dialog, #popUp, #undecorated, #normal or #toolWindow.
This is used by the device as a decoration hint.

realization
o  openModal
added bell to wake up user

show & hide
o  activate
added for MS-windows - much like raise.
Raise/Activate seem to work only within my own (ST/X)-windows;
they do not raise one of my views above another (for example: command.com)-window.
Can anyone tell me what the difference between raise, activate and setForeground
really is (I mean really - not what is written in the crappy documentation)

o  fixPosition: aPoint
set origin to aPoint, but make sure, that the box is fully visible
by shifting it into the visible screen area if nescessary.
This prevents invisible modalBoxes (which you could never close).

o  hide

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

o  mapIconified
make the view visible but iconified.
In contrast to map, which does it non-iconified

o  positionOffset
return the delta, by which the box should be
displaced from the mouse pointer.
Here, the boxes center is returned as a default.
Usually redefined in subclasses to have the most convenient
ok-button appear under the pointer.

o  setForegroundWindow
make a window the foreground window (so raise and activate it).
Under Win 98/Me/XP/2000 the window is not raised/activated, if a window from
a different process is currently active - in this case the title bar/icon is flashed.
this also raises the priority of the sending thread slightly.

Mark a TopView as #beScreenDialog, to send this on open.

startup
o  openAt: aPosition transientFor: anotherView
force the view to be opened at some position on the screen
AND tell the windowManager to NOT let the user choose a position
(i.e. suppress any ghostframe).
The view is marked as being a transient (i.e. pop-up) view for
anotherView - it will deiconify with it and (on some windowManagers)
have no iconify button of its own.
Notice, that its up to the windowManager to care for any borders -
it seems not deterministic, where the view actually ends up being positioned.
Not all windowManagers (olwm) honor this - some insist on it ...

o  openDisplayAt: aPoint
ST-80 compatibility: open the view centered around aPoint

o  openIconified
open the view in iconified state

o  openIn: aBoundaryRectangle
set origin & extent and open.
The given extent overrides the receivers preferredExtent.
Added for ST-80 compatibility

o  openTransientAt: aPosition
force the view to be opened at soem position on the screen
AND tell the windowManager to NOT let the user choose a position
(i.e. suppress any ghostframe).
Notice, that its up to the windowManager to care for any borders -
it seems not deterministic, where the view actually ends up being positioned.
Not all windowManagers (olwm) honor this - some insist on it ...

o  openWithExtent: anExtent
set extent and open. The given extent overrides the
receivers preferredExtent.
Added for ST-80 compatibility

o  openWithPriority: aPriority
open the view, run the windowgroup process at
other than UserScehdulingPriority.

window events
o  mapped
the recevier was mapped (i.e. deiconified);
look for partners and slaves.

o  masterSlaveMessage: aSelector inGroup: aWindowGroup
send aSelector to partners and/or slaves.
This is a private helper for destroy / mapped / unmapped

o  unmapped
the recevier was unmapped (i.e. iconified);
look for partners and slaves.


Examples:


Notice, the following examples only demonstrate the windos style (not its modal behavior). the style is controlled by the systems windowManager, and might even be ignored by some. (for example, the dialog- and normal styles often look the same). The bahavior is controlled by ST/X, and controlled by the open vs. openModeless vs. openModal message. Modeless: regular style:


      |v|

      v := TopView new.
      v extent:200@200.
      v open
dialog:


      |v|

      v := TopView new.
      v beDialogView.
      v extent:200@200.
      v open
      Delay waitForSeconds:10. v destroy.
popUp (always on top):


      |v|

      v := TopView new.
      v bePopUpView.
      v extent:200@200.
      v open.
      Delay waitForSeconds:10. v destroy.
undecorated (looks loke popUp, but is not always on top):


      |v|

      v := TopView new.
      v beUndecorated.
      v extent:200@200.
      v open.
      Delay waitForSeconds:10. v destroy.
toolwindow (looks loke normal, but has smaller windowTitle-area on win32):


      |v|

      v := TopView new.
      v beToolWindow.
      v extent:200@200.
      v open.
      Delay waitForSeconds:10. v destroy.
toolwindow dialog (looks loke normal, but has smaller windowTitle-area on win32):


      |v|

      v := TopView new.
      v beToolDialog.
      v extent:200@200.
      v open.
      Delay waitForSeconds:10. v destroy.
Modal: regular style:


      |v|

      v := TopView new.
      v extent:200@200.
      v openModal
dialog:


      |v|

      v := TopView new.
      v beDialogView.
      v extent:200@200.
      v openModal
popUp (always on top):


      |v|

      v := TopView new.
      v bePopUpView.
      v extent:200@200.
      v openModal
undecorated (looks loke popUp, but is not always on top):


      |v|

      v := TopView new.
      v beUndecorated.
      v extent:200@200.
      v openModal


ST/X 6.1.1; WebServer 1.620 at exept:8081; Fri, 03 Sep 2010 00:35:50 GMT