/** * @file XTPSyntaxEditToolTipCtrl.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(__XTPSYNTAXEDITTOOLTIPCTRL_H__) # define __XTPSYNTAXEDITTOOLTIPCTRL_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPSyntaxEditCtrl; // Internal class /** * @brief * The CXTPSyntaxEditToolTipCtrl class encapsulates the functionality of * a "tip control," a small pop-up window that displays a * single line of text describing the hidden text when hovering over * an item on the report area. * * CXTPSyntaxEditToolTipCtrl provides the functionality to control the * the tip text, the size of the tip window itself, and * the text font of the tip. * * This class is used by the Grid control internally. * @see * CXTPSyntaxEditCtrl */ class _XTP_EXT_CLASS CXTPSyntaxEditToolTipCtrl : public CWnd { // Construction public: /** * @brief * Constructs a CXTPSyntaxEditToolTipCtrl object. * @details * You construct a object object in two steps. First, call the constructor * object and then call Create, which initializes the window and attaches * it to the parent window. * * Example: * // Declare a local CXTPSyntaxEditToolTipCtrl object. * CXTPSyntaxEditToolTipCtrl wndTip; * * // Declare a dynamic CXTPSyntaxEditToolTipCtrl object. * CXTPSyntaxEditToolTipCtrl* pTipWnd = new CXTPSyntaxEditToolTipCtrl; * @see * Create, Activate */ CXTPSyntaxEditToolTipCtrl(); /** * @brief * Destroys a CXTPSyntaxEditToolTipCtrl object, handles cleanup and de-allocation. */ virtual ~CXTPSyntaxEditToolTipCtrl(); /** * @brief * Creates a smart edit tip window. * @param pParentWnd [in] Pointer to the parent Grid control window. * @return * TRUE if the tip window was created successfully, otherwise FALSE. * @see * CXTPSyntaxEditCtrl::ShowCollapsedToolTip */ virtual BOOL Create(CXTPSyntaxEditCtrl* pParentWnd); using CWnd::Create; /** * @brief * Sets the display delay, in milliseconds, for the tooltip. * @param nDelay [in] Display delay, in milliseconds, to be set. * @see * int GetDelay(); */ void SetDelay(int nDelay); /** * @brief * Gets the display delay, in milliseconds, of the tooltip. * @return * The display delay, in milliseconds, of the tooltip. * @see * void SetDelay(int nDelay); */ int GetDelay() const; /** * @brief * Hides the tooltip window. */ void Hide(); /** * @brief * Activates the tooltip window. * @param strText [in] Reference to the text to be shown * within the tooltip window. */ void Activate(const CString& strText); /** * @brief * Sets the coordinates of the tooltip hover rectangle. * @param rc [in] New tooltip hover rectangle in parent window coordinates. * @details * This method should be called before activating the tooltip window. * @see * GetHoverRect() */ void SetHoverRect(CRect rc); //{{AFX_VIRTUAL(CXTPSyntaxEditToolTipCtrl) //}}AFX_VIRTUAL protected: int m_nDelayTime; /**< Delay, in milliseconds, before showing the tooltip. */ CXTPSyntaxEditCtrl* m_pParentWnd; /**< Pointer to the parent report window. */ CRect m_rcHover; /**< Hover window coordinates. */ CString m_strToolTipText; /**< Tooltip text. */ //{{AFX_MSG(CXTPSyntaxEditToolTipCtrl) afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg void OnPaint(); afx_msg void OnTimer(UINT_PTR nIDEvent); //}}AFX_MSG /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ private: void ReCalcToolTipRect(); BOOL RegisterWindowClass(HINSTANCE hInstance = NULL); }; ///////////////////////////////////////////////////////////////////////////// AFX_INLINE void CXTPSyntaxEditToolTipCtrl::SetDelay(int nDelay) { m_nDelayTime = nDelay; } AFX_INLINE int CXTPSyntaxEditToolTipCtrl::GetDelay() const { return m_nDelayTime; } AFX_INLINE void CXTPSyntaxEditToolTipCtrl::SetHoverRect(CRect rc) { m_rcHover = rc; } ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPSYNTAXEDITTOOLTIPCTRL_H__) /** @endcond */