Hi Henglongbike,
this is equivalent to the previous example:
Code: Select all
#include <hmg.ch>
REQUEST HB_GT_WIN_DEFAULT
Function Main
DEFINE WINDOW Form_Main;
AT 0,0 ;
WIDTH 100;
HEIGHT 100;
MAIN;
NOSHOW;
ON INIT ProcMixMode()
END WINDOW
ACTIVATE WINDOW Form_Main
Return Nil
Procedure ProcMixMode()
// Console-Part
SETMODE (25,80)
? "Hello world"
Wait "Press key to continue..."
// Calls the visible window
GUI_Function()
// After the user closes the window, the console-part will continue
?
? "Welcome back!"
? "Program will terminate in 5 seconds"
Inkey(5)
// Close the program
Form_Main.Release
Return
Procedure GUI_Function()
DEFINE WINDOW Form_Modal;
AT 0,0 ;
WIDTH 300;
HEIGHT 300;
TITLE "GUI_Function";
MODAL
@ 50, 100 LABEL Label_1 VALUE "This a modal Window"
@ 200, 100 BUTTON Button_1 CAPTION "OK" ACTION MsgInfo ("Hello")
END WINDOW
CENTER WINDOW Form_Modal
ACTIVATE WINDOW Form_Modal
Return
In
HMG.3.2 exists the trick:
SET WINDOW MAIN ON/OFF (see demo in C:\hmg.3.2\SAMPLES\Miscellaneous\ScreenSplash)
Code: Select all
#include <hmg.ch>
REQUEST HB_GT_WIN_DEFAULT
Function Main
// Console-Part
SETMODE (25,80)
? "Hello world"
Wait "Press key to continue..."
// Calls the visible window
GUI_Function()
// After the user closes the window, the console-part will continue
?
? "Welcome back!"
? "Program will terminate in 5 seconds"
Inkey(5)
Return
Procedure GUI_Function()
SET WINDOW MAIN OFF
DEFINE WINDOW Form_Modal;
AT 0,0 ;
WIDTH 300;
HEIGHT 300;
TITLE "GUI_Function";
MODAL
@ 50, 100 LABEL Label_1 VALUE "This a modal Window"
@ 200, 100 BUTTON Button_1 CAPTION "OK" ACTION MsgInfo ("Hello")
END WINDOW
CENTER WINDOW Form_Modal
ACTIVATE WINDOW Form_Modal
SET WINDOW MAIN ON
Return