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

对话框与窗口

开发平台:

Visual C++

  1. // XTPMarkupKeyboardNavigation.h: interface for the CXTPMarkupKeyboardNavigation 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(__XTPMMARKUPKEYBOARDNAVIGATION_H__)
  21. #define __XTPMMARKUPKEYBOARDNAVIGATION_H__
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif // _MSC_VER > 1000
  25. class CXTPMarkupInputElement;
  26. class CXTPMarkupContext;
  27. #include "XTPMarkupObject.h"
  28. enum XTPMarkupFocusNavigationDirection
  29. {
  30. xtpMarkupFocusNavigationDirectionNext,
  31. xtpMarkupFocusNavigationDirectionPrevious,
  32. xtpMarkupFocusNavigationDirectionFirst,
  33. xtpMarkupFocusNavigationDirectionLast,
  34. xtpMarkupFocusNavigationDirectionLeft,
  35. xtpMarkupFocusNavigationDirectionRight,
  36. xtpMarkupFocusNavigationDirectionUp,
  37. xtpMarkupFocusNavigationDirectionDown
  38. };
  39. enum XTPMarkupKeyboardNavigationMode
  40. {
  41. xtpMarkupKeyboardNavigationContinue,
  42. xtpMarkupKeyboardNavigationOnce,
  43. xtpMarkupKeyboardNavigationCycle,
  44. xtpMarkupKeyboardNavigationNone,
  45. xtpMarkupKeyboardNavigationContained,
  46. xtpMarkupKeyboardNavigationLocal
  47. };
  48. class _XTP_EXT_CLASS CXTPMarkupKeyboardNavigation : public CXTPMarkupObject
  49. {
  50. DECLARE_MARKUPCLASS(CXTPMarkupKeyboardNavigation)
  51. protected:
  52. CXTPMarkupKeyboardNavigation(CXTPMarkupContext* pContext = NULL);
  53. virtual ~CXTPMarkupKeyboardNavigation();
  54. public:
  55. static XTPMarkupKeyboardNavigationMode AFX_CDECL GetTabNavigation(CXTPMarkupObject* pElement);
  56. public:
  57. static CXTPMarkupObject* AFX_CDECL ConvertKeyboardNavigationMode(CXTPMarkupContext* pContext, CXTPMarkupObject* pObject);
  58. public:
  59. void ProcessInput(UINT nChar);
  60. void Focus(CXTPMarkupInputElement* pInputElement);
  61. protected:
  62. BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
  63. protected:
  64. void Navigate(CXTPMarkupInputElement* pSourceElement, UINT nChar);
  65. void Navigate(CXTPMarkupInputElement* pSourceElement, XTPMarkupFocusNavigationDirection direction);
  66. private:
  67. CXTPMarkupObject* GetGroupParent(CXTPMarkupObject* e, BOOL bIncludeCurrent = FALSE);
  68. CXTPMarkupObject* GetParent(CXTPMarkupObject* e);
  69. BOOL IsInNavigationTree(CXTPMarkupObject* pVisual);
  70. XTPMarkupKeyboardNavigationMode GetKeyNavigationMode(CXTPMarkupObject* pElement);
  71. BOOL IsGroup(CXTPMarkupObject* e);
  72. CXTPMarkupObject* GetNextTab(CXTPMarkupObject* e, CXTPMarkupObject* pContainer, BOOL goDownOnly);
  73. BOOL IsTabStop(CXTPMarkupObject* e);
  74. CXTPMarkupObject* GetTabOnceActiveElement(CXTPMarkupObject* d);
  75. CXTPMarkupObject* GetActiveElement(CXTPMarkupObject* d);
  76. CXTPMarkupObject* GetNextTabInGroup(CXTPMarkupObject* e, CXTPMarkupObject* container, XTPMarkupKeyboardNavigationMode tabbingType);
  77. CXTPMarkupObject* GetFirstTabInGroup(CXTPMarkupObject* container);
  78. BOOL IsTabStopOrGroup(CXTPMarkupObject* e);
  79. CXTPMarkupObject* GetNextInTree(CXTPMarkupObject* e, CXTPMarkupObject* container);
  80. CXTPMarkupObject* GetNextTabWithSameIndex(CXTPMarkupObject* e, CXTPMarkupObject* container);
  81. CXTPMarkupObject* GetNextTabWithNextIndex(CXTPMarkupObject* e, CXTPMarkupObject* container, XTPMarkupKeyboardNavigationMode tabbingType);
  82. int GetTabIndexHelper(CXTPMarkupObject* d);
  83. CXTPMarkupObject* FocusedElement(CXTPMarkupObject* e);
  84. CXTPMarkupObject* GetTreeFirstChild(CXTPMarkupObject* e);
  85. CXTPMarkupObject* GetTreeNextSibling(CXTPMarkupObject* e);
  86. public:
  87. static CXTPMarkupDependencyProperty* m_pIsTabStopProperty;
  88. static CXTPMarkupDependencyProperty* m_pTabNavigationProperty;
  89. static CXTPMarkupDependencyProperty* m_pTabIndexProperty;
  90. protected:
  91. CXTPMarkupInputElement* m_pFocused;
  92. CXTPMarkupInputElement* m_pLastFocused;
  93. CXTPMarkupContext* m_pMarkupContext;
  94. CXTPMarkupDependencyProperty* m_pNavigationProperty;
  95. private:
  96. friend class CXTPMarkupContext;
  97. };
  98. #endif // !defined(__XTPMMARKUPKEYBOARDNAVIGATION_H__)