From: Dirk B. <db...@us...> - 2006-02-09 18:01:52
|
Update of /cvsroot/win32forth/win32forth/apps/PlayVirginRadio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27763/apps/PlayVirginRadio Modified Files: PlayVirginRadio.f Log Message: Helper words for turnkey applications that don't need the console window and the w32fConsole.dll added. Index: PlayVirginRadio.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/PlayVirginRadio/PlayVirginRadio.f,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PlayVirginRadio.f 15 Jan 2006 09:29:14 -0000 1.8 --- PlayVirginRadio.f 9 Feb 2006 18:01:44 -0000 1.9 *************** *** 18,24 **** needs HtmlControl.f needs SoundVolume.f needs Resources.f ! true value turnkey? \ ----------------------------------------------------------------------------- --- 18,25 ---- needs HtmlControl.f needs SoundVolume.f + needs NoConsole.f needs Resources.f ! true value turnkey? \ ----------------------------------------------------------------------------- *************** *** 45,54 **** :M WM_CLOSE ( h m w l -- res ) SoundOff Stop: Player ! DestroyWindow: Player ! ! WM_CLOSE WM: Super ! bye 0 ;M :M GetTooltip: ( -- addr len ) --- 46,58 ---- :M WM_CLOSE ( h m w l -- res ) + bye 0 ;M + + :M On_Done: ( h m w l -- res ) SoundOff Stop: Player ! SoundOn ! 0 call PostQuitMessage drop \ terminate application ! On_Done: super \ cleanup the super class ! 0 ;M :M GetTooltip: ( -- addr len ) *************** *** 95,141 **** :M On_Init: ( hWnd-focus -- f ) ! about-head zcount IDD_ABOUT_HEAD SetDlgItemText: self ! about-msg1 zcount IDD_ABOUT_TEXT SetDlgItemText: self ! about-msg2 zcount IDD_ABOUT_TEXT2 SetDlgItemText: self ! about-msg3 zcount IDD_ABOUT_TEXT3 SetDlgItemText: self ! 1 ;M :M On_Command: ( hCtrl code ID -- f1 ) ! CASE ! IDCANCEL OF 0 end-dialog ENDOF ! false swap ( default result ) ! ENDCASE ;M :M Start: ( -- f ) ! Addr: MainWindow template run-dialog ;M ;Object \ ----------------------------------------------------------------------------- - \ Define the Popup bar \ ----------------------------------------------------------------------------- popupbar player-popup-bar popup " " menuitem "&Turn sound on/off" SoundOnOff ; menuseparator ! menuitem "&Close Virgin Radio Player" DestroyWindow: MainWindow ; menuseparator menuitem "&About Virgin Radio Player" Start: AboutDialog ; endbar - \ ----------------------------------------------------------------------------- - \ ----------------------------------------------------------------------------- - : UnloadPlayer ( -- ) - DestroyWindow: MainWindow - SoundOn \ turn the sound on - ; - unload-chain chain-add-before UnloadPlayer - - \ ----------------------------------------------------------------------------- - \ ----------------------------------------------------------------------------- : StartPlayer ( -- ) Start: MainWindow Play: MainWindow \ start playing radio... ! SoundOn \ turn the sound on HideWindow: MainWindow \ hide the window in the traybar player-popup-bar SetPopupBar: MainWindow --- 99,144 ---- :M On_Init: ( hWnd-focus -- f ) ! about-head zcount IDD_ABOUT_HEAD SetDlgItemText: self ! about-msg1 zcount IDD_ABOUT_TEXT SetDlgItemText: self ! about-msg2 zcount IDD_ABOUT_TEXT2 SetDlgItemText: self ! about-msg3 zcount IDD_ABOUT_TEXT3 SetDlgItemText: self ! 1 ;M :M On_Command: ( hCtrl code ID -- f1 ) ! CASE ! IDCANCEL OF 0 end-dialog ENDOF ! false swap ( default result ) ! ENDCASE ;M :M Start: ( -- f ) ! Addr: MainWindow template run-dialog ;M ;Object + \ ----------------------------------------------------------------------------- \ ----------------------------------------------------------------------------- + + : ExitPlayer ( -- ) + \ *G Exit the player. + SoundOff + Close: MainWindow + SoundOn bye ; + popupbar player-popup-bar + \ *G Define the Popup menu for the player. popup " " menuitem "&Turn sound on/off" SoundOnOff ; menuseparator ! menuitem "&Close Virgin Radio Player" ExitPlayer ; menuseparator menuitem "&About Virgin Radio Player" Start: AboutDialog ; endbar : StartPlayer ( -- ) + \ *G Start the player. Start: MainWindow Play: MainWindow \ start playing radio... ! Sound? 0= if 100 100 volume! then \ turn the sound on HideWindow: MainWindow \ hide the window in the traybar player-popup-bar SetPopupBar: MainWindow *************** *** 143,163 **** \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - \ \\\\\ Turnkey without needing w32fConsole.dll \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - - Create MessageStructure 32 allot - : MessageLoop ( -- ) \ instead of "Begin key drop again" - BEGIN 0 0 0 MessageStructure Call GetMessage - WHILE MessageStructure HandleMessages drop - REPEAT - ; - - : NoConsole ( -- ) - initialization-chain do-chain - default-application ; - ' NoConsole is default-hello - - - \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\ The application \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ --- 146,149 ---- *************** *** 171,178 **** turnkey? [if] ! \ 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? \ Create the exe-file --- 157,165 ---- turnkey? [if] ! \ Setup the Console I/O for an application without the console window. ! NoConsoleIO ! ! \ Tell Imageman that we don't need the w32fconsole.dll. ! NoConsoleInImage \ Create the exe-file |