home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / starview / examples / tutorial / example4 / about4.cxx next >
Encoding:
C/C++ Source or Header  |  1992-08-01  |  1.4 KB  |  51 lines

  1. /*******************************************************************
  2. *  ABOUT4.CXX
  3. *  (c) 1992 STAR DIVISION
  4. *******************************************************************/
  5.  
  6. #include <sv.hxx>
  7.  
  8. #include "about4.hrc"
  9. #include "about4.hxx"
  10.  
  11. // --- AboutBox::AboutBox() ----------------------------------------
  12.  
  13. AboutBox::AboutBox( Window* pParent, ResId& rResId ) :
  14.           ModalDialog( pParent, rResId.Lock() ),
  15.           aText( this, ResId( RID_TEXT ) ),
  16.           aButton( this, ResId( RID_OK ) )
  17. {
  18.     aButton.ChangeClickHdl( LINK( this, AboutBox::ButtonHdl ) );
  19.     rResId.Unlock();
  20. }
  21.  
  22. // --- AboutBox::Paint() -------------------------------------------
  23.  
  24. void AboutBox::Paint( const Rectangle& )
  25. {
  26.     Brush   aOldBrush;
  27.     Point   aPointAry[3];
  28.     aPointAry[0] = Point( 110,70 );
  29.     aPointAry[1] = Point( 140,30 );
  30.     aPointAry[2] = Point( 170,70 );
  31.  
  32.     aOldBrush = ChangeFillInBrush( Brush( Color( COL_RED ) ) );
  33.     DrawRect( Rectangle( Point( 20, 10 ), Point( 80, 50 ) ) );
  34.  
  35.     ChangeFillInBrush( Brush( Color( COL_BLUE ) ) );
  36.     DrawEllipse( Rectangle( Point( 60, 20 ), Point( 130, 60 ) ) );
  37.  
  38.     ChangeFillInBrush( Brush( Color( COL_GREEN ) ) );
  39.     DrawPolygon( 3, aPointAry );
  40.  
  41.     ChangeFillInBrush( aOldBrush );
  42. }
  43.  
  44. // --- AboutBox::ButtonHdl() ---------------------------------------
  45.  
  46. void AboutBox::ButtonHdl( Button* )
  47. {
  48.     EndDialog();
  49. }
  50.  
  51.