[Plib-cvs] plib/examples/src/pw pw_demo.cxx,1.7,1.8
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2004-04-06 23:58:11
|
Update of /cvsroot/plib/plib/examples/src/pw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14232/plib/examples/src/pw Modified Files: pw_demo.cxx Log Message: Added autorepeat function to PW for X11 and MacOSX. Added a dummy function for Windows until someone gets around to writing it. Index: pw_demo.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pw/pw_demo.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- pw_demo.cxx 24 Mar 2004 11:19:57 -0000 1.7 +++ pw_demo.cxx 6 Apr 2004 23:45:19 -0000 1.8 @@ -58,20 +58,35 @@ fprintf ( stderr, "\n" ) ; - if ( key == '<' ) pwSetSize ( 100, 100 ) ; - else - if ( key == '>' ) pwSetSize ( 640, 480 ) ; - - if ( key == 0x1B ) /* ESC */ + if ( updn == PW_DOWN ) { - pwCleanup () ; - exit ( 0 ) ; + if ( key == '<' ) pwSetSize ( 100, 100 ) ; + else + if ( key == '>' ) pwSetSize ( 640, 480 ) ; + else + if ( key == 'a' ) pwSetAutoRepeatKey ( true ) ; + else + if ( key == 'b' ) pwSetAutoRepeatKey ( false ) ; + + if ( key == 0x1B ) /* ESC */ + { + pwCleanup () ; + exit ( 0 ) ; + } } } int main ( int, char ** ) { + printf ( "PLIB/PW Demo.\n" ) ; + printf ( "=============\n\n" ) ; + printf ( "Type or mouse in the window to see PW callbacks in action.\n" ) ; + printf ( "Hit '<' or '>' to resize the window from within the program.\n" ) ; + printf ( "Hit 'a' or 'b' to enable or disable auto key repeat.\n" ) ; + printf ( "Hit ESC to exit.\n" ) ; + printf ( "\n" ) ; + pwInit ( 100, 100, 640, 480, false, "PLIB Window Demo", true, 0 ) ; pwSetCallbacks ( kbFunc, msFunc, mpFunc, rsFunc, exFunc ) ; |