[Gambas-user] Issue 245 in gambas: Wrong behaviour in desktop.w and screen.w on dual head?

gambas at ...2524... gambas at ...2524...
Thu Apr 26 13:46:17 CEST 2012


Comment #4 on issue 245 by Kokok... at ...626...: Wrong behaviour in desktop.w  
and screen.w on dual head?
http://code.google.com/p/gambas/issues/detail?id=245

I ended up in using the following code, it seems to mimic the previous  
desktop.h and desktop.w behaviour.
However, it could fail in some uncommon layout setup, where the screens are  
misaligned.

Public Function DektopWTotal() As Integer
   Dim S As Screen
   Dim VeryLeft As Integer = 99999
   Dim VeryRight As Integer = -1
   For Each s In Screens
     If s.AvailableX < VeryLeft Then VeryLeft = s.AvailableX
     If s.AvailableX + s.AvailableWidth > VeryRight Then VeryRight =  
s.AvailableX + s.AvailableWidth
   Next
   Return VeryRight - Veryleft
End

Public Function DektopHTotal() As Integer
   Dim S As Screen
   Dim VeryTop As Integer = 99999
   Dim VeryBottom As Integer = -1
   For Each s In Screens
     If s.AvailableY < VeryTop Then VeryTop = s.Availabley
     If s.AvailableY + s.AvailableHeight > VeryBottom Then VeryBottom =  
s.AvailableY + s.AvailableHeight
   Next
   Return VeryBottom - VeryTop
End






More information about the User mailing list