TopView.st
changeset 5719 014212ef8765
parent 5718 7013638adb71
child 5720 4c3aa29fff39
--- a/TopView.st	Thu Mar 03 15:25:55 2011 +0100
+++ b/TopView.st	Thu Mar 03 19:17:42 2011 +0100
@@ -17,7 +17,8 @@
 		ForceModalBoxesToOpenAtPointer MasterSlaveMask WindowTypeMask
 		TypeMaster TypeSlave TypePartner TypeDialog TypePopUp
 		TypeUndecorated TypeToolWindow TypeToolDialog MDIClientMask
-		MDIClient TypeScreenDialog'
+		MDIClient TypeScreenDialog CurrentWindowMoved
+		CurrentWindowMoveStart CurrentWindowMoveState'
 	poolDictionaries:''
 	category:'Views-Basic'
 !
@@ -392,6 +393,17 @@
     type := #popup
 !
 
+bePopUpViewNotModal
+    "/ the nonInteger handling code is for backward compatibility only.
+"/    type isInteger ifTrue:[
+"/        type := (type bitClear:WindowTypeMask) bitOr:TypePopUp.
+"/        ^ self.
+"/    ].
+    type := #popUpNotModal
+
+    "Created: / 03-03-2011 / 19:04:40 / cg"
+!
+
 beScreenDialog
     "make me a Screen-Dialog Window; that is one which raises above ALL other windows
      (not only st/x ones)"
@@ -765,6 +777,32 @@
 
 !TopView methodsFor:'misc'!
 
+doWindowMove
+    "a window move operation"
+
+    |delta|
+
+    CurrentWindowMoved == self ifTrue:[
+        delta := device pointerPosition - CurrentWindowMoveStart.
+        (CurrentWindowMoveState notNil
+        or:[ delta r > 5 ]) ifTrue:[
+            CurrentWindowMoveState := #inMove.
+            CurrentWindowMoveStart := device pointerPosition.
+            self origin:(self origin + delta).
+        ].
+    ].
+
+    "Created: / 03-03-2011 / 19:13:08 / cg"
+!
+
+endWindowMove
+    "a window wants to stop a move operation"
+
+    CurrentWindowMoved := nil.
+
+    "Created: / 03-03-2011 / 19:17:24 / cg"
+!
+
 raiseDeiconified
     "deiconify & bring to front"
 
@@ -781,6 +819,16 @@
     "Modified: 3.5.1996 / 23:49:36 / stefan"
 !
 
+startWindowMove
+    "a window wants to start a move operation"
+
+    CurrentWindowMoved := self.
+    CurrentWindowMoveStart := device pointerPosition.
+    CurrentWindowMoveState := nil.
+
+    "Created: / 03-03-2011 / 19:09:39 / cg"
+!
+
 waitUntilClosed
     "wait until the receiver has been closed.
      Can be used to synchronize multiple-window applications,
@@ -1392,11 +1440,11 @@
 !TopView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.136 2011-03-03 14:25:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.137 2011-03-03 18:17:42 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.136 2011-03-03 14:25:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.137 2011-03-03 18:17:42 cg Exp $'
 ! !
 
 TopView initialize!