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

对话框与窗口

开发平台:

Visual C++

  1. // XTPMarkupPanel.h: interface for the CXTPMarkupPanel 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. #if !defined(__XTPMARKUPPANEL_H__)
  21. #define __XTPMARKUPPANEL_H__
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif // _MSC_VER > 1000
  25. #include "XTPMarkupFrameworkElement.h"
  26. class CXTPMarkupBrush;
  27. class _XTP_EXT_CLASS CXTPMarkupUIElementCollection : public CXTPMarkupCollection
  28. {
  29. public:
  30. CXTPMarkupUIElementCollection();
  31. ~CXTPMarkupUIElementCollection();
  32. public:
  33. CXTPMarkupUIElement* GetItem(int nIndex) const;
  34. };
  35. class _XTP_EXT_CLASS CXTPMarkupPanel : public CXTPMarkupFrameworkElement
  36. {
  37. DECLARE_MARKUPCLASS(CXTPMarkupPanel)
  38. protected:
  39. CXTPMarkupPanel();
  40. virtual ~CXTPMarkupPanel();
  41. public:
  42. CXTPMarkupUIElementCollection* GetChildren() const;
  43. public:
  44. void SetBackground(CXTPMarkupBrush* brush);
  45. CXTPMarkupBrush* GetBackground() const;
  46. protected:
  47. virtual int GetVisualChildrenCount() const;
  48. virtual CXTPMarkupVisual* GetVisualChild(int nIndex) const;
  49. protected:
  50. virtual void SetContentObject(CXTPMarkupBuilder* pBuilder, CXTPMarkupObject* pContent);
  51. virtual BOOL HasContentObject() const;
  52. virtual void OnRender(CXTPMarkupDrawingContext* drawingContext);
  53. virtual CXTPMarkupInputElement* InputHitTestOverride(CPoint point) const;
  54. protected:
  55. CXTPMarkupUIElementCollection* m_pChildren;
  56. public:
  57. static CXTPMarkupDependencyProperty* m_pBackgroundProperty;
  58. };
  59. AFX_INLINE CXTPMarkupUIElementCollection* CXTPMarkupPanel::GetChildren() const {
  60. return m_pChildren;
  61. }
  62. AFX_INLINE int CXTPMarkupPanel::GetVisualChildrenCount() const {
  63. return m_pChildren->GetCount();
  64. }
  65. AFX_INLINE CXTPMarkupVisual* CXTPMarkupPanel::GetVisualChild(int nIndex) const {
  66. return m_pChildren->GetItem(nIndex);
  67. }
  68. AFX_INLINE CXTPMarkupUIElement* CXTPMarkupUIElementCollection::GetItem(int nIndex) const {
  69. return nIndex >= 0 && nIndex < m_arrItems.GetSize() ? (CXTPMarkupUIElement*)m_arrItems[nIndex] : NULL;
  70. }
  71. #endif // !defined(__XTPMARKUPPANEL_H__)