/** * @file XTPSkinObjectButton.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(_XTPSKINOBJECTBUTTON_H__) # define _XTPSKINOBJECTBUTTON_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPSkinObjectButton is a CXTPSkinObjectFrame derived class. * It implements standard buttons. */ class _XTP_EXT_CLASS CXTPSkinObjectButton : public CXTPSkinObjectFrame { /** @cond */ DECLARE_DYNCREATE(CXTPSkinObjectButton) /** @endcond */ public: /** * @brief * Constructs a CXTPSkinObjectButton object. */ CXTPSkinObjectButton(); /** * @brief * Destroys a CXTPSkinObjectButton object, handles cleanup and deallocation. */ virtual ~CXTPSkinObjectButton(); protected: /** @cond */ BOOL OnHookMessage(UINT nMessage, WPARAM& wParam, LPARAM& lParam, LRESULT& lResult); void OnSkinChanged(BOOL bPrevState, BOOL bNewState); BOOL OnHookDefWindowProc(UINT nMessage, WPARAM& wParam, LPARAM& lParam, LRESULT& lResult); BOOL IsDefWindowProcAvail(int nMessage) const; protected: virtual void OnDraw(CDC* pDC, CRect rc); BOOL IsPushButton(); DWORD GetAlignment(); void CalcRect(CDC* pDC, LPRECT lprc, int code); void ButtonDrawCheck(CDC* pDC); CSize GetGlyphSize(BOOL bCheckBox); void DrawButtonText(CDC* pDC, int nPart, int nState); BYTE GetButtonStyle(); void OnDraw(CDC* pDC); protected: DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPSkinObjectButton) //}}AFX_VIRTUAL //{{AFX_MSG(CXTPSkinObjectButton) afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnSetFocus(CWnd* pOldWnd); afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnPaint(); afx_msg LRESULT OnSetState(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); afx_msg void OnMouseLeave(); afx_msg void OnInvalidate(); afx_msg void OnDefaultAndInvalidate(); afx_msg LRESULT OnUpdateUIState(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnPrintClient(WPARAM wParam, LPARAM lParam); //}}AFX_MSG /** @endcond */ public: BYTE m_bStyle; /**< Custom style of button. */ protected: BOOL m_bHot; /**< TRUE if mouse under button. */ BOOL m_bPushed; /**< TRUE if button was pressed. */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(_XTPSKINOBJECTBUTTON_H__) /** @endcond */