RosettaCodeData/Task/Window-management/M2000-Interpreter/window-management.m2000

64 lines
1.7 KiB
Plaintext

Module WindowManagment{
Declare Form1 Form
With Form1, "UseIcon", True, "UseReverse", True
With Form1, "Title" As Caption$, "Visible" As Visible,"TitleHeight" As tHeight
With Form1, "Sizable", True, "Height" as WHeight, "Width" as WWidth
Print "First Window Caption: ";Caption$
Print "Title Height: ";tHeight
Print "Window Width: ";WWidth
Print "Window Height: ";WHeight
NotNow=true
Function Form1.Unload {
Read New &Ok
if NotNow Else visible=false
Ok=true
}
Caption$="Window Managment"
Print "Show - no modal"
Method Form1,"Show" ' , 1 for modal opening
Wait 3000
Print "Show on TaskBar also"
Method Form1,"ShowTaskBar"
Wait 5000 ' 10 second
Print "Minimize Window"
Method form1,"Minimize"
Wait 2000
Print "Show again"
Method Form1, "Show"
Wait 3000
Print "Maximize Window"
Method Form1, "Maximize", true as res
print res
Wait 5000
Print "Restore to normal"
Method Form1, "Maximize", false as res
print res
Wait 5000
Print "Move Window to 0,0"
Method Form1, "Show"
Method Form1, "move", 0,0 ', 6000, Wheight*2
Wait 5000
Print "Resize Window"
NotNow=false
Method Form1, "move", 0,0 , WWidth*1.5, Wheight*2
Print "Click Unload (is a fake unload)"
profiler ' hires timer
do
Wait 10
Until timecount>5000 or not visible
visible=false
Wait 3000
Print "Modal view - Wait user to close window"
Print "Click Unload - isn't fake now"
' We have an event to stop unloading
' Modal show just release inner loop when we press unload
Method Form1,"Show", 1 'for modal opening
wait 5000
' to prove it lets show window again
print "ho ho ho - last time...Click Unload"
Method Form1,"Show", 1 'for modal opening
' So here we unload the Form1 by software
Declare Form1 Nothing
}
WindowManagment