home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / cmnctrls / propsht.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  1.7 KB  |  74 lines

  1. // AllControlsSheet.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "ctrldemo.h"
  6. #include "propsht.h"
  7. #include "mtreectl.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CAllControlsSheet
  17.  
  18. IMPLEMENT_DYNAMIC(CAllControlsSheet, CPropertySheet)
  19.  
  20. CAllControlsSheet::CAllControlsSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
  21.     :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
  22. {
  23.     AddControlPages();
  24. }
  25.  
  26. CAllControlsSheet::CAllControlsSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
  27.     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
  28. {
  29.     AddControlPages();
  30. }
  31.  
  32. CAllControlsSheet::~CAllControlsSheet()
  33. {
  34. }
  35.  
  36. void CAllControlsSheet::AddControlPages()
  37. {
  38.     m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  39.     m_psh.dwFlags |= PSP_USEHICON;
  40.     m_psh.hIcon = m_hIcon;
  41.  
  42.     AddPage(&m_listctrlpage);
  43.     AddPage(&m_treectrlpage);
  44.     AddPage(&m_progctrlpage);
  45.     AddPage(&m_sliderctrlpage);
  46.     AddPage(&m_spinctrlpage);
  47. }
  48.  
  49. BEGIN_MESSAGE_MAP(CAllControlsSheet, CPropertySheet)
  50.     //{{AFX_MSG_MAP(CAllControlsSheet)
  51.     ON_WM_QUERYDRAGICON()
  52.     //}}AFX_MSG_MAP
  53. END_MESSAGE_MAP()
  54.  
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CAllControlsSheet message handlers
  57.  
  58. BOOL CAllControlsSheet::OnInitDialog()
  59. {
  60.     SetIcon(m_hIcon, TRUE);
  61.     SetIcon(m_hIcon, FALSE);
  62.     CString csTitle;
  63.     csTitle.LoadString((UINT)AFX_IDS_APP_TITLE);
  64.     LPTSTR lpszTitle = csTitle.GetBuffer(40);
  65.     SetTitle(lpszTitle);
  66.     csTitle.ReleaseBuffer();
  67.     return CPropertySheet::OnInitDialog();
  68. }
  69.  
  70. HCURSOR CAllControlsSheet::OnQueryDragIcon() 
  71. {
  72.     return (HCURSOR) m_hIcon;
  73. }
  74.