home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tv20cpp.zip / tutorial / tvguid02.cpp < prev    next >
C/C++ Source or Header  |  1998-01-19  |  2KB  |  58 lines

  1. /*---------------------------------------------------------*/
  2. /*                                                         */
  3. /*   Turbo Vision 1.0                                      */
  4. /*   TVGUID02 Demo Source File                             */
  5. /*   Copyright (c) 1991 by Borland International           */
  6. /*                                                         */
  7. /*---------------------------------------------------------*/
  8.  
  9. #define Uses_TApplication
  10. #define Uses_TKeys
  11. #define Uses_TRect
  12. #define Uses_TStatusLine
  13. #define Uses_TStatusItem
  14. #define Uses_TStatusDef
  15. #define Uses_TDeskTop
  16. #include <tvision/tv.h>
  17.  
  18. // tv.h ensures that the correct *.h files are included for each
  19. // of the above classes and their bases.
  20.  
  21. class TMyApp : public TApplication
  22. {
  23.  
  24. public:
  25.     TMyApp();
  26.     static TStatusLine *initStatusLine( TRect r );
  27.     // new for tvguid02
  28. };
  29.  
  30. TMyApp::TMyApp() :
  31.     TProgInit( &TMyApp::initStatusLine,
  32.                &TMyApp::initMenuBar,
  33.                &TMyApp::initDeskTop
  34.              )
  35. {
  36. }
  37.  
  38. // new for tvguid02:
  39. TStatusLine *TMyApp::initStatusLine(TRect r)
  40. {
  41.     r.a.y = r.b.y - 1;     // move top to 1 line above bottom
  42.     return new TStatusLine( r,
  43.         *new TStatusDef( 0, 0xFFFF ) +
  44.         // set range of help contexts
  45.             *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
  46.             // define an item
  47.             *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
  48.             // and another one
  49.         );
  50. }
  51.  
  52. int main()
  53. {
  54.     TMyApp myApp;
  55.     myApp.run();
  56.     return 0;
  57. }
  58.