SimpleView.st
changeset 7586 53e42e99e908
parent 7570 b05dae395ad5
child 7593 08e1e5e86005
child 7599 84f6853ec60d
equal deleted inserted replaced
7585:5c5e44bad956 7586:53e42e99e908
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  3891 
  3893 
  3892     "Modified: 9.5.1996 / 00:46:24 / cg"
  3894     "Modified: 9.5.1996 / 00:46:24 / cg"
  3893 !
  3895 !
  3894 
  3896 
  3895 topComponent
  3897 topComponent
  3896     "return the topmost component - thats the one with no superview.
  3898     "return the topmost component - that's the one with no superview.
  3897      For ST-80 compatibility."
  3899      For ST-80 compatibility."
  3898 
  3900 
  3899     ^ self topView
  3901     ^ self topView
  3900 
  3902 
  3901     "Modified: 9.5.1996 / 01:40:24 / cg"
  3903     "Modified: 9.5.1996 / 01:40:24 / cg"
  3926     (uuid := self uuid) isNil ifTrue: [^ self name].
  3928     (uuid := self uuid) isNil ifTrue: [^ self name].
  3927     ^ uuid printString
  3929     ^ uuid printString
  3928 !
  3930 !
  3929 
  3931 
  3930 view
  3932 view
  3931     "return my view - for real views, thats the receiver.
  3933     "return my view - for real views, that's the receiver.
  3932      For wrappers, its the real view that contains it"
  3934      For wrappers, its the real view that contains it"
  3933 
  3935 
  3934     ^ self
  3936     ^ self
  3935 
  3937 
  3936     "Created: 4.6.1996 / 21:32:11 / cg"
  3938     "Created: 4.6.1996 / 21:32:11 / cg"
  4183 
  4185 
  4184     "Modified: / 31.10.1997 / 19:58:10 / cg"
  4186     "Modified: / 31.10.1997 / 19:58:10 / cg"
  4185 !
  4187 !
  4186 
  4188 
  4187 controller:aController
  4189 controller:aController
  4188     "set the controller - thats the one handling user events"
  4190     "set the controller - that's the one handling user events"
  4189 
  4191 
  4190     controller := aController.
  4192     controller := aController.
  4191     controller notNil ifTrue:[
  4193     controller notNil ifTrue:[
  4192         controller view:self.
  4194         controller view:self.
  4193     ]
  4195     ]
  4319         self setInnerClip.
  4321         self setInnerClip.
  4320     ].
  4322     ].
  4321 !
  4323 !
  4322 
  4324 
  4323 viewOrigin
  4325 viewOrigin
  4324     "return the viewOrigin; thats the coordinate of the contents
  4326     "return the viewOrigin; that's the coordinate of the contents
  4325      which is shown topLeft in the view
  4327      which is shown topLeft in the view
  4326      (i.e. the origin of the visible part of the contents)."
  4328      (i.e. the origin of the visible part of the contents)."
  4327 
  4329 
  4328     |currentTransformation|
  4330     |currentTransformation|
  4329 
  4331 
  7505 
  7507 
  7506 grabKeyboard
  7508 grabKeyboard
  7507     "grab the keayboard - that is: report all keyboard events to myself,
  7509     "grab the keayboard - that is: report all keyboard events to myself,
  7508      even if the mouse moved out of myself.
  7510      even if the mouse moved out of myself.
  7509      Returns true, if the grab was sucessfull (could fail, if some other
  7511      Returns true, if the grab was sucessfull (could fail, if some other
  7510      application has a grab - but thats very unlikely)."
  7512      application has a grab - but that's very unlikely)."
  7511 
  7513 
  7512     ^ device grabKeyboardInView:self.
  7514     ^ device grabKeyboardInView:self.
  7513 !
  7515 !
  7514 
  7516 
  7515 grabPointer
  7517 grabPointer
  7516     "grab the pointer - that is: report all motion events relative to
  7518     "grab the pointer - that is: report all motion events relative to
  7517      myself, even if moved out of myself.
  7519      myself, even if moved out of myself.
  7518      Returns true, if the grab was sucessfull (could fail, if some other
  7520      Returns true, if the grab was sucessfull (could fail, if some other
  7519      application has a grab - but thats very unlikely)."
  7521      application has a grab - but that's very unlikely)."
  7520 
  7522 
  7521     ^ self grabPointerWithCursor:nil
  7523     ^ self grabPointerWithCursor:nil
  7522 !
  7524 !
  7523 
  7525 
  7524 grabPointerWithCursor:aCursorOrNil
  7526 grabPointerWithCursor:aCursorOrNil
  7525     "grab the pointer - that is: report all motion events relative to
  7527     "grab the pointer - that is: report all motion events relative to
  7526      myself, even if moved out of myself.
  7528      myself, even if moved out of myself.
  7527      Show aCursor during the grab, if the cursor argument is not nil.
  7529      Show aCursor during the grab, if the cursor argument is not nil.
  7528      Returns true, if the grab was sucessfull (could fail, if some other
  7530      Returns true, if the grab was sucessfull (could fail, if some other
  7529      application has a grab - but thats very unlikely)."
  7531      application has a grab - but that's very unlikely)."
  7530 
  7532 
  7531 
  7533 
  7532 "/    (sensor := self sensor) notNil ifTrue:[
  7534 "/    (sensor := self sensor) notNil ifTrue:[
  7533 "/        "/ make certain all X events have been received
  7535 "/        "/ make certain all X events have been received
  7534 "/        device sync.
  7536 "/        device sync.
 11358                 ] ifCurtailed:[
 11360                 ] ifCurtailed:[
 11359                     self hide.
 11361                     self hide.
 11360                 ]
 11362                 ]
 11361             ] ensure:[
 11363             ] ensure:[
 11362                 aWindowGroup notNil ifTrue:[
 11364                 aWindowGroup notNil ifTrue:[
 11363                     aWindowGroup graphicsDevice sync.  "thats a round trip - make sure that all drawing has been processed"
 11365                     aWindowGroup graphicsDevice sync.  "that's a round trip - make sure that all drawing has been processed"
 11364                     "/ ensure that eventListener runs here ...
 11366                     "/ ensure that eventListener runs here ...
 11365                     Delay waitForMilliseconds:50.
 11367                     Delay waitForMilliseconds:50.
 11366                     aWindowGroup processExposeEvents.
 11368                     aWindowGroup processExposeEvents.
 11367 
 11369 
 11368                     (self isPopUpView or:[ReturnFocusWhenClosingModalBoxes]) ifTrue:[
 11370                     (self isPopUpView or:[ReturnFocusWhenClosingModalBoxes]) ifTrue:[