home *** CD-ROM | disk | FTP | other *** search
/ PC Direkt 1995 March / PCD_395.iso / starview / winblci / german / atimer.cx_ / ATIMER.CXX
Encoding:
C/C++ Source or Header  |  1994-01-18  |  1.3 KB  |  59 lines

  1. /*******************************************************************
  2. *  ATIMER.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 TimerWindow -------------------------------------------
  17.  
  18. class TimerWindow : public WorkWindow
  19. {
  20. protected:
  21.     AutoTimer   aTimer;
  22.  
  23. public:
  24.                 TimerWindow();
  25.     void        TimeBeep( AutoTimer* );
  26. };
  27.  
  28. // --- TimerWindow::TimerWindow() ----------------------------------
  29.  
  30. TimerWindow::TimerWindow() :
  31.                 WorkWindow( NULL, WB_APP | WB_STDWORK )
  32. {
  33.     aTimer.ChangeTimeout( 1000 );
  34.     aTimer.ChangeTimeoutHdl( LINK( this, TimerWindow, TimeBeep ) );
  35.     aTimer.Start();
  36.  
  37.     SetText( "TimerDemo" );
  38.     Show();
  39. }
  40.  
  41. // --- TimerWindow::TimeBeep() -------------------------------------
  42.  
  43. void TimerWindow::TimeBeep( AutoTimer* )
  44. {
  45.     Sound::Beep();
  46. }
  47.  
  48. // --- MyApp::Main() -----------------------------------------------
  49.  
  50. void MyApp::Main( int, char*[] )
  51. {
  52.     TimerWindow aWindow;
  53.     Execute();
  54. }
  55.  
  56. // --- aMyApp ------------------------------------------------------
  57.  
  58. MyApp aMyApp;
  59.