Page1.cpp
上传用户:sdnygcb
上传日期:2007-01-02
资源大小:18k
文件大小:2k
源码类别:

PropertySheet

开发平台:

Visual C++

  1. // Page1.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "Resize.h"
  5. #include "Page1.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CPage1 property page
  13. IMPLEMENT_DYNCREATE(CPage1, CPropertyPage)
  14. CPage1::CPage1() : CPropertyPage(CPage1::IDD)
  15. {
  16. //{{AFX_DATA_INIT(CPage1)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. }
  20. CPage1::~CPage1()
  21. {
  22. }
  23. void CPage1::DoDataExchange(CDataExchange* pDX)
  24. {
  25. CPropertyPage::DoDataExchange(pDX);
  26. //{{AFX_DATA_MAP(CPage1)
  27. // NOTE: the ClassWizard will add DDX and DDV calls here
  28. //}}AFX_DATA_MAP
  29. }
  30. BEGIN_MESSAGE_MAP(CPage1, CPropertyPage)
  31. //{{AFX_MSG_MAP(CPage1)
  32. ON_WM_SIZE()
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CPage1 message handlers
  37. BOOL CPage1::OnInitDialog() 
  38. {
  39. CPropertyPage::OnInitDialog();
  40. // Add all controls to be resized
  41. m_Resizer.Add(this, IDC_NAMELABEL, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT);
  42. m_Resizer.Add(this, IDC_NAME, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT);
  43. m_Resizer.Add(this, IDC_FRAME, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT|RESIZE_LOCKBOTTOM);
  44. m_Resizer.Add(this, IDC_PHONELABEL, RESIZE_LOCKTOP|RESIZE_LOCKLEFT);
  45. m_Resizer.Add(this, IDC_PHONE, RESIZE_LOCKTOP|RESIZE_LOCKLEFT);
  46. m_Resizer.Add(this, IDC_FAXLABEL, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT);
  47. m_Resizer.Add(this, IDC_FAX, RESIZE_LOCKTOP|RESIZE_LOCKRIGHT);
  48. m_Resizer.Add(this, IDC_NOTESLABEL, RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT|RESIZE_LOCKTOP);
  49. m_Resizer.Add(this, IDC_NOTES, RESIZE_LOCKRIGHT|RESIZE_LOCKLEFT|RESIZE_LOCKBOTTOM|RESIZE_LOCKTOP);
  50. return TRUE; 
  51. }
  52. void CPage1::OnSize(UINT nType, int cx, int cy) 
  53. {
  54. CPropertyPage::OnSize(nType, cx, cy);
  55. // Resize!
  56. m_Resizer.Resize(this);
  57. }