// XTPMenuTitleBar.h : interface for the CXTPMenuTitleBar class. // // (c)1998-2023 Codejock Software, All Rights Reserved. // // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN // CONSENT OF CODEJOCK SOFTWARE. // // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A // SINGLE COMPUTER. // // CONTACT INFORMATION: // support@codejock.com // http://www.codejock.com // ///////////////////////////////////////////////////////////////////////////// //{{AFX_CODEJOCK_PRIVATE #if !defined(__XTPMENUTITLEBAR_H__) # define __XTPMENUTITLEBAR_H__ //}}AFX_CODEJOCK_PRIVATE # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCommandBars; //=========================================================================== // Summary: // CXTPMenuTitleBar is a CXTPMenuBar derived class. // It represents a menu bar of a frame window. //=========================================================================== class _XTP_EXT_CLASS CXTPMenuTitleBar : public CXTPMenuBar { public: //----------------------------------------------------------------------- // Summary: // Constructs a CXTPMenuTitleBar object. //----------------------------------------------------------------------- CXTPMenuTitleBar(); //----------------------------------------------------------------------- // Summary: // Destroys a CXTPMenuTitleBar object, handles cleanup and deallocation. //----------------------------------------------------------------------- ~CXTPMenuTitleBar(); //----------------------------------------------------------------------- // Summary: // Loads a menu from the resource. // Parameters: // nIDResource - Menu identifier to load. // Returns: // TRUE if successful, otherwise FALSE. //----------------------------------------------------------------------- virtual BOOL LoadMenuBar(UINT nIDResource); //----------------------------------------------------------------------- // Summary: // Call this member function to determine if the command bar is a // CXTPMenuTitleBar. // Returns: // TRUE if the command bar is a CXTPMenuTitleBar, otherwise FALSE. // See Also: // CXTPCommandBar, CXTPMenuTitleBar //----------------------------------------------------------------------- virtual BOOL IsMenuTitleBar() const; //----------------------------------------------------------------------- // Summary: // Call this method to update the system buttons of the menu bar. //----------------------------------------------------------------------- virtual void RefreshSysButtons(); //----------------------------------------------------------------------- // Summary: // This method calculates the dimensions of a toolbar. // Parameters: // nLength - Length of the bar. // dwMode - Mode to dock. // nWidth - Width of the bar. // Returns: // Size of the docked toolbar. //----------------------------------------------------------------------- virtual CSize CalcDockingLayout(int nLength, DWORD dwMode, int nWidth = 0); void RepositionCaptionButtons(CSize sz); void AddCaptionButton(int nId, BOOL bAdd, BOOL bEnabled, CRect& rcCaption); void RepositionCaptionText(CSize sz); void SetIconID(long id); private: CRect m_rcHeader; // Header bounding rectangle. CRect m_rcCaptionText; // Caption text bounding rectangle. CString m_strCaptionText; // Caption text. int m_nIconID; // ImageManager icon id protected: //{{AFX_CODEJOCK_PRIVATE DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPMenuTitleBar) afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); //}}AFX_MSG //}}AFX_CODEJOCK_PRIVATE # ifdef _XTP_COMMANDBARS_ACTIVEX //{{AFX_CODEJOCK_PRIVATE DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPMenuTitleBar); # endif private: DECLARE_XTP_COMMANDBAR(CXTPMenuTitleBar) }; AFX_INLINE BOOL CXTPMenuTitleBar::IsMenuTitleBar() const { return TRUE; } AFX_INLINE void CXTPMenuTitleBar::SetIconID(long id) { m_nIconID = id; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPMENUTITLEBAR_H__)