home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / starview / examples / tutorial / example1 / example1.cxx < prev   
Encoding:
C/C++ Source or Header  |  1992-08-01  |  1.2 KB  |  53 lines

  1. /*******************************************************************
  2. *  EXAMPLE1.CXX
  3. *  (c) 1992 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 MyWin -------------------------------------------------
  17.  
  18. class MyWin : public WorkWindow
  19. {
  20. public:
  21.                  MyWin( Window* pParent, WinBits nWinStyle ) :
  22.                      WorkWindow( pParent, nWinStyle ) {}
  23.  
  24.     virtual void Paint( const Rectangle& );
  25. };
  26.  
  27. // --- MyWin::Paint() ----------------------------------------------
  28.  
  29. void MyWin::Paint( const Rectangle& )
  30. {
  31.     DrawText( Point( 15, 15 ), "Hello World !" );
  32. }
  33.  
  34. // --- MyApp::Main() -----------------------------------------------
  35.  
  36. void MyApp::Main( int, char*[] )
  37. {
  38.     MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
  39.  
  40.     aMainWin.SetText( "StarView Hello World" );
  41.     aMainWin.Show();
  42.  
  43.     Execute();
  44. }
  45.  
  46. // --- aMyApp ------------------------------------------------------
  47.  
  48. MyApp aMyApp;
  49.  
  50. #ifdef MAC
  51.     Application* pApp = &aMyApp;
  52. #endif
  53.