/** * @file XTPControlButton.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(__XTPCONTROLBUTTON_H__) # define __XTPCONTROLBUTTON_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPControlButton is a CXTPControl derived class. * It represents a button control. */ class _XTP_EXT_CLASS CXTPControlButton : public CXTPControl { public: /** * @brief * Constructs a CXTPControlButton object. */ CXTPControlButton(); /** * @brief * Destroys a CXTPControlButton object, handles cleanup and deallocation. */ virtual ~CXTPControlButton(); /** * @brief * Call this member to set the style of the button containing vector icon. * @param buttonStyle The style to be set. Can be any of the values listed in the Remarks * section. * @details * buttonStyle parameter can be one of the following: * xtpButtonAutomatic: Indicates the default style. * xtpButtonCaption: Indicates caption drawing only. * xtpButtonIcon: Indicates icon drawing only. * xtpButtonIconAndCaption: Indicates icon and caption drawing. */ void SetStyleEx(XTPButtonStyle buttonStyle); /** * @brief * Call this member to get the button's style containing vector icon. * @return * The style of the button. */ XTPButtonStyle GetStyleEx() const; public: /** * @brief * Either reads this object from or writes this object to an archive. * @param pPX A CXTPPropExchange object to serialize to or from. */ void DoPropExchange(CXTPPropExchange* pPX); protected: /** * @brief * This method is called when the user clicks the control. * @param bKeyboard TRUE if the control is selected using the keyboard. * @param pt Mouse cursor position. */ virtual void OnClick(BOOL bKeyboard = FALSE, CPoint pt = CPoint(0, 0)); /** * @brief * This member is called when the user releases the left mouse button. * @param point Specifies the x- and y- coordinate of the cursor. */ virtual void OnLButtonUp(CPoint point); /** * @brief * This method is called to copy the control. * @param pControl Points to a source CXTPControl object * @param bRecursive TRUE to copy recursively. */ virtual void Copy(CXTPControl* pControl, BOOL bRecursive = FALSE); XTPButtonStyle m_buttonStyleEx; /**< User-defined style of button containing vector icon. */ private: # ifdef _XTP_COMMANDBARS_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPControlButton) afx_msg XTPButtonStyle OleGetStyleEx(); afx_msg void OleSetStyleEx(XTPButtonStyle nStyle); enum { dispidStyle = 50L, }; /** @endcond */ # endif DECLARE_XTP_CONTROL(CXTPControlButton) }; ////////////////////////////////////////////////////////////////////////// /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPCONTROLBUTTON_H__) /** @endcond */