home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------*/
- /* HELLO.C */
- /*------------------------------------------------------------------*/
- /* API ▒` ªí : hello() */
- /* API ¿τ╝╞└] : hello.plb */
- /* ⌐IÑsñΦªí : SET LIBRARY TO HELLO */
- /* =HELLO() */
- /*------------------------------------------------------------------*/
- #include <stdio.h>
- #include <pro_ext.h>
-
- void FAR hello( ParamBlk FAR *parm )
- {
- WHANDLE wh;
- Point pt;
- char FAR *hello , *space;
- int keystroke , i;
- int width , height; /* ªs⌐±╡°╡íñº╝e½╫╗P░¬½╫ñº┼▄╝╞ */
- int cur_h , cur_v; /* ªs⌐±╡°╡íñºÑ¬ñW¿ñ│╗┬I«y╝╨ñº┼▄╝╞ */
- int title_v , title_h; /* ªs⌐±┐ΘÑX⌐≤╡°╡íñññºñσªrªΩ¬║«y╝╨ñº┼▄╝╞ */
- hello = "╢┘! ▒zªn╢▄";
- space = " ";
-
- /* ½╪Ñ▀ñ@¡╙╡°╡í */
- wh = _WOpen( 11, 20, 15, 50, /* ╡°╡íñº«y╝╨ª∞╕m */
- ZOOM + ADJ + CLOSE + MOVE + SHADOW + WMINIMIZE, /*╡°╡íñº─▌⌐╩*/
- DIALOG_SCHEME, /* ª╣╡°╡í¿╧Ñ╬ñº╜╒ªΓ╜L */
- 0,
- WO_SYSTEMBORDER );
- if( wh != NULL ) {
- _WSetTitle( wh, "HELLO" ); /* │]⌐wª╣╡°╡íñº╝╨├D */
- _WSetFooter( wh, "Written in WATCOM C" ); /* │]⌐wª╣╡°╡íñº╡∙╕} */
- _WShow( wh ); /* ▒╥░╩ª╣╡°╡í */
- pt.h = title_h = 11;
- pt.v = title_v = 1;
- _WPosCursor( wh , pt );
- _WPutStr( wh , hello );
- }
- keystroke = _InKey(0 , HIDECURSOR + MOUSEACTIVE ); /* ╡Ñ¡╘¿╧Ñ╬¬╠½÷ñUÑ⌠ñ@ */
- /* ┴Σ¿├▒N┤σ╝╨┴⌠┬├░_¿╙ */
- if ( keystroke != 27 ) /* ░╗┤·¿╧Ñ╬¬╠¼Oº_½÷ñU ESC ┴Σ */
- {
- width = _WWidth( wh );
- height = _WHeight( wh );
- pt.h = cur_h = 20;
- pt.v = cur_v = 10;
- for (i=0;i<10;i++)
- {
- pt.h = cur_h = cur_h -2;
- pt.v = cur_v = cur_v -1;
- _WMove( wh , pt ); /* ▓╛░╩╡°╡í */
- pt.h = width = width + 5;
- pt.v = height = height + 2;
- _WSize( wh , pt ); /* º∩┼▄╡°╡íñºñjñp */
- pt.h = title_h = (_WWidth( wh ) - _StrLen( hello )) / 2 ;
- pt.v = title_v = _WHeight( wh ) / 2;
- _WPosCursor( wh , pt );
- _WPutStr( wh, hello );
- _InKey( 1 , HIDECURSOR );
- if (i < 9)
- {
- _WPosCursor( wh , pt );
- _WPutStr( wh, space );
- }
- }
- _InKey(0 , HIDECURSOR + MOUSEACTIVE );
- }
- _WClose( wh ); /* ├÷│¼╡°╡í¿├▒N¿Σ▒q░O╛╨┼Θññ▓M░ú */
- _RetInt( 0L, 1 );
- }
-
- FoxInfo myFoxInfo[] = {
- { "HELLO", hello, 0, "?" }
- };
-
- FoxTable _FoxTable = {
- (FoxTable FAR *) 0,
- sizeof( myFoxInfo) / sizeof( FoxInfo ),
- myFoxInfo
- };