RosettaCodeData/Task/Window-creation-X11/M2000-Interpreter/window-creation-x11.m2000
2023-07-01 13:44:08 -04:00

41 lines
1.6 KiB
Text

\\ M2000 froms (windows) based on a flat, empty with no title bar, vb6 window and a user control.
\\ title bar is a user control in M2000 form
\\ On linux, wine application run M2000 interpreter traslating vb6 calls to window system.
Module SquareAndText2Window {
Const black=0, white=15
Declare form1 form
\\ defaultwindow title is the name of variable,here is: form1
Rem With form1, "Title", "A title for this window"
Method form1,"move", 2000,3000,10000,8000 ' in twips
layer form1 {
Cls white
Font "Verdana"
Rem Window 12 , 10000,8000; ' hide modr 13 using a REM before
Rem
Mode 12 ' 12 in pt
Cls white, 2 ' fill white, set third raw for top of scrolling frame
Pen black
Move 1000,2000 ' absolute coordinated in twips - use Step for relative coordinates
\\ polygon use relative coordinates in twips
polygon white, 1000,0,0,-1000,-1000,0,0,-1000
\\ write text using graphic coordinates
Move 1000, 3000 : Legend "Hello World", "Arial", 12
\\ write text using layer as console (font Verdana)
Print @(15,5),"Goodbye Wolrd"
\\ 9120 7920 if we use window 12,10000, 8000 (cut exactly for console use)
\\ 10000 8000 if we use Mode 12
\\ scale.y include window height (including header)
\\ the layer extend bellow
Print scale.x, scale.y
}
\\ show form1 modal (continue to next line when we close the window)
Method form1,"Show", 1
\\ closing meand hide in M2000
wait 1000 ' in msec
Method form1,"move", random(2000, 10000),random(3000, 8000)
\\ now show again
Method form1,"Show", 1
\\ now we close the form, releasing resources
Declare form1 Nothing
}
SquareAndText2Window