Closed GoogleCodeExporter closed 9 years ago
Do you know if there is a way for a guy that has only one screen to simulate a
dual-head configuration?
Original comment by benoit.m...@gmail.com
on 25 Apr 2012 at 9:29
I think now you should use the Screen and Screens classes. Screens.Count gives
you the number of screens, and Screens[] returns a Screen object that allows
you to get its geometry.
Logically, there is no global available space, as two screens can have
different sizes, and can be layout in many different ways.
Original comment by benoit.m...@gmail.com
on 25 Apr 2012 at 9:52
Oh wow, i totally missed the screens class, i think i can manage to get the
same info as before with it, but i'm pretty sure the generic screen.w worked in
the past.
If you want, tomorrow i can test an older gambas version (maybe 3.0), that (if
i remember well) worked that way.
Thanks.
Original comment by Kokok...@gmail.com
on 25 Apr 2012 at 10:03
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
Original comment by Kokok...@gmail.com
on 26 Apr 2012 at 11:46
You should use the Rect class and its Union() method. It's easier with it.
Original comment by benoit.m...@gmail.com
on 27 Apr 2012 at 1:33
Original issue reported on code.google.com by
Kokok...@gmail.com
on 24 Apr 2012 at 3:56