/** * @file XTPMarkupButtonBase.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(__XTPMARKUPBUTTONBASE_H__) # define __XTPMARKUPBUTTONBASE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPWinThemeWrapper; class CXTPMarkupDependencyProperty; class CXTPMarkupRoutedEvent; class CXTPMarkupMouseEventArgs; class CXTPMarkupMouseButtonEventArgs; class CXTPMarkupDispatchDelegate; /** * @brief * CXTPMarkupButtonBase is a CXTPMarkupContentControl derived class. * It implements a base class for the Button element. */ class _XTP_EXT_CLASS CXTPMarkupButtonBase : public CXTPMarkupContentControl { /** @cond */ DECLARE_MARKUPCLASS(CXTPMarkupButtonBase); /** @endcond */ protected: /** * @brief * Constructs a CXTPMarkupButtonBase object. */ CXTPMarkupButtonBase(); /** * @brief * Destroys a CXTPMarkupButtonBase object, handles cleanup and deallocation. */ ~CXTPMarkupButtonBase(); public: /** * @brief * Determines if the button is currently pressed. * @return * TRUE if the button is currently pressed. */ BOOL IsPressed() const; protected: /** * @brief * Virtual method called when the user clicks the button. */ virtual void OnClick(); /** @cond */ // Implementation protected: void OnMouseLeave(CXTPMarkupMouseEventArgs* e); void OnMouseEnter(CXTPMarkupMouseEventArgs* e); void OnMouseLeftButtonUp(CXTPMarkupMouseButtonEventArgs* e); void OnMouseLeftButtonDown(CXTPMarkupMouseButtonEventArgs* e); void OnLostMouseCapture(CXTPMarkupMouseEventArgs* e); protected: void SetPressed(BOOL bPressed); void UseParentBackground(HDC destHdc, HDC srcHdc, CRect srcRect) const; protected: BOOL m_bPushed; BOOL m_bMouseOver; CXTPWinThemeWrapper* m_themeButton; public: static CXTPMarkupDependencyProperty* m_pIsPressedProperty; static CXTPMarkupRoutedEvent* m_pClickEvent; /** @endcond */ /** @cond */ public: DECLARE_DISPATCH_MAP() # ifdef _XTP_ACTIVEX DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMarkupButtonBase); # endif afx_msg BOOL OleGetIsPressed(); afx_msg void OleSetIsPressed(BOOL bValue); afx_msg LPDISPATCH OleGetClickEvent(); afx_msg LPDISPATCH OleGetClick(); afx_msg void OleSetClick(LPDISPATCH pDisp); /** @endcond */ private: CXTPMarkupDispatchDelegate* m_pClick; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPMARKUPBUTTONBASE_H__) /** @endcond */