.
authorclaus
Tue, 19 Sep 1995 16:59:18 +0200
changeset 190 4c49bdd5b80f
parent 189 d8d63d1b5681
child 191 a81db32ff94b
.
DevWorkst.st
DeviceWorkstation.st
GLXWorkstat.st
GLXWorkstation.st
ModalBox.st
SimpleView.st
WSensor.st
WindowSensor.st
XWorkstat.st
XWorkstation.st
--- a/DevWorkst.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/DevWorkst.st	Tue Sep 19 16:59:18 1995 +0200
@@ -36,7 +36,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.44 1995-09-15 00:00:29 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.45 1995-09-19 14:58:06 claus Exp $
 '!
 
 !DeviceWorkstation class methodsFor:'documentation'!
@@ -57,7 +57,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.44 1995-09-15 00:00:29 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.45 1995-09-19 14:58:06 claus Exp $
 "
 !
 
@@ -1728,6 +1728,21 @@
     "
 !
 
+viewIdFromUser
+    "let user specify a view on the screen, return its window id.
+     This works even for non smalltalk views.
+     This returns the id of the view being clicked in, 
+     which is not always a topView."
+
+    ^ self viewIdFromPoint:(self pointFromUser) 
+
+    "
+     Display viewIdFromUser 
+    "
+
+    "Created: 18.9.1995 / 23:07:20 / claus"
+!
+
 viewFromUser
     "let user specify a view on the screen; if the selected view is
      not an ST/X view, nil is returned.
@@ -2233,6 +2248,10 @@
     ].
     knownViews at:freeIdx put:aView.
     knownIds at:freeIdx put:aNumber.
+
+    dispatching ifFalse:[
+	self startDispatch
+    ].
 !
 
 removeKnownView:aView
@@ -2252,7 +2271,12 @@
 	    knownViews at:index put:nil.
 	    knownIds at:index put:nil.
 	    lastId := nil.
-	    lastView := nil
+	    lastView := nil.
+
+	    (knownViews findFirst:[:slot | slot notNil]) == 0 ifTrue:[
+		"/ my last view was closed
+		dispatching := false
+	    ]
 	]
     ]
 !
@@ -2448,12 +2472,14 @@
      if not, stop dispatch. This ends the dispatcher process when the
      last view is closed on that device."
 
-    self == Display ifTrue:[
-"/      idToViewMapping isEmpty ifTrue:[
-	knownViews isEmpty ifTrue:[
+    knownViews notNil ifTrue:[
+	(knownViews findFirst:[:slot | slot notNil]) == 0 ifTrue:[
+	    "/ my last view was closed
 	    dispatching := false
 	]
     ]
+
+    "Modified: 19.9.1995 / 11:31:54 / claus"
 !
 
 dispatchPendingEvents
--- a/DeviceWorkstation.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/DeviceWorkstation.st	Tue Sep 19 16:59:18 1995 +0200
@@ -36,7 +36,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.44 1995-09-15 00:00:29 claus Exp $
+$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.45 1995-09-19 14:58:06 claus Exp $
 '!
 
 !DeviceWorkstation class methodsFor:'documentation'!
@@ -57,7 +57,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.44 1995-09-15 00:00:29 claus Exp $
+$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.45 1995-09-19 14:58:06 claus Exp $
 "
 !
 
@@ -1728,6 +1728,21 @@
     "
 !
 
+viewIdFromUser
+    "let user specify a view on the screen, return its window id.
+     This works even for non smalltalk views.
+     This returns the id of the view being clicked in, 
+     which is not always a topView."
+
+    ^ self viewIdFromPoint:(self pointFromUser) 
+
+    "
+     Display viewIdFromUser 
+    "
+
+    "Created: 18.9.1995 / 23:07:20 / claus"
+!
+
 viewFromUser
     "let user specify a view on the screen; if the selected view is
      not an ST/X view, nil is returned.
@@ -2233,6 +2248,10 @@
     ].
     knownViews at:freeIdx put:aView.
     knownIds at:freeIdx put:aNumber.
+
+    dispatching ifFalse:[
+	self startDispatch
+    ].
 !
 
 removeKnownView:aView
@@ -2252,7 +2271,12 @@
 	    knownViews at:index put:nil.
 	    knownIds at:index put:nil.
 	    lastId := nil.
-	    lastView := nil
+	    lastView := nil.
+
+	    (knownViews findFirst:[:slot | slot notNil]) == 0 ifTrue:[
+		"/ my last view was closed
+		dispatching := false
+	    ]
 	]
     ]
 !
