ModalBox.st
changeset 180 0b3a8658d55e
parent 157 891eff44c2e7
child 190 4c49bdd5b80f
equal deleted inserted replaced
179:d9f47e50af15 180:0b3a8658d55e
    19 
    19 
    20 ModalBox comment:'
    20 ModalBox comment:'
    21 COPYRIGHT (c) 1990 by Claus Gittinger
    21 COPYRIGHT (c) 1990 by Claus Gittinger
    22 	      All Rights Reserved
    22 	      All Rights Reserved
    23 
    23 
    24 $Header: /cvs/stx/stx/libview/ModalBox.st,v 1.26 1995-07-23 02:27:44 claus Exp $
    24 $Header: /cvs/stx/stx/libview/ModalBox.st,v 1.27 1995-09-07 12:29:39 claus Exp $
    25 '!
    25 '!
    26 
    26 
    27 !ModalBox class methodsFor:'documentation'!
    27 !ModalBox class methodsFor:'documentation'!
    28 
    28 
    29 copyright
    29 copyright
    40 "
    40 "
    41 !
    41 !
    42 
    42 
    43 version
    43 version
    44 "
    44 "
    45 $Header: /cvs/stx/stx/libview/ModalBox.st,v 1.26 1995-07-23 02:27:44 claus Exp $
    45 $Header: /cvs/stx/stx/libview/ModalBox.st,v 1.27 1995-09-07 12:29:39 claus Exp $
    46 "
    46 "
    47 !
    47 !
    48 
    48 
    49 documentation
    49 documentation
    50 "
    50 "
   221 	shadowView realize.
   221 	shadowView realize.
   222 	self raise
   222 	self raise
   223     ] ifFalse:[
   223     ] ifFalse:[
   224 	self extent:newExtent.
   224 	self extent:newExtent.
   225     ].
   225     ].
       
   226 !
       
   227 
       
   228 resizeUnderPointer
       
   229     "resize myself to make everything visible, AND possibly change the origin
       
   230      to have the mouse pointer stay within my bounds.
       
   231      This is used for self-resizing enterBoxes, to avoid moving
       
   232      the box away from the cursor."
       
   233 
       
   234     |newExtent newLeft delta|
       
   235 
       
   236     newExtent := self preferredExtent.
       
   237     newExtent = self extent ifTrue:[^ self].
       
   238 
       
   239     shown ifTrue:[
       
   240 	delta := width - newExtent x.
       
   241 	newLeft := left + delta.
       
   242 	(((newLeft @ top) extent:newExtent) 
       
   243 	    containsPoint:device pointerPosition)
       
   244 	ifFalse:[newLeft := left].
       
   245 	newLeft < 0 ifTrue:[newLeft := 0].
       
   246 	newLeft + newExtent x > device width ifTrue:[
       
   247 	    newLeft := device width - newExtent x
       
   248 	].
       
   249 	shadowView notNil ifTrue:[
       
   250 	    shadowView unrealize.
       
   251 	].
       
   252 	self origin:(newLeft @ top) extent:newExtent.
       
   253 	shadowView notNil ifTrue:[
       
   254 	    shadowView realize.
       
   255 	    self raise.
       
   256 	].
       
   257     ] ifFalse:[
       
   258 	self extent:newExtent.
       
   259     ].
       
   260 
       
   261     "Modified: 6.9.1995 / 15:31:21 / claus"
   226 ! !
   262 ! !
   227 
   263 
   228 !ModalBox methodsFor:'queries'!
   264 !ModalBox methodsFor:'queries'!
   229 
   265 
   230 preferredExtent
   266 preferredExtent