home *** CD-ROM | disk | FTP | other *** search
/ PC Direkt 1995 March / PCD_395.iso / starview / pm2csci / german / idle.cx_ / IDLE.CXX
Encoding:
C/C++ Source or Header  |  1994-01-18  |  1.2 KB  |  54 lines

  1. /*******************************************************************
  2. *  IDLE.CXX
  3. *  (c) 1992-1994 STAR DIVISION
  4. *******************************************************************/
  5.  
  6. #include <sv.hxx>
  7.  
  8. // --- class MyApp -------------------------------------------------
  9.  
  10. class MyApp : public Application
  11. {
  12. public:
  13.     virtual void Main( int, char*[] );
  14. };
  15.  
  16. // --- class IdleWindow --------------------------------------------
  17.  
  18. class IdleWindow : public WorkWindow
  19. {
  20. public:
  21.          IdleWindow();
  22.     void IdleBeep( Application* );
  23. };
  24.  
  25. // --- IdleWindow::IdleWindow() ------------------------------------
  26.  
  27. IdleWindow::IdleWindow() :
  28.                 WorkWindow( NULL, WB_APP | WB_STDWORK )
  29. {
  30.     pApp->InsertIdleHdl( LINK( this, IdleWindow, IdleBeep ), 1 );
  31.  
  32.     SetText( "IdleDemo" );
  33.     Show();
  34. }
  35.  
  36. // --- IdleWindow::IdleBeep() --------------------------------------
  37.  
  38. void IdleWindow::IdleBeep( Application* )
  39. {
  40.     Sound::Beep();
  41. }
  42.  
  43. // --- MyApp::Main() -----------------------------------------------
  44.  
  45. void MyApp::Main( int, char*[] )
  46. {
  47.     IdleWindow aWindow;
  48.     Execute();
  49. }
  50.  
  51. // --- aMyApp ------------------------------------------------------
  52.  
  53. MyApp aMyApp;
  54.