home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / bindscrb / pendlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.7 KB  |  65 lines

  1. // pendlg.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12. //
  13.  
  14. #include "stdafx.h"
  15. #include "scribble.h"
  16. #include "pendlg.h"
  17.  
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22.  
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CPenWidthsDlg dialog
  25.  
  26.  
  27. CPenWidthsDlg::CPenWidthsDlg(CWnd* pParent /*=NULL*/)
  28.     : CDialog(CPenWidthsDlg::IDD, pParent)
  29. {
  30.     //{{AFX_DATA_INIT(CPenWidthsDlg)
  31.     m_nThinWidth = 0;
  32.     m_nThickWidth = 0;
  33.     //}}AFX_DATA_INIT
  34. }
  35.  
  36. void CPenWidthsDlg::DoDataExchange(CDataExchange* pDX)
  37. {
  38.     CDialog::DoDataExchange(pDX);
  39.     //{{AFX_DATA_MAP(CPenWidthsDlg)
  40.     DDX_Text(pDX, IDC_THIN_PEN_WIDTH, m_nThinWidth);
  41.     DDV_MinMaxInt(pDX, m_nThinWidth, 1, 20);
  42.     DDX_Text(pDX, IDC_THICK_PEN_WIDTH, m_nThickWidth);
  43.     DDV_MinMaxInt(pDX, m_nThickWidth, 1, 20);
  44.     //}}AFX_DATA_MAP
  45. }
  46.  
  47. BEGIN_MESSAGE_MAP(CPenWidthsDlg, CDialog)
  48.     //{{AFX_MSG_MAP(CPenWidthsDlg)
  49.     ON_BN_CLICKED(IDC_DEFAULT_PEN_WIDTHS, OnDefaultPenWidths)
  50.     //}}AFX_MSG_MAP
  51. END_MESSAGE_MAP()
  52.  
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CPenWidthsDlg message handlers
  56.  
  57. void CPenWidthsDlg::OnDefaultPenWidths()
  58. {
  59.     m_nThinWidth = 2;
  60.     m_nThickWidth = 5;
  61.     UpdateData(FALSE);  // causes DoDataExchange()
  62.         // bSave=FALSE means don't save from screen,
  63.         // rather, write to screen
  64. }
  65.