home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************
- * ATIMER.CXX
- * (c) 1992-1994 STAR DIVISION
- *******************************************************************/
-
- #include <sv.hxx>
-
- // --- class MyApp -------------------------------------------------
-
- class MyApp : public Application
- {
- public:
- virtual void Main( int, char*[] );
- };
-
- // --- class TimerWindow -------------------------------------------
-
- class TimerWindow : public WorkWindow
- {
- protected:
- AutoTimer aTimer;
-
- public:
- TimerWindow();
- void TimeBeep( AutoTimer* );
- };
-
- // --- TimerWindow::TimerWindow() ----------------------------------
-
- TimerWindow::TimerWindow() :
- WorkWindow( NULL, WB_APP | WB_STDWORK )
- {
- aTimer.ChangeTimeout( 1000 );
- aTimer.ChangeTimeoutHdl( LINK( this, TimerWindow, TimeBeep ) );
- aTimer.Start();
-
- SetText( "TimerDemo" );
- Show();
- }
-
- // --- TimerWindow::TimeBeep() -------------------------------------
-
- void TimerWindow::TimeBeep( AutoTimer* )
- {
- Sound::Beep();
- }
-
- // --- MyApp::Main() -----------------------------------------------
-
- void MyApp::Main( int, char*[] )
- {
- TimerWindow aWindow;
- Execute();
- }
-
- // --- aMyApp ------------------------------------------------------
-
- MyApp aMyApp;
-