/** * @file XTPGridBehavior.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPGRIDBEHAVIOR_H__) # define __XTPGRIDBEHAVIOR_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * Defines a mouse button. */ enum XTPGridMouseButton { xtpGridMouseButtonNone, /**< No mouse button */ xtpGridMouseButtonLeft, /**< Specifies a left mouse button */ xtpGridMouseButtonMiddle, /**< Specifies a middle mouse button */ xtpGridMouseButtonRight /**< Specifies a right mouse button */ }; /** * @brief * Defines a mouse event. */ enum XTPGridMouseEvent { xtpGridMouseEventButtonDown, /**< Specifies a mouse button down mouse event */ xtpGridMouseEventButtonUp /**< Specifies a mouse button up event */ }; /** * @brief * Defines grid behavior. */ enum XTPGridBehavior { xtpGridBehaviorOutlook2003 = 0x00001100, /**< Specifies behavior similar to Outlook 2003 that was the default behavior of the control's version 11.0*/ xtpGridBehaviorOutlook2007 = 0x00001200, /**< Specifies behavior similar to Outlook 2007 that was the default behavior of the control's version 12.0*/ xtpGridBehaviorOutlook2010 = 0x00001400, /**< Specifies behavior similar to Outlook 2010 that was the default behavior of the control's version 14.0*/ xtpGridBehaviorExcel2003 = 0x10001100, /**< Specifies behavior similar to Excel 2003 that was the default behavior of the control's version 11.0*/ xtpGridBehaviorExcel2007 = 0x10001200, /**< Specifies behavior similar to Excel 2007 that was the default behavior of the control's version 12.0*/ xtpGridBehaviorExcel2010 = 0x10001400, /**< Specifies behavior similar to Excel 2010 that was the default behavior of the control's version 14.0*/ xtpGridBehaviorCodejock1340 = 0x20001340, /**< The default behavior of the control's version 13.4.0*/ xtpGridBehaviorCodejock1341 = 0x20001341, /**< The default behavior of the control's version 13.4.1*/ xtpGridBehaviorCodejock1342 = 0x20001342, /**< The default behavior of the control's version 13.4.2*/ xtpGridBehaviorCodejock1501 = 0x20001501, /**< The default behavior of the control's version 15.0.1*/ xtpGridBehaviorCodejock1502 = 0x20001502, /**< The default behavior of the control's version 15.0.2*/ xtpGridBehaviorCodejockDefault = 0x20000000 /**< The latest default behavior */ }; ///////////////////////////////////////////////////////////////////////////// // Key events ///////////////////////////////////////////////////////////////////////////// class _XTP_EXT_CLASS CXTPGridBehaviorRowKeyDown { }; class _XTP_EXT_CLASS CXTPGridBehaviorRowKeyUp { }; ///////////////////////////////////////////////////////////////////////////// // Mouse events ///////////////////////////////////////////////////////////////////////////// class _XTP_EXT_CLASS CXTPGridBehaviorRowModifier : public CXTPCmdTarget { public: CXTPGridBehaviorRowModifier(); void Reset(); BOOL bFocusRow; /**< TRUE if the row gets focus. */ BOOL bFocusRowTemporarily; /**< TRUE if the row gets focus temporarily. */ BOOL bSelectRow; /**< TRUE if the row gets selected. */ BOOL bSelectRowTemporarily; /**< TRUE if the row gets selected temporarily. */ BOOL bMultipleSelection; /**< TRUE to enable multiple selection. */ BOOL bKeepSelection; /**< TRUE if multiple rows stay selected. */ BOOL bKeepFocus; /**< TRUE if rows remain drawn as focused. */ BOOL bFocusCancelsSelect; /**< bFocusCancelsSelect. */ protected: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_OLETYPELIB_EX(CXTPGridBehaviorRowModifier); DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() XTP_DECLARE_PROPERTY(FocusRow, BOOL); XTP_DECLARE_PROPERTY(FocusRowTemporarily, BOOL); XTP_DECLARE_PROPERTY(SelectRow, BOOL); XTP_DECLARE_PROPERTY(SelectRowTemporarily, BOOL); XTP_DECLARE_PROPERTY(MultipleSelection, BOOL); XTP_DECLARE_PROPERTY(KeepSelection, BOOL); XTP_DECLARE_PROPERTY(KeepFocus, BOOL); /** @endcond */ # endif // _XTP_ACTIVEX }; class _XTP_EXT_CLASS CXTPGridBehaviorRowMouseButton : public CXTPCmdTarget { public: CXTPGridBehaviorRowMouseButton(XTPGridMouseButton button, XTPGridMouseEvent event); virtual ~CXTPGridBehaviorRowMouseButton(); void Reset(); public: CXTPGridBehaviorRowModifier* None; CXTPGridBehaviorRowModifier* Control; CXTPGridBehaviorRowModifier* Shift; BOOL bFocusColumn; /**< TRUE if the column gets the focus. */ BOOL bEnsureVisible; /**< TRUE if the row gets visible. */ BOOL bClick; /**< TRUE if a click event is to be triggered for the mouse button. */ BOOL bContextMenu; /**< TRUE if OnContextMenu/NM_RCLICK gets called. */ BOOL bCheckSelectedRows; /**< TRUE to check selected rows by using the mouse button. */ BOOL bDragBegin; /**< TRUE to begin drag. */ BOOL bDragEnd; /**< TRUE to end drag. */ BOOL bDragSelectGroup; /**< TRUE to select the entire group on drag. */ public: const XTPGridMouseButton m_button; const XTPGridMouseEvent m_event; protected: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridBehaviorRowMouseButton); afx_msg LPDISPATCH OleGetNone(); afx_msg LPDISPATCH OleGetControl(); afx_msg LPDISPATCH OleGetShift(); XTP_DECLARE_PROPERTY(FocusColumn, BOOL); XTP_DECLARE_PROPERTY(EnsureVisible, BOOL); XTP_DECLARE_PROPERTY(Click, BOOL); XTP_DECLARE_PROPERTY(ContextMenu, BOOL); XTP_DECLARE_PROPERTY(CheckSelectedRows, BOOL); XTP_DECLARE_PROPERTY(DragBegin, BOOL); XTP_DECLARE_PROPERTY(DragEnd, BOOL); XTP_DECLARE_PROPERTY(DragSelectGroup, BOOL); /** @endcond */ # endif // _XTP_ACTIVEX }; class _XTP_EXT_CLASS CXTPGridBehaviorRowMouse : public CXTPCmdTarget { public: CXTPGridBehaviorRowMouse(XTPGridMouseEvent event); virtual ~CXTPGridBehaviorRowMouse(); CXTPGridBehaviorRowMouseButton* Left; CXTPGridBehaviorRowMouseButton* Right; protected: # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridBehaviorRowMouse); afx_msg LPDISPATCH OleGetLeft(); afx_msg LPDISPATCH OleGetRight(); /** @endcond */ # endif // _XTP_ACTIVEX }; class _XTP_EXT_CLASS CXTPGridBehaviorRow : public CXTPCmdTarget { public: CXTPGridBehaviorRow(); virtual ~CXTPGridBehaviorRow(); public: CXTPGridBehaviorRowMouse* MouseDown; CXTPGridBehaviorRowMouse* MouseUp; # ifdef _XTP_ACTIVEX protected: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridBehaviorRow); afx_msg LPDISPATCH OleGetMouseDown(); afx_msg LPDISPATCH OleGetMouseUp(); /** @endcond */ # endif // _XTP_ACTIVEX }; ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // class _XTP_EXT_CLASS CXTPGridNotificationsPopulate : public CXTPCmdTarget { public: CXTPGridNotificationsPopulate(); virtual ~CXTPGridNotificationsPopulate(); public: BOOL bFocusChanging; BOOL bSelectionChanging; BOOL bSelectionChanged; # ifdef _XTP_ACTIVEX protected: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridNotificationsPopulate); XTP_DECLARE_PROPERTY(FocusChangingNotification, BOOL); XTP_DECLARE_PROPERTY(SelectionChangingNotification, BOOL); XTP_DECLARE_PROPERTY(SelectionChangedNotification, BOOL); /** @endcond */ # endif // _XTP_ACTIVEX }; class _XTP_EXT_CLASS CXTPGridNotificationsSelectedRows : public CXTPCmdTarget { public: CXTPGridNotificationsSelectedRows(); virtual ~CXTPGridNotificationsSelectedRows(); public: BOOL bClear; BOOL bAdd; BOOL bRemove; # ifdef _XTP_ACTIVEX protected: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridNotificationsSelectedRows); XTP_DECLARE_PROPERTY(ClearNotification, BOOL); XTP_DECLARE_PROPERTY(AddNotification, BOOL); XTP_DECLARE_PROPERTY(RemoveNotification, BOOL); /** @endcond */ # endif // _XTP_ACTIVEX }; class _XTP_EXT_CLASS CXTPGridNotificationsRow : public CXTPCmdTarget { public: CXTPGridNotificationsRow(); virtual ~CXTPGridNotificationsRow(); public: BOOL bRowExpanded; # ifdef _XTP_ACTIVEX protected: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridNotificationsRow); XTP_DECLARE_PROPERTY(RowExpandedNotification, BOOL); /** @endcond */ # endif // _XTP_ACTIVEX }; class _XTP_EXT_CLASS CXTPGridNotifications : public CXTPCmdTarget { public: CXTPGridNotifications(); virtual ~CXTPGridNotifications(); public: CXTPGridNotificationsPopulate* Populate; CXTPGridNotificationsSelectedRows* SelectedRows; CXTPGridNotificationsRow* Row; # ifdef _XTP_ACTIVEX protected: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridNotifications); afx_msg LPDISPATCH OleGetPopulate(); afx_msg LPDISPATCH OleGetSelectedRows(); afx_msg LPDISPATCH OleGetRow(); /** @endcond */ # endif // _XTP_ACTIVEX }; class _XTP_EXT_CLASS CXTPGridBehavior : public CXTPCmdTarget { public: CXTPGridBehavior(XTPGridBehavior behavior); virtual ~CXTPGridBehavior(); void SetScheme(XTPGridBehavior behavior); public: CXTPGridBehaviorRow* Row; CXTPGridBehaviorRow* GroupRow; CXTPGridNotifications* Notifications; private: void SetSchemeOutlook(); void SetSchemeExcel(); void SetSchemeCodejock134x(); void SetSchemeCodejock1501(); void SetSchemeCodejock1502(); void SetSchemeCodejockDefault(); XTPGridBehavior m_scheme; /**< The last set scheme. */ # ifdef _XTP_ACTIVEX protected: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPGridBehavior); XTP_DECLARE_PROPERTY(Scheme, XTPGridBehavior); afx_msg LPDISPATCH OleGetRow(); afx_msg LPDISPATCH OleGetGroupRow(); afx_msg LPDISPATCH OleGetNotifications(); /** @endcond */ # endif // _XTP_ACTIVEX }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPGRIDBEHAVIOR_H__) /** @endcond */