added:
authorMichael Beyl <mb@exept.de>
Tue, 05 Oct 2010 17:53:58 +0200
changeset 5607 0c93f7103308
parent 5606 2e14c2ee78b3
child 5608 283f9270bf76
added: #monitorInfoAtPoint:
WinWorkstation.st
--- a/WinWorkstation.st	Tue Oct 05 17:52:42 2010 +0200
+++ b/WinWorkstation.st	Tue Oct 05 17:53:58 2010 +0200
@@ -7293,6 +7293,26 @@
     "Modified: / 08-09-2006 / 15:40:18 / cg"
 !
 
+monitorInfoAtPoint:aPoint
+    "returns the usable height of the display (in pixels) at a given point
+     Normally, the same as height, but may be smaller, in
+     case some menu space is taken up by the window manager (windows).
+     On multi-display systems with different sized screens, this should care for
+     which display is at the given x-position"
+
+    |monitorHandle|
+
+    self numberOfMonitors > 1 ifTrue:[
+        monitorHandle := self monitorHandleForPoint:( aPoint max:(0@0) ).
+        ^ self monitorInfoFor:monitorHandle.
+    ].
+    ^ nil
+    "
+     Display monitorInfoAtPoint:100@100
+     Display monitorInfoAtPoint:2000@100
+    "
+!
+
 numberOfMonitors
     ^ self getSystemMetrics:#SM_CMONITORS
 
@@ -7419,18 +7439,18 @@
     h := hSingle := self getSystemMetrics:#SM_CYFULLSCREEN.
 
     (self numberOfMonitors) > 1 ifTrue:[
-	w := self getSystemMetrics:#SM_CXVIRTUALSCREEN.
-	h := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
-	(w isNil or:[h isNil]) ifTrue:[
-	    "/ not supported under win95 and win-nt4 - fallback to real extent
-	    w := wSingle.
-	    h := hSingle.
-	] ifFalse:[
-	    dx := (self getSystemMetrics:#SM_CXSCREEN) - wSingle.
-	    dy := (self getSystemMetrics:#SM_CYSCREEN) - hSingle.
-	    w := w - dx.
-	    h := h - dy - 8.
-	].
+        w := self getSystemMetrics:#SM_CXVIRTUALSCREEN.
+        h := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
+        (w isNil or:[h isNil]) ifTrue:[
+            "/ not supported under win95 and win-nt4 - fallback to real extent
+            w := wSingle.
+            h := hSingle.
+        ] ifFalse:[
+            dx := (self getSystemMetrics:#SM_CXSCREEN) - wSingle.
+            dy := (self getSystemMetrics:#SM_CYSCREEN) - hSingle.
+            w := w - dx.
+            h := h - dy - 8.
+        ].
     ].
     ^ w @ h.
 
@@ -18867,11 +18887,11 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.434 2010-08-25 11:20:36 az Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.435 2010-10-05 15:53:58 mb Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.434 2010-08-25 11:20:36 az Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.435 2010-10-05 15:53:58 mb Exp $'
 ! !
 
 WinWorkstation initialize!