/** * @file XTPPasswordPeek.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(__XTPPASSWORDPEEK_H__) # define __XTPPASSWORDPEEK_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPPasswordPeek is a CXTPEdit derived class. */ class _XTP_EXT_CLASS CXTPPasswordPeek : public CXTPEdit { /** @cond */ DECLARE_DYNAMIC(CXTPPasswordPeek) /** @endcond */ public: /** * @brief * Constructs a CXTPPasswordPeek object. */ CXTPPasswordPeek(); /** * @brief * Destroys a CXTPPasswordPeek object, handles cleanup and deallocation. */ virtual ~CXTPPasswordPeek(); /** * @brief * Call this method to retrieve the image manager. * @return * A pointer to a CXTPImageManager object. */ CXTPImageManager* GetImageManager(); /** * @brief * Call this member to set the specified image manager. * @param pImageManager Pointer to a CXTPImageManager object to be set. */ void SetImageManager(CXTPImageManager* pImageManager); /** * @brief * Call this member to enable or disable peek button. * @param bEnable TRUE to enable the item, FALSE to disable the item. * @see * IsPeekButtonEnabled */ void PeekButtonEnable(BOOL bEnable = TRUE); /** * @brief * Call this member to get the state of the peek button. * @return * TRUE if the item is enabled, otherwise FALSE. */ BOOL IsPeekButtonEnabled(); /** * @brief * This member function is used to icons initialization. */ virtual void InitIcons(); /** * @brief * This method is used to draw the peek button. * @param pDC Pointer to a valid device context. * @param rect Rect of peek button. * @param bIsButtonPressed TRUE if peek button pressed. * @param bIsButtonHot TRUE if peek button hot. */ virtual void OnDrawButton(CDC* pDC, CRect rect, BOOL bIsButtonPressed, BOOL bIsButtonHot); /** * @brief * This method is used to configure peek button layout. */ virtual void OnChangeLayout(); protected: enum PasswordPeekMode { PasswordPeekModeEnabled, PasswordPeekModeDisabled, }; int m_nButtonWidth; BOOL m_bIsButtonPressed; BOOL m_bIsButtonHighlighted; BOOL m_bIsButtonCaptured; CRect m_rectBtn; CSize m_sizeImage; PasswordPeekMode m_Mode; CXTPImageManager* m_pImageManager; afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); afx_msg void OnNcPaint(); afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnCancelMode(); DECLARE_MESSAGE_MAP() }; /** @cond */ AFX_INLINE CXTPImageManager* CXTPPasswordPeek::GetImageManager() { return m_pImageManager; } AFX_INLINE void CXTPPasswordPeek::SetImageManager(CXTPImageManager* pImageManager) { m_pImageManager = pImageManager; } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // #if !defined(__XTPPASSWORDPEEK_H__) /** @endcond */