TopView.st
changeset 7265 dab1ddde607d
parent 7233 65e40c2485b5
child 7335 c3c790dc651e
equal deleted inserted replaced
7264:84b62bae4dc0 7265:dab1ddde607d
   550 
   550 
   551 addTrayIcon:anImageOrForm toolTipMessage:toolTipMessage
   551 addTrayIcon:anImageOrForm toolTipMessage:toolTipMessage
   552     "WIN32 only: add a tray icon for myself;
   552     "WIN32 only: add a tray icon for myself;
   553      may then receive tray*-events in the future."
   553      may then receive tray*-events in the future."
   554 
   554 
   555     self device
   555     device
   556 	 addTrayIconFor:self
   556          addTrayIconFor:self
   557 	 icon:anImageOrForm iconMask:nil
   557          icon:anImageOrForm iconMask:nil
   558 	 toolTipMessage:toolTipMessage
   558          toolTipMessage:toolTipMessage
   559 
   559 
   560     "
   560     "
   561      |v icon|
   561      |v icon|
   562 
   562 
   563      v := StandardSystemView new.
   563      v := StandardSystemView new.
   663       which want to be moved by click-motion on the background)"
   663       which want to be moved by click-motion on the background)"
   664 
   664 
   665     |delta|
   665     |delta|
   666 
   666 
   667     CurrentWindowBeingMoved == self ifTrue:[
   667     CurrentWindowBeingMoved == self ifTrue:[
   668 	delta := self graphicsDevice pointerPosition - CurrentWindowMoveStart.
   668         delta := device pointerPosition - CurrentWindowMoveStart.
   669 	(CurrentWindowMoveState notNil
   669         (CurrentWindowMoveState notNil
   670 	or:[ delta r > 5 ]) ifTrue:[
   670         or:[ delta r > 5 ]) ifTrue:[
   671 	    CurrentWindowMoveState := #inMove.
   671             CurrentWindowMoveState := #inMove.
   672 	    CurrentWindowMoveStart := self graphicsDevice pointerPosition.
   672             CurrentWindowMoveStart := device pointerPosition.
   673 	    self origin:(self origin + delta).
   673             self origin:(self origin + delta).
   674 	].
   674         ].
   675     ].
   675     ].
   676 
   676 
   677     "Created: / 03-03-2011 / 19:13:08 / cg"
   677     "Created: / 03-03-2011 / 19:13:08 / cg"
   678 !
   678 !
   679 
   679 
   691     "a window move operation
   691     "a window move operation
   692      (only used with modeless popup windows; i.e. windows without decoration,
   692      (only used with modeless popup windows; i.e. windows without decoration,
   693       which want to be moved by click-motion on the background)"
   693       which want to be moved by click-motion on the background)"
   694 
   694 
   695     CurrentWindowBeingMoved := self.
   695     CurrentWindowBeingMoved := self.
   696     CurrentWindowMoveStart := self graphicsDevice pointerPosition.
   696     CurrentWindowMoveStart := device pointerPosition.
   697     CurrentWindowMoveState := nil.
   697     CurrentWindowMoveState := nil.
   698 
   698 
   699     "Created: / 03-03-2011 / 19:09:39 / cg"
   699     "Created: / 03-03-2011 / 19:09:39 / cg"
   700 !
   700 !
   701 
   701 
   778     "the receiver is to be destroyed - look for partners and slaves"
   778     "the receiver is to be destroyed - look for partners and slaves"
   779 
   779 
   780     |wg dev|
   780     |wg dev|
   781 
   781 
   782     wg := windowGroup.                  "/ have to fetch windowGroup before;
   782     wg := windowGroup.                  "/ have to fetch windowGroup before;
   783     dev := self graphicsDevice.         "/ and device ...
   783     dev := device.                      "/ and device ...
   784     super destroy.                      "/ ... since destroy nils em
   784     super destroy.                      "/ ... since destroy nils em
   785 
   785 
   786 "/    dev notNil ifTrue:[
   786 "/    dev notNil ifTrue:[
   787 "/        dev flush
   787 "/        dev flush
   788 "/    ].
   788 "/    ].
   799     "initialize the topViews position for the screens center"
   799     "initialize the topViews position for the screens center"
   800 
   800 
   801     |screenCenter|
   801     |screenCenter|
   802 
   802 
   803     super initialize.
   803     super initialize.
   804     self graphicsDevice initializeTopViewHookFor:self.
   804     device initializeTopViewHookFor:self.
   805 
   805 
   806     "/ MULTI SCREEN
   806     "/ MULTI SCREEN
   807     screenCenter := self graphicsDevice centerOfMonitorHavingPointer.
   807     screenCenter := device centerOfMonitorHavingPointer.
   808 
   808 
   809     left := screenCenter x - (width // 2).
   809     left := screenCenter x - (width // 2).
   810     top := screenCenter y - (height // 2).
   810     top := screenCenter y - (height // 2).
   811     type := 0
   811     type := 0
   812 
   812 
   815 
   815 
   816 postRealize
   816 postRealize
   817     super postRealize.
   817     super postRealize.
   818 
   818 
   819     keyboardProcessor isNil ifTrue:[
   819     keyboardProcessor isNil ifTrue:[
   820 	keyboardProcessor := KeyboardProcessor new.
   820         keyboardProcessor := KeyboardProcessor new.
   821     ].
   821     ].
   822 
   822 
   823     self graphicsDevice realizedTopViewHookFor:self
   823     device realizedTopViewHookFor:self
   824 !
   824 !
   825 
   825 
   826 realize
   826 realize
   827     self isMarkedAsUnmappedModalBox ifTrue:[
   827     self isMarkedAsUnmappedModalBox ifTrue:[
   828 	"/ must clear this flag
   828 	"/ must clear this flag
  1127 
  1127 
  1128     (id := self drawableId) isNil ifTrue:[
  1128     (id := self drawableId) isNil ifTrue:[
  1129         self create.
  1129         self create.
  1130         id := self drawableId
  1130         id := self drawableId
  1131     ].
  1131     ].
  1132     self graphicsDevice 
  1132     device 
  1133         activateWindow:id;
  1133         activateWindow:id;
  1134         focusView:self
  1134         focusView:self
  1135 
  1135 
  1136     "
  1136     "
  1137      Transcript topView activate
  1137      Transcript topView activate
  1200 mapIconified
  1200 mapIconified
  1201     "make the view visible but iconified.
  1201     "make the view visible but iconified.
  1202      In contrast to map, which does it non-iconified"
  1202      In contrast to map, which does it non-iconified"
  1203 
  1203 
  1204     realized ifFalse:[
  1204     realized ifFalse:[
  1205 	"
  1205         "
  1206 	 now, make the view visible
  1206          now, make the view visible
  1207 	"
  1207         "
  1208 	realized := true.
  1208         realized := true.
  1209 	self graphicsDevice
  1209         device
  1210 	    mapView:self id:self drawableId iconified:true
  1210             mapView:self id:self drawableId iconified:true
  1211 	    atX:left y:top width:width height:height
  1211             atX:left y:top width:width height:height
  1212 	    minExtent:(self minExtent) maxExtent:(self maxExtent)
  1212             minExtent:(self minExtent) maxExtent:(self maxExtent)
  1213     ]
  1213     ]
  1214 
  1214 
  1215     "Modified: 25.2.1997 / 22:44:33 / cg"
  1215     "Modified: 25.2.1997 / 22:44:33 / cg"
  1216     "Created: 24.7.1997 / 12:48:21 / cg"
  1216     "Created: 24.7.1997 / 12:48:21 / cg"
  1217 !
  1217 !
  1235      this also raises the priority of the sending thread slightly.
  1235      this also raises the priority of the sending thread slightly.
  1236 
  1236 
  1237      Mark a TopView as #beScreenDialog, to send this on open."
  1237      Mark a TopView as #beScreenDialog, to send this on open."
  1238 
  1238 
  1239     self drawableId isNil ifTrue:[self create].
  1239     self drawableId isNil ifTrue:[self create].
  1240     self graphicsDevice setForegroundWindow:self drawableId
  1240     device setForegroundWindow:self drawableId
  1241 
  1241 
  1242     "
  1242     "
  1243      Transcript topView raise
  1243      Transcript topView raise
  1244      Transcript topView setForegroundWindow
  1244      Transcript topView setForegroundWindow
  1245     "
  1245     "
  1264 
  1264 
  1265     self obsoleteMethodWarning.
  1265     self obsoleteMethodWarning.
  1266 
  1266 
  1267     self drawableId isNil ifTrue:[self create].
  1267     self drawableId isNil ifTrue:[self create].
  1268     anotherView isNil ifTrue:[
  1268     anotherView isNil ifTrue:[
  1269 	otherId := self drawableId.
  1269         otherId := self drawableId.
  1270     ] ifFalse:[
  1270     ] ifFalse:[
  1271 	anotherView create.
  1271         anotherView create.
  1272 	otherId := anotherView id.
  1272         otherId := anotherView id.
  1273     ].
  1273     ].
  1274     self graphicsDevice setTransient:self drawableId for:otherId.
  1274     device setTransient:self drawableId for:otherId.
  1275     self origin:aPosition.
  1275     self origin:aPosition.
  1276     self open
  1276     self open
  1277 
  1277 
  1278     "
  1278     "
  1279      |v1 v2|
  1279      |v1 v2|
  1415         "
  1415         "
  1416         TakeFocusWhenMapped == true ifTrue:[
  1416         TakeFocusWhenMapped == true ifTrue:[
  1417             self getKeyboardFocus.
  1417             self getKeyboardFocus.
  1418         ]
  1418         ]
  1419     ].
  1419     ].
  1420     self graphicsDevice isWindowsPlatform ifTrue:[
  1420     device isWindowsPlatform ifTrue:[
  1421         self raise
  1421         self raise
  1422     ].
  1422     ].
  1423     false "self isScreenDialog" ifTrue:[
  1423     false "self isScreenDialog" ifTrue:[
  1424         self setForegroundWindow.
  1424         self setForegroundWindow.
  1425         self activate.
  1425         self activate.