From: Dirk B. <db...@us...> - 2006-02-09 18:01:52
|
Update of /cvsroot/win32forth/win32forth/src/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27763/src/console Added Files: NoConsole.f Log Message: Helper words for turnkey applications that don't need the console window and the w32fConsole.dll added. --- NEW FILE: NoConsole.f --- \ File: NoConsole.f \ Author: Dirk Busch di...@wi... \ *D doc \ *! p-noconsole \ *T No console \ *Q Helper words for turnkey applications that don't need the console window and the \i w32fConsole.dll \d. \ *P To use this words you must load the file \i src/console/NoConsole.f \d first. \ *S Glossary cr .( Loading NoConsole...) anew -NoConsole.f \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\ Turnkey without needing w32fConsole.dll \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ in-application internal Create MessageStructure 32 allot : K_NOOP0 2DROP 0 ; : K_NOOP1 0 ; : K_NOOP2 0 0 ; : NoConsole ( -- ) initialization-chain do-chain default-application ; external : MessageLoop ( -- ) \ W32F console \ *G The message loop for the application. \ ** Use this instead of: \i BEGIN KEY DROP AGAIN \d. BEGIN 0 0 0 MessageStructure Call GetMessage WHILE MessageStructure HandleMessages drop REPEAT ; in-system : NoConsoleIO ( -- ) \ W32F console \ *G Setup of the Console I/O for turnkey applications that don't need \ ** the console window. \ reset all deferd words for the console window to noop's. ['] NOOP IS INIT-CONSOLE-REG ['] K_NOOP1 IS INIT-CONSOLE ['] NOOP IS INIT-SCREEN ['] K_NOOP1 IS KEY ['] K_NOOP1 IS KEY? ['] K_NOOP0 IS ACCEPT ['] DROP IS PUSHKEY ['] 2DROP IS "PUSHKEYS ['] K_NOOP1 IS SHIFTMASK ['] NOOP IS CLS ['] DROP IS EMIT ['] 2DROP IS TYPE ['] NOOP IS CR ['] DROP IS ?CR ['] NOOP IS CONSOLE ['] 2DROP IS GOTOXY ['] K_NOOP2 IS GETXY ['] K_NOOP2 IS GETCOLROW ['] K_NOOP1 IS SIZESTATE ['] 4DROP IS MARKCONSOLE ['] NOOP IS CURSORINVIEW ['] 2DROP IS FGBG! ['] K_NOOP1 IS FG@ ['] K_NOOP1 IS BG@ ['] K_NOOP2 IS CHARWH ['] 2DROP IS SETCHARWH ['] 2DROP IS SETCOLROW ['] DROP IS SET-CURSOR ['] K_NOOP1 IS GET-CURSOR ['] DROP IS SETROWOFF ['] K_NOOP1 IS GETROWOFF ['] K_NOOP2 IS GETMAXCOLROW ['] 2DROP IS SETMAXCOLROW ['] K_NOOP1 IS &THE-SCREEN \ reset BYE to default ['] k_bye is bye \ set default-hello for the turnkey application ['] NoConsole is default-hello ; : NoConsoleInImage ( -- ) \ W32F console \ *G Tell Imageman that we don't need the w32fconsole.dll if possible. \ In older w32f versions you have to modify Imageman.f to do this. \+ VIMAGE also VIMAGE \+ CONSOLE-DLL? false to CONSOLE-DLL? ; in-application module \s \ *S Example \ *E : Main ( -- ) \ ** \ things to do to start the application \ ** ... \ ** \ ** \ enter the message loop \ ** Turnkeyed? \ ** IF MessageLoop bye \ ** THEN ; \ ** \ ** turnkey? [if] \ ** \ ** \ Setup the console I/O \ ** NoConsoleIO \ ** \ ** \ Tell Imageman that we don't need the w32fconsole.dll. \ ** NoConsoleInImage \ ** \ ** \ Create the exe-file \ ** ' Main turnkey PlayVirginRadio.exe \ ** \ ** \ add the Application icon to the EXE file \ ** s" apps\PlayVirginRadio\Virgin.ico" s" PlayVirginRadio.exe" AddAppIcon \ ** \ ** 1 pause-seconds bye \ ** [else] \ ** s" apps\PlayVirginRadio\Virgin.ico" s" PlayVirginRadio.exe" AddAppIcon \ ** Main \ ** [then] \ *P For a full working example see \i apps/PlayVirginRadio/PlayVirginRadio.f \d. \ *Z |