GUI/Maximum window dimensions: Difference between revisions

no edit summary
(Scala solution added)
No edit summary
Line 479:
<lang lingo>put _system.desktopRectList
-- [rect(0, 0, 1360, 768), rect(1360, 0, 2960, 1024)]</lang>
 
=={{header|M2000 Interpreter}}==
Move console to all monitors, at full screen (at each monitor). Then open a form and resize it to fill all monitors, the move the form to monitor with bigger area and expand form to fill that monitor. At the end close the window. All actions performed with once running threads, using After milliseconds { }
 
<lang M2000 Interpreter>
Module CheckAllMonitors {
mode 16 ' font size
i=-1
Flush
Do {
i++
Window mode, i
Print Window=i
Wait 100
Form ; ' expand Backgroun to fill monitor (form without argumnetx cut that frame)
if window=i Then {
Background {
Cls 0, 0
data i, scale.x, scale.y, motion.x, motion.y
}
} else exit
} Always
Dim Scrx(i), ScrY(i), ScrLeft(i), ScrTop(i)
While Not Empty {
Read i
Read Scrx(i), ScrY(i), ScrLeft(i), ScrTop(i)
}
\\ check if we have same left top point
For i=0 to Len(Scrx())-1 {
Print "Monitor:", i, "left top (";ScrLeft(i);",";ScrTop(i);") size: (";Scrx(i);",";ScrY(i);")"
}
A=ScrLeft(0)
B=ScrTop(0)
LeftMargin=A
TopMargin=B
RightMargin=Scrx(0)+A
BottomMargin=Scry(0)+B
MaxArea=Scrx(0)*Scry(0)
ChooseMonitor=0
Out=True
If Len(Scrx())>1 then {
For i=1 to Len(Scrx())-1 {
LeftMargin=Min.Data(A, ScrLeft(i))
TopMargin=Min.Data(B, ScrTop(i))
RightMargin=Max.Data(RightMargin, Scrx(i)+Scrleft(i))
BottomMargin=Max.Data(BottomMargin, Scry(i)+ScrTop(i))
Out=Out and (A=ScrLeft(i) and B=ScrTop(i))
if MaxArea<Scrx(i)*Scry(i) then MaxArea=Scrx(i)*Scry(i) : ChooseMonitor=i
}
}
If Len(Scrx())=1 then {
Print "One Monitor"
} else Print If$(Out ->"Multiple Monitors of Same Size", "Multiple Monitors ")
Print "Left Top Corner:", LeftMargin, TopMargin
Print "Width, Height", RightMargin-LeftMargin, BottomMargin-TopMargin
Declare Form1 Form
\\ After 100ms Form1 expand to all monitors
After 100 {
Method Form1,"Move", LeftMargin, TopMargin, RightMargin-LeftMargin, BottomMargin-TopMargin
}
\\ After 2000-100ms Form1 move to montior ChooseMonitor, and has same width and height
After 2000 {
Try {
Method Form1,"Move", ScrLeft(ChooseMonitor),ScrTop(ChooseMonitor), Scrx(ChooseMonitor), Scry(ChooseMonitor)
}
}
\\ after 4000 ms from other threads, form1 close
After 4000 {
Try {
Method Form1, "CloseNow"
}
}
Method Form1, "Show", 1
Declare Form1 Nothing
Threads Erase
}
CheckAllMonitors
</lang>
 
 
 
=={{header|Mathematica}} / {{header|Wolfram Language}}==
Anonymous user