#FEATURE by stefan
authorStefan Vogel <sv@exept.de>
Thu, 23 May 2019 12:09:00 +0200
changeset 8678 2d160e46bc50
parent 8677 8e63719d8dfe
child 8679 8ab83e314c96
#FEATURE by stefan class: WinWorkstation added: #workableAreaBoundsAt: class: WinWorkstation::MonitorInfo added: #workableAreaBounds
WinWorkstation.st
--- a/WinWorkstation.st	Tue May 14 12:03:11 2019 +0200
+++ b/WinWorkstation.st	Thu May 23 12:09:00 2019 +0200
@@ -7830,18 +7830,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.
 
@@ -7854,6 +7854,7 @@
     "
 
     "Modified: / 08-09-2006 / 18:19:22 / cg"
+    "Modified: / 23-05-2019 / 09:47:21 / Stefan Vogel"
 !
 
 usableHeightAt:aPoint
@@ -7891,6 +7892,32 @@
     "
 
     "Modified (comment): / 27-10-2012 / 13:34:32 / cg"
+!
+
+workableAreaBoundsAt:aPoint
+    "return a rectangle representing the displays bounding box 
+     of the workable area (without TaskBar etc.) of the monitor"
+
+    |monitorHandle monitorInfo|
+
+    "/ ******* MULTI SCREEN ******
+    monitorHandle := self monitorHandleForPoint:aPoint.
+    monitorHandle notNil ifTrue:[
+        monitorInfo := self monitorInfoFor:monitorHandle.
+        monitorInfo notNil ifTrue:[
+            ^ monitorInfo workableAreaBounds
+        ].
+    ].
+
+    ^ super workableAreaBoundsAt:aPoint
+
+    "
+     Display workableAreaBoundsAt:100@100
+     Display workableAreaBoundsAt:2000@100
+     Display workableAreaBoundsAt:-200@100
+    "
+
+    "Created: / 23-05-2019 / 11:10:06 / Stefan Vogel"
 ! !
 
 !WinWorkstation methodsFor:'bitmap/window creation'!
@@ -20373,6 +20400,20 @@
 
 workY
     ^ workY
+!
+
+workableAreaBounds
+    "return a rectangle representing the displays bounding box 
+     of the workable area (without TaskBar etc.) of the monitor"
+    "/ ******* MULTI SCREEN ******
+    
+    ^ Rectangle 
+        left:workX
+        top:workY
+        width:workW - 1
+        height:workH - 1
+
+    "Created: / 23-05-2019 / 11:06:15 / Stefan Vogel"
 ! !
 
 !WinWorkstation::NativeFileDialogCreationData methodsFor:'accessing'!