A simple program to show how to make a form, show, hide, minimize, maximize, move, resize
For further examples you can find in INFO file, modules to study: CREATEWINDOW, DEMO1, MEDITOR, HELLO, LIST33, MOVEBUTTON, AU, MOUSEPOS, POPUP, DOWN4, TEXTONLY. SIMPLETEXTEN, FORM44 (3 forms/Using Threads), INTERACTION, INTER2, CS (CSharp Editor), HTMLEDITOR, COMBO1, FORMTARGET, FIRSTWINDOW, VER11, FORMTARGET2, SHOWKEYS, BUTTONSONFRAME, UCPIECHART, UCCHART, NINEBUTTONS, SHAPEEX, RADIAL, ROSETTA.
Info file: If yo do the setup of M2000 editor: Run M2000.exe, then write Dir AppDir$ press enter then write Load Info press enter then after see the animation and the ShowKeys form press F1 to change the directory to M2000 user directory and automatic save the file there. So now each other time you can load the info using Load Info. (don't press Ctrl+A to save it again, because this save the file back, without place commands for running at loading, so press F1). Statement FKEY show the commands for functions keys. The F1 key run Saveme module. You can examine/change the code of Saveme using Edit SaveMe. You can search for a string (from M2000 command line) using FindWord "Decalre". You can using Edit FindWord to examine the actual code (is a module in Info File).
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
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου
You can feel free to write any suggestion, or idea on the subject.