home *** CD-ROM | disk | FTP | other *** search
/ Media Share 13 / mediashare_13.zip / mediashare_13 / ZIPPED / PROGRAM / WTJ9403.ZIP / WILDASS / SOURCE / INTRODLG.CPP < prev    next >
C/C++ Source or Header  |  1993-07-27  |  2KB  |  82 lines

  1. // introdlg.cpp
  2. //
  3. // class behaviour of the intro dialog
  4. //
  5. // update: 1.00 27-Jul-93 tw
  6.    
  7. #include <afxwin.h>
  8. #include <afxext.h> 
  9. #include <ctl3d.h>
  10.  
  11. #include "resource.h"
  12.  
  13. #include "introdlg.h"
  14.         
  15. BEGIN_MESSAGE_MAP( CIntroDialog, CDialog )
  16.    ON_WM_PAINT() 
  17.    ON_WM_SYSCOLORCHANGE()
  18. END_MESSAGE_MAP()
  19.  
  20.                
  21. CIntroDialog::CIntroDialog()
  22. {
  23.    VERIFY( Create( IDD_INTRO ));
  24.    AfxGetApp()->DoWaitCursor( 1 );
  25. }  
  26.  
  27. CIntroDialog::~CIntroDialog()
  28. {              
  29.    AfxGetApp()->DoWaitCursor( 0 );
  30. }
  31.  
  32. BOOL
  33. CIntroDialog::OnInitDialog()
  34. {
  35.    // general intialization   
  36.    CDialog::OnInitDialog();
  37.    
  38.    // center the intro window to the desktop
  39.    CenterWindow();
  40.    
  41.    // load the bitmap for the intro dialog
  42.    m_bmIntro.LoadBitmap( IDB_INTRO );
  43.    return TRUE;
  44. }     
  45.    
  46.  
  47. void
  48. CIntroDialog::OnPaint()
  49. {
  50.    CPaintDC dc( this );
  51.    CDC      dcMemory;
  52.       
  53.    VERIFY( dcMemory.CreateCompatibleDC( &dc ));
  54.    VERIFY( dcMemory.SelectObject( &m_bmIntro ));
  55.       
  56.    // get the place to BitBlit to
  57.    CWnd * pWnd = GetDlgItem( IDC_POSBITMAP );
  58.    CRect rectWnd;
  59.    pWnd->GetWindowRect( rectWnd );
  60.    
  61.    // center the bitmap to the frame.
  62.    // the bitmap is 48 pixels in size ...
  63.    int cxOffset = (rectWnd.Width()-48) / 2;
  64.    int cyOffset = (rectWnd.Height()-48) / 2;
  65.    
  66.    rectWnd.OffsetRect( CPoint( cxOffset, cyOffset ));
  67.    
  68.    ScreenToClient( rectWnd );
  69.    
  70.    // put the bitmap onto the dialog
  71.    VERIFY( dc.BitBlt( rectWnd.left, rectWnd.top,  
  72.            rectWnd.Width(), rectWnd.Height(), 
  73.            &dcMemory, 0, 0, SRCCOPY ));
  74.  
  75. void
  76. CIntroDialog::OnSysColorChange()
  77. {  
  78.    // ctl3d business ...
  79.    Ctl3dColorChange();
  80. }
  81.