ToolBoxView.cpp
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:4k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // ToolBoxView.cpp : implementation of the CToolBoxView class
  2. //
  3. // This file is a part of the XTREME TOOLKIT PRO MFC class library.
  4. // (c)1998-2008 Codejock Software, All Rights Reserved.
  5. //
  6. // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
  7. // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
  8. // CONSENT OF CODEJOCK SOFTWARE.
  9. //
  10. // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
  11. // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
  12. // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
  13. // SINGLE COMPUTER.
  14. //
  15. // CONTACT INFORMATION:
  16. // support@codejock.com
  17. // http://www.codejock.com
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. #include "stdafx.h"
  21. #include "ToolBox.h"
  22. #include "ToolBoxDoc.h"
  23. #include "ToolBoxView.h"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CToolBoxView
  31. IMPLEMENT_DYNCREATE(CToolBoxView, CView)
  32. BEGIN_MESSAGE_MAP(CToolBoxView, CView)
  33. //{{AFX_MSG_MAP(CToolBoxView)
  34. ON_WM_CREATE()
  35. ON_WM_SIZE()
  36. ON_WM_ERASEBKGND()
  37. //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CToolBoxView construction/destruction
  41. CToolBoxView::CToolBoxView()
  42. {
  43. // TODO: add construction code here
  44. }
  45. CToolBoxView::~CToolBoxView()
  46. {
  47. }
  48. BOOL CToolBoxView::PreCreateWindow(CREATESTRUCT& cs)
  49. {
  50. // TODO: Modify the Window class or styles here by modifying
  51. //  the CREATESTRUCT cs
  52. cs.dwExStyle |= WS_EX_CONTROLPARENT;
  53. return CView::PreCreateWindow(cs);
  54. }
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CToolBoxView drawing
  57. void CToolBoxView::OnDraw(CDC*)
  58. {
  59. }
  60. /////////////////////////////////////////////////////////////////////////////
  61. // CToolBoxView diagnostics
  62. #ifdef _DEBUG
  63. void CToolBoxView::AssertValid() const
  64. {
  65. CView::AssertValid();
  66. }
  67. void CToolBoxView::Dump(CDumpContext& dc) const
  68. {
  69. CView::Dump(dc);
  70. }
  71. CToolBoxDoc* CToolBoxView::GetDocument() // non-debug version is inline
  72. {
  73. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CToolBoxDoc)));
  74. return (CToolBoxDoc*)m_pDocument;
  75. }
  76. #endif //_DEBUG
  77. /////////////////////////////////////////////////////////////////////////////
  78. // CToolBoxView message handlers
  79. int CToolBoxView::OnCreate(LPCREATESTRUCT lpCreateStruct)
  80. {
  81. if (CView::OnCreate(lpCreateStruct) == -1)
  82. return -1;
  83. m_wndPropertySheet.Create(WS_VISIBLE|WS_CHILD|SS_NOTIFY|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
  84. CRect(0, 0, 0, 0), this, 0);
  85. m_wndPropertySheet.GetPaintManager()->SetAppearance(xtpTabAppearanceExcel);
  86. m_wndPropertySheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
  87. m_wndPageLookAndBehaviour.Create(CPageLookAndBehaviour::IDD, &m_wndPropertySheet);
  88. m_wndPageDragAndDrop.Create(CPageDragAndDrop::IDD, &m_wndPropertySheet);
  89. m_wndPageLookAndBehaviour.ModifyStyle(0, DS_CONTROL);
  90. m_wndPageLookAndBehaviour.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
  91. m_wndPropertySheet.InsertItem(0, _T("Look And Behaviour"), m_wndPageLookAndBehaviour);
  92. m_wndPropertySheet.InsertItem(1, _T("Drag And Drop"), m_wndPageDragAndDrop);
  93. return 0;
  94. }
  95. void CToolBoxView::OnSize(UINT nType, int cx, int cy)
  96. {
  97. CView::OnSize(nType, cx, cy);
  98. if (m_wndPropertySheet.GetSafeHwnd())
  99. {
  100. m_wndPropertySheet.MoveWindow(0, 0, cx, cy);
  101. }
  102. }
  103. BOOL CToolBoxView::OnEraseBkgnd(CDC* )
  104. {
  105. return TRUE;
  106. }