@@ -2448,12 +2472,14 @@
      if not, stop dispatch. This ends the dispatcher process when the
      last view is closed on that device."
 
-    self == Display ifTrue:[
-"/      idToViewMapping isEmpty ifTrue:[
-	knownViews isEmpty ifTrue:[
+    knownViews notNil ifTrue:[
+	(knownViews findFirst:[:slot | slot notNil]) == 0 ifTrue:[
+	    "/ my last view was closed
 	    dispatching := false
 	]
     ]
+
+    "Modified: 19.9.1995 / 11:31:54 / claus"
 !
 
 dispatchPendingEvents
--- a/GLXWorkstat.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/GLXWorkstat.st	Tue Sep 19 16:59:18 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/Attic/GLXWorkstat.st,v 1.28 1995-09-14 10:01:30 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/GLXWorkstat.st,v 1.29 1995-09-19 14:58:21 claus Exp $
 '!
 
 !GLXWorkstation class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/Attic/GLXWorkstat.st,v 1.28 1995-09-14 10:01:30 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/GLXWorkstat.st,v 1.29 1995-09-19 14:58:21 claus Exp $
 "
 !
 
@@ -190,6 +190,9 @@
  */
 #define SETWIN(aGLXWindowId)                             \
     if (_INST(activeWindow) != aGLXWindowId) {           \
+	if (! ISCONNECTED ) {				 \
+	    RETURN (false);				 \
+	}						 \
 	if (! __isSmallInteger(aGLXWindowId)) {          \
 	    RETURN (false);                              \
 	}                                                \
--- a/GLXWorkstation.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/GLXWorkstation.st	Tue Sep 19 16:59:18 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.28 1995-09-14 10:01:30 claus Exp $
+$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.29 1995-09-19 14:58:21 claus Exp $
 '!
 
 !GLXWorkstation class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.28 1995-09-14 10:01:30 claus Exp $
+$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.29 1995-09-19 14:58:21 claus Exp $
 "
 !
 
@@ -190,6 +190,9 @@
  */
 #define SETWIN(aGLXWindowId)                             \
     if (_INST(activeWindow) != aGLXWindowId) {           \
+	if (! ISCONNECTED ) {				 \
+	    RETURN (false);				 \
+	}						 \
 	if (! __isSmallInteger(aGLXWindowId)) {          \
 	    RETURN (false);                              \
 	}                                                \
--- a/ModalBox.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/ModalBox.st	Tue Sep 19 16:59:18 1995 +0200
@@ -21,7 +21,7 @@
 COPYRIGHT (c) 1990 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.27 1995-09-07 12:29:39 claus Exp $
+$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.28 1995-09-19 14:58:34 claus Exp $
 '!
 
 !ModalBox class methodsFor:'documentation'!
@@ -42,7 +42,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.27 1995-09-07 12:29:39 claus Exp $
+$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.28 1995-09-19 14:58:34 claus Exp $
 "
 !
 
@@ -674,7 +674,7 @@
      another open/show to occur later.
      if I have been opened modeLess, perform the normal destroy operation.
     "
-    windowGroup isModal ifTrue:[
+    (windowGroup isNil or:[windowGroup isModal]) ifTrue:[
 	self hide
     ] ifFalse:[
 	super terminate
--- a/SimpleView.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/SimpleView.st	Tue Sep 19 16:59:18 1995 +0200
@@ -44,7 +44,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.20 1995-09-17 22:53:41 claus Exp $
+$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.21 1995-09-19 14:58:45 claus Exp $
 '!
 
 !SimpleView class methodsFor:'documentation'!
@@ -65,7 +65,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.20 1995-09-17 22:53:41 claus Exp $
+$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.21 1995-09-19 14:58:45 claus Exp $
 "
 !
 
@@ -3582,6 +3582,22 @@
     "
 !
 
+openAt:aPoint
+    "open up the view modeless - positions the view"
+
+    ^self openModelessAt:aPoint
+
+    "Created: 18.9.1995 / 23:30:43 / claus"
+!
+
+openAtCenter
+    "open up the view modeless - positions the view"
+
+    ^self openModelessAtCenter
+
+    "Created: 18.9.1995 / 23:30:56 / claus"
+!
+
 openModeless
     "create and schedule a new windowgroup for me and open the view.
      The view will be handled by its own process, effectively running in
@@ -3611,6 +3627,50 @@
 
 	 YesNoBox new openModeless
     "
+    "
+     (almost) the same:
+	 YesNoBox new open
+
+	 YesNoBox new openModal
+
+     different:
+	 (Button label:'hello') open
+
+	 (Button label:'hello') openModal
+    "
+!
+
+openModelessAt:aPoint
+    "open up the view modeless - positions the view
+     (i.e. circumvents window managers positioning)"
+
+    self origin:aPoint.
+    self create.
+    device setTransient:drawableId for:0.
+    ^ self openModeless
+
+    "
+     View new openModeless
+
+     View new openModelessAt:100@100
+    "
+
+    "Created: 18.9.1995 / 23:21:42 / claus"
+!
+
+openModelessAtCenter
+    "open up the view modeless - positions the view
+     (i.e. circumvents window managers positioning)"
+
+    ^ self openModelessAt:(device center - (self extent//2)).
+
+    "
+     View new openModeless
+
+     View new openModelessAtCenter
+    "
+
+    "Created: 18.9.1995 / 23:21:42 / claus"
 !
 
 openModal
@@ -3634,6 +3694,34 @@
     "
 !
 
+openModalAt:aPoint
+    "open up the view modeless - positions the view
+     (i.e. circumvents window managers positioning)"
+
+    self origin:aPoint.
+    self create.
+    device setTransient:drawableId for:0.
+    ^ self openModal
+
+    "
+     View new openModal
+
+     View new openModalAt:100@100
+    "
+
+    "Created: 18.9.1995 / 23:21:42 / claus"
+    "Modified: 18.9.1995 / 23:32:26 / claus"
+!
+
+openModalAtCenter
+    "open up the view modeless - positions the view
+     (i.e. circumvents window managers positioning)"
+
+    ^ self openModalAt:(device center - (self extent//2)).
+
+    "Created: 18.9.1995 / 23:31:47 / claus"
+!
+
 openModal:aBlock
     "create a new windowgroup, but start processing in the current process -
      actually suspending event processing for the currently active group.
--- a/WSensor.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/WSensor.st	Tue Sep 19 16:59:18 1995 +0200
@@ -28,7 +28,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/Attic/WSensor.st,v 1.31 1995-09-07 12:30:27 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/WSensor.st,v 1.32 1995-09-19 14:59:08 claus Exp $
 '!
 
 !WindowSensor class methodsFor:'documentation'!
@@ -49,7 +49,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/Attic/WSensor.st,v 1.31 1995-09-07 12:30:27 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/WSensor.st,v 1.32 1995-09-19 14:59:08 claus Exp $
 "
 !
 
@@ -1517,17 +1517,41 @@
 
 !WindowSensor methodsFor:'event simulation'!
 
-pushUserEvent:anEvent
+pushEvent:anEvent
     "manually put an event into the queue - this allows
-     simulation of events (implementation of recorders & playback)."
+     simulation of events (implementation of recorders & playback)
+     or asynchronous communication between view applications."
 
     mouseAndKeyboard addLast:anEvent.
     self notifyEventArrival
+
+    "Created: 18.9.1995 / 22:37:57 / claus"
+!
+
+pushUserEvent:aSelector for:aView
+    "manually put an event into the queue - this allows
+     simulation of events (implementation of recorders & playback)
+     or asynchronous communication between view applications.
+     The view will perform a method as specified by aSelector,
+     when it performs event processing; this is different than sending
+     this message directly, since the execution is done by the views process,
+     not by the current process (which is especially worthwhile, if that method 
+     shows a modal box or similar)."
+
+     self pushUserEvent:aSelector for:aView withArguments:#() 
+
+    "Modified: 18.9.1995 / 22:40:12 / claus"
 !
 
 pushUserEvent:aSelector for:aView withArguments:arguments
     "manually put an event into the queue - this allows
-     simulation of events (implementation of recorders & playback)."
+     simulation of events (implementation of recorders & playback)
+     or asynchronous communication between view applications.
+     The view will perform a method as specified by aSelector,
+     when it performs event processing; this is different than sending
+     this message directly, since the execution is done by the views process,
+     not by the current process (which is especially worthwhile, if that method 
+     shows a modal box or similar)."
 
     self pushEvent:(WindowEvent 
 		     for:aView
@@ -1560,7 +1584,7 @@
 	anEvent notNil ifTrue:[
 	    anEvent isKeyEvent ifTrue:[
 		anEvent view:aView.
-		aView sensor pushUserEvent:anEvent.
+		aView sensor pushEvent:anEvent.
 "/ anEvent type printNL.
 		mouseAndKeyboard at:i put:nil
 	    ]
--- a/WindowSensor.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/WindowSensor.st	Tue Sep 19 16:59:18 1995 +0200
@@ -28,7 +28,7 @@
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.31 1995-09-07 12:30:27 claus Exp $
+$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.32 1995-09-19 14:59:08 claus Exp $
 '!
 
 !WindowSensor class methodsFor:'documentation'!
@@ -49,7 +49,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.31 1995-09-07 12:30:27 claus Exp $
+$Header: /cvs/stx/stx/libview/WindowSensor.st,v 1.32 1995-09-19 14:59:08 claus Exp $
 "
 !
 
@@ -1517,17 +1517,41 @@
 
 !WindowSensor methodsFor:'event simulation'!
 
-pushUserEvent:anEvent
+pushEvent:anEvent
     "manually put an event into the queue - this allows
-     simulation of events (implementation of recorders & playback)."
+     simulation of events (implementation of recorders & playback)
+     or asynchronous communication between view applications."
 
     mouseAndKeyboard addLast:anEvent.
     self notifyEventArrival
+
+    "Created: 18.9.1995 / 22:37:57 / claus"
+!
+
+pushUserEvent:aSelector for:aView
+    "manually put an event into the queue - this allows
+     simulation of events (implementation of recorders & playback)
+     or asynchronous communication between view applications.
+     The view will perform a method as specified by aSelector,
+     when it performs event processing; this is different than sending
+     this message directly, since the execution is done by the views process,
+     not by the current process (which is especially worthwhile, if that method 
+     shows a modal box or similar)."
+
+     self pushUserEvent:aSelector for:aView withArguments:#() 
+
+    "Modified: 18.9.1995 / 22:40:12 / claus"
 !
 
 pushUserEvent:aSelector for:aView withArguments:arguments
     "manually put an event into the queue - this allows
-     simulation of events (implementation of recorders & playback)."
+     simulation of events (implementation of recorders & playback)
+     or asynchronous communication between view applications.
+     The view will perform a method as specified by aSelector,
+     when it performs event processing; this is different than sending
+     this message directly, since the execution is done by the views process,
+     not by the current process (which is especially worthwhile, if that method 
+     shows a modal box or similar)."
 
     self pushEvent:(WindowEvent 
 		     for:aView
@@ -1560,7 +1584,7 @@
 	anEvent notNil ifTrue:[
 	    anEvent isKeyEvent ifTrue:[
 		anEvent view:aView.
-		aView sensor pushUserEvent:anEvent.
+		aView sensor pushEvent:anEvent.
 "/ anEvent type printNL.
 		mouseAndKeyboard at:i put:nil
 	    ]
--- a/XWorkstat.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/XWorkstat.st	Tue Sep 19 16:59:18 1995 +0200
@@ -36,7 +36,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.60 1995-09-15 00:00:56 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.61 1995-09-19 14:59:18 claus Exp $
 '!
 
 !XWorkstation class methodsFor:'documentation'!
@@ -57,7 +57,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.60 1995-09-15 00:00:56 claus Exp $
+$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.61 1995-09-19 14:59:18 claus Exp $
 "
 !
 
@@ -5866,7 +5866,7 @@
     super startDispatch
 !
 
-checkForEndOfDispatch
+XXcheckForEndOfDispatch
     "return true, if there are still any views of interrest - if not,
      stop dispatch"
 
--- a/XWorkstation.st	Mon Sep 18 00:54:24 1995 +0200
+++ b/XWorkstation.st	Tue Sep 19 16:59:18 1995 +0200
@@ -36,7 +36,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.60 1995-09-15 00:00:56 claus Exp $
+$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.61 1995-09-19 14:59:18 claus Exp $
 '!
 
 !XWorkstation class methodsFor:'documentation'!
@@ -57,7 +57,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.60 1995-09-15 00:00:56 claus Exp $
+$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.61 1995-09-19 14:59:18 claus Exp $
 "
 !
 
@@ -5866,7 +5866,7 @@
     super startDispatch
 !
 
-checkForEndOfDispatch
+XXcheckForEndOfDispatch
     "return true, if there are still any views of interrest - if not,
      stop dispatch"