/**
* @file XTPCaptionPopupWnd.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(__XTPCAPTIONPOPUPWND_H__)
# define __XTPCAPTIONPOPUPWND_H__
/** @endcond */
# if _MSC_VER > 1000
# pragma once
# endif // _MSC_VER > 1000
# include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h"
/**
* @brief
* CXTPCaptionPopupWnd is a CWnd derived class. It is used by the CXTPCaption
* class to display a pop-up child window similar to Outlook(tm).
*/
class _XTP_EXT_CLASS CXTPCaptionPopupWnd : public CWnd
{
/** @cond */
DECLARE_DYNAMIC(CXTPCaptionPopupWnd)
/** @endcond */
public:
/**
* @brief
* Constructs a CXTPCaptionPopupWnd object.
*/
CXTPCaptionPopupWnd();
/**
* @brief
* Destroys a CXTPCaptionPopupWnd object, handles cleanup and deallocation.
*/
virtual ~CXTPCaptionPopupWnd();
public:
/**
* @brief
* This member function is called to create and display the pop-up window.
* @param rect A CRect reference that represents the size of the
* pop-up window.
* @param pParentWnd A CWnd pointer that represents the pop-up window.
* @param pChildWnd A CWnd pointer that represents the child to be
* displayed when the window is activated.
* @return
* TRUE if successful, otherwise FALSE.
*/
virtual BOOL Create(const CRect& rect, CWnd* pParentWnd, CWnd* pChildWnd);
/**
* @brief
* Call this member function to recalculate the layout of the
* caption and child window.
*/
virtual void RecalcLayout();
/**
* @brief
* Call this member function to reset the parent of the child
* window back to its default.
* @return
* TRUE if successful, otherwise FALSE.
*/
virtual BOOL ResetParent();
/**
* @brief
* Call this member function to send a cancel message that will
* cause the pop-up to close.
* @return
* TRUE if successful, otherwise FALSE.
*/
virtual BOOL SendCancelMessage();
/**
* @brief
* Call this member to switch the visual theme of the control.
* @param nTheme New visual theme. Can be any of the values listed in the Remarks section.
* @details
* nTheme can be one of the following:
* xtpControlThemeDefault: Standard appearance style.
* xtpControlThemeFlat: Flat appearance style.
* xtpControlThemeUltraFlat: Ultra flat appearance style.
* xtpControlThemeOffice2000: Office 2000 appearance style.
* xtpControlThemeOfficeXP: Office XP appearance style.
* xtpControlThemeOffice2003: Office 2003 appearance style.
* xtpControlThemeResource: Office 2007 appearance style.
* xtpControlThemeVisualStudio2012Light: VS 2012 Light style theme.
* xtpControlThemeVisualStudio2012Dark: VS 2012 Dark style theme.
*/
void SetTheme(XTPControlTheme nTheme);
protected:
/**
* @brief
* Call this member function to register the window class for
* the pop-up window.
* @return
* TRUE if successful, otherwise FALSE.
*/
BOOL RegisterWindowClass();
protected:
/** @cond */
DECLARE_MESSAGE_MAP()
//{{AFX_MSG(CXTPCaptionPopupWnd)
afx_msg void OnDestroy();
afx_msg void OnCaptButton();
afx_msg void OnPaint();
afx_msg void OnTimer(UINT_PTR nIDEvent);
//}}AFX_MSG
/** @endcond */
private:
BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect,
CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
CWnd* m_pParentWnd; /**< A CWnd pointer that represents the parent window. */
CWnd* m_pChildWnd; /**< A CWnd pointer that represents the child displayed in the pop-up. */
CWnd* m_pChildParent; /**< A CWnd pointer that represents the parent of the child window. */
CXTPCaption m_Caption; /**< Caption that is displayed when the window is active. */
CXTPCaptionButton m_CaptionButton; /**< Close button associated with the caption. */
CXTPIconHandle m_hIconOn; /**< Handle to a normal button icon. */
CXTPIconHandle m_hIconOff; /**< Handle to a pressed button icon. */
};
//////////////////////////////////////////////////////////////////////
/** @cond */
AFX_INLINE BOOL CXTPCaptionPopupWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID, CCreateContext* pContext)
{
return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
/** @endcond */
# include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h"
/** @cond */
#endif // #if !defined(__XTPCAPTIONPOPUPWND_H__)
/** @endcond */