home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / CMNCTRL.PAK / PROPSHT.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.1 KB  |  82 lines

  1. // AllControlsSheet.cpp : implementation file
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1995 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13.  
  14. #include "stdafx.h"
  15. #include "ctrldemo.h"
  16. #include "propsht.h"
  17. #include "mtreectl.h"
  18.  
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CAllControlsSheet
  27.  
  28. IMPLEMENT_DYNAMIC(CAllControlsSheet, CPropertySheet)
  29.  
  30. CAllControlsSheet::CAllControlsSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
  31.     :CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
  32. {
  33.     AddControlPages();
  34.  
  35.     // TODO :: Add the pages for the rest of the controls here.
  36. }
  37.  
  38. CAllControlsSheet::CAllControlsSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
  39.     :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
  40. {
  41.     AddControlPages();
  42. }
  43.  
  44. CAllControlsSheet::~CAllControlsSheet()
  45. {
  46. }
  47.  
  48. void CAllControlsSheet::AddControlPages()
  49. {
  50.     m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  51.     m_psh.dwFlags |= PSP_USEHICON;
  52.     m_psh.hIcon = m_hIcon;
  53.  
  54.     AddPage(&m_listctrlpage);
  55.     AddPage(&m_treectrlpage);
  56.     AddPage(&m_toolbarpage);
  57.     AddPage(&m_progctrlpage);
  58.     AddPage(&m_sliderctrlpage);
  59.     AddPage(&m_spinctrlpage);
  60.     AddPage(&m_animctrlpage);
  61. }
  62.  
  63. BEGIN_MESSAGE_MAP(CAllControlsSheet, CPropertySheet)
  64.     //{{AFX_MSG_MAP(CAllControlsSheet)
  65.     ON_WM_QUERYDRAGICON()
  66.     //}}AFX_MSG_MAP
  67. END_MESSAGE_MAP()
  68.  
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CAllControlsSheet message handlers
  71.  
  72. BOOL CAllControlsSheet::OnInitDialog()
  73. {
  74.     SetIcon(m_hIcon, TRUE);
  75.     SetIcon(m_hIcon, FALSE);
  76.     return CPropertySheet::OnInitDialog();
  77. }
  78. HCURSOR CAllControlsSheet::OnQueryDragIcon() 
  79. {
  80.     return (HCURSOR) m_hIcon;
  81. }
  82.