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

对话框与窗口

开发平台:

Visual C++

  1. // XTPRibbonBar.h: interface for the CXTPRibbonBar class.
  2. //
  3. // This file is a part of the XTREME RIBBON 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. //{{AFX_CODEJOCK_PRIVATE
  21. #if !defined(__XTPRIBBONPOPUPS_H__)
  22. #define __XTPRIBBONPOPUPS_H__
  23. //}}AFX_CODEJOCK_PRIVATE
  24. #if _MSC_VER > 1000
  25. #pragma once
  26. #endif // _MSC_VER > 1000
  27. class CXTPRibbonTheme;
  28. class CXTPRibbonQuickAccessControls;
  29. class CXTPRibbonTab;
  30. class CXTPRibbonControlTab;
  31. class CXTPTabPaintManager;
  32. class CXTPRibbonBar;
  33. class CXTPRibbonGroup;
  34. class CXTPOffice2007FrameHook;
  35. class CXTPRibbonTabContextHeaders;
  36. class CXTPRibbonGroups;
  37. #include "CommandBars/XTPControls.h"
  38. #include "CommandBars/XTPMenuBar.h"
  39. #include "CommandBars/XTPPopupBar.h"
  40. class CXTPRibbonScrollableBar
  41. {
  42. public:
  43. CXTPRibbonScrollableBar();
  44. private:
  45. class CControlGroupsScroll;
  46. protected:
  47. void InitScrollableBar(CXTPCommandBar* pParent);
  48. void ShowScrollableRect(CXTPRibbonGroups* pGroups, CRect rc);
  49. public:
  50. void EnableGroupsScroll(BOOL bScrollLeft, BOOL bScrollRight);
  51. virtual void OnGroupsScroll(BOOL bScrollLeft) = 0;
  52. virtual CRect GetGroupsRect() const = 0;
  53. virtual CXTPRibbonGroup* HitTestGroup(CPoint point) const = 0;
  54. void CreateGroupKeyboardTips(CXTPRibbonTab* pSelectedTab);
  55. //-----------------------------------------------------------------------
  56. // Summary:
  57. //     Call this method to get highlighted group
  58. // Returns:
  59. //     CXTPRibbonGroup object under mouse cursor
  60. // See Also: CXTPRibbonGroup
  61. //-----------------------------------------------------------------------
  62. CXTPRibbonGroup* GetHighlightedGroup() const;
  63. void HighlightGroup(CXTPRibbonGroup* pHighlightedGroup);
  64. protected:
  65. void CreateControlKeyboardTips(CXTPControl* pControl, LPCTSTR lpszPrefix, BOOL bVisible);
  66. BOOL ProcessSpecialKey(XTPSpecialKey key);
  67. CRect _GetBoundRect(CXTPControl* pControl, BOOL bSelected, XTPSpecialKey key);
  68. public:
  69. int m_nGroupsScrollPos;         // Groups scroll position
  70. protected:
  71. CXTPCommandBar* m_pParent;
  72. CXTPControl* m_pControlScrollGroupsLeft;    // Control to draw left scroll
  73. CXTPControl* m_pControlScrollGroupsRight;   // Control to draw right scroll
  74. CXTPRibbonGroup* m_pHighlightedGroup;       // Currently highlighted group
  75. };
  76. CXTPRibbonScrollableBar* AFX_CDECL GetScrollableBar(CXTPCommandBar* pCommandBar);
  77. //{{AFX_CODEJOCK_PRIVATE
  78. class _XTP_EXT_CLASS CXTPRibbonTabPopupToolBar : public CXTPPopupToolBar, public CXTPRibbonScrollableBar
  79. {
  80. DECLARE_DYNAMIC(CXTPRibbonTabPopupToolBar)
  81. public:
  82. CXTPRibbonTabPopupToolBar(CXTPRibbonTab* pRibbonTab);
  83. ~CXTPRibbonTabPopupToolBar();
  84. public:
  85. CRect GetGroupsRect() const;
  86. void OnGroupsScroll(BOOL bScrollLeft);
  87. void EnsureVisible(CXTPControl* pControl);
  88. void CreateKeyboardTips();
  89. CSize CalcDynamicLayout(int, DWORD /*nMode*/);
  90. void DrawCommandBar(CDC* pDC, CRect rcClipBox);
  91. virtual CSize GetButtonSize() const;
  92. virtual CSize GetIconSize() const;
  93. virtual CRect CalculatePopupRect(CPoint ptPopup, CSize sz);
  94. CXTPRibbonGroup* HitTestGroup(CPoint point) const;
  95. virtual BOOL SetTrackingMode(int bMode, BOOL bSelectFirst = TRUE, BOOL bKeyboard = FALSE);
  96. void OnKeyboardTip(CXTPCommandBarKeyboardTip* pTip);
  97. BOOL IsKeyboardCuesVisible() const;
  98. INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
  99. protected:
  100. void OnMouseMove(UINT nFlags, CPoint point);
  101. afx_msg void OnMouseLeave();
  102. virtual BOOL ProcessSpecialKey(XTPSpecialKey key);
  103. DECLARE_MESSAGE_MAP()
  104. public:
  105. CXTPRibbonTab* m_pRibbonTab;
  106. CXTPRibbonBar* m_pRibbonBar;
  107. CRect m_rcGroups;
  108. };
  109. class CXTPRibbonBarMorePopupToolBar : public CXTPPopupToolBar
  110. {
  111. DECLARE_DYNAMIC(CXTPRibbonBarMorePopupToolBar)
  112. public:
  113. CXTPRibbonBarMorePopupToolBar(CXTPRibbonBar* pRibbonBar);
  114. public:
  115. void FillCommandBarEntry(CDC* pDC);
  116. CSize GetIconSize() const;
  117. CSize GetButtonSize() const;
  118. public:
  119. CXTPRibbonBar* m_pRibbonBar;
  120. };
  121. class CXTPRibbonGroupPopupToolBar : public CXTPPopupToolBar, public CXTPRibbonScrollableBar
  122. {
  123. DECLARE_XTP_COMMANDBAR(CXTPRibbonGroupPopupToolBar)
  124. public:
  125. CXTPRibbonGroupPopupToolBar(CXTPRibbonGroup* pRibbonGroup = NULL);
  126. ~CXTPRibbonGroupPopupToolBar();
  127. public:
  128. CSize CalcDynamicLayout(int, DWORD /*nMode*/);
  129. void DrawCommandBar(CDC* pDC, CRect rcClipBox);
  130. void CreateKeyboardTips();
  131. CSize GetIconSize() const;
  132. CSize GetButtonSize() const;
  133. virtual void OnGroupsScroll(BOOL bScrollLeft);
  134. virtual CRect GetGroupsRect() const;
  135. virtual BOOL SetTrackingMode(int bMode, BOOL bSelectFirst = TRUE, BOOL bKeyboard = FALSE);
  136. virtual CXTPRibbonGroup* HitTestGroup(CPoint point) const;
  137. BOOL IsKeyboardCuesVisible() const;
  138. protected:
  139. void OnMouseMove(UINT nFlags, CPoint point);
  140. afx_msg void OnMouseLeave();
  141. virtual BOOL ProcessSpecialKey(XTPSpecialKey key);
  142. DECLARE_MESSAGE_MAP()
  143. public:
  144. CXTPRibbonGroup* m_pRibbonGroup;
  145. CXTPRibbonBar* m_pRibbonBar;
  146. CXTPRibbonGroup* m_pParentGroup;
  147. };
  148. //}}AFX_CODEJOCK_PRIVATE
  149. #endif // !defined(__XTPRIBBONPOPUPS_H__)