TopView.st
author claus
Wed, 03 May 1995 02:27:48 +0200
changeset 135 cf8e46015072
child 141 caf4432fae8f
permissions -rw-r--r--
.

"
 COPYRIGHT (c) 1995 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.
"

View subclass:#TopView
       instanceVariableNames:''
       classVariableNames:   ''
       poolDictionaries:''
       category:'Views-Basic'
!

TopView comment:'
COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

$Header: /cvs/stx/stx/libview/TopView.st,v 1.1 1995-05-03 00:25:39 claus Exp $
'!

!TopView class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1995 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.
"
!

version
"
$Header: /cvs/stx/stx/libview/TopView.st,v 1.1 1995-05-03 00:25:39 claus Exp $
"
!

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

!TopView class methodsFor:'defaults'!

defaultExtent
    "topviews extent is (0.6 @ 0.6) of screen by default"

    ^ (Display width // 3 * 2) @ (Display height // 3 * 2)
! !

!TopView methodsFor:'initialization'!

initialize
    |screenCenter|

    super initialize.

    screenCenter := device center.
    left := screenCenter x - (width // 2).
    top := screenCenter y - (height // 2).
! !

!TopView methodsFor:'misc'!

withWaitCursorDo:aBlock
    "evaluate aBlock while showing a waitCursor in all my views"

    self withCursor:(Cursor wait) do:aBlock
!

withCursor:aCursor do:aBlock
    "evaluate aBlock while showing aCursor in all my views"

    windowGroup notNil ifTrue:[
	windowGroup withCursor:aCursor do:aBlock
    ] ifFalse:[
	super withCursor:aCursor do:aBlock
    ]
! !

!TopView methodsFor:'accessing & queries'!

preferedExtent
    "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."

    ^ self class defaultExtent
!

heightIncludingBorder
    "return the views overall-height"

    ^ height
!

widthIncludingBorder
    "return the views overall-width"

    ^ width
! !