/** * @file XTPCommandBarsDefines.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(__XTPCOMMANDBARDEFINES_H__) # define __XTPCOMMANDBARDEFINES_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPControl; class CXTPCommandBar; class CXTPPopupBar; /** * @brief * Position of the command bar. * * Example: *
 * CXTPToolBar* pToolBar = pCommandBars->Add("ToolBar", xtpBarTop);
 * pToolBar->SetPosition(xtpBarBottom);
 * 
* @see * CXTPCommandBars, CXTPToolBar, CXTPToolBar::SetPosition, * xtpBarTop, xtpBarBottom, xtpBarLeft, xtpBarRight, xtpBarFloating, xtpBarPopup, * xtpBarListBox, xtpBarNone */ enum XTPBarPosition { xtpBarTop = 0, /**< Docked at top.*/ xtpBarBottom = 1, /**< Docked at bottom.*/ xtpBarLeft = 2, /**< Docked at left.*/ xtpBarRight = 3, /**< Docked at right.*/ xtpBarFloating = 4, /**< Floated.*/ xtpBarPopup = 5, /**< Pop-up.*/ xtpBarListBox = 6, /**< List box.*/ xtpBarNone = 7 /**< None.*/ }; /** * @brief * Type of the command bar. * * Example: *
 * CXTPCommandBar* pMenuBar = pCommandBars->GetMenuBar();
 * _ASSERTE(pMenuBar->GetType() == xtpBarTypeMenuBar);
 * 
* @see C * XTPCommandBars, CXTPCommandBar, CXTPCommandBar::GetType, * xtpBarTypeMenuBar, xtpBarTypePopup */ enum XTPBarType { xtpBarTypeMenuBar, /**< Command bar is a CXTPMenuBar.*/ xtpBarTypeNormal, /**< Command bar is a CXTPToolBar.*/ xtpBarTypePopup, /**< Command bar is a CXTPPopupBar.*/ xtpBarTypeRibbon /**< Command bar is a CXTPRibbonBar.*/ }; /** * @brief * Command bar text orientation flags. * @see * CXTPCommandBar::m_nTextOrientation */ enum XTPBarTextOrientation { xtpBarTextAuto, /**< Lets the Commandbars decide the best orientation. Horizontal bars will display text horizontally and vertical bars will display text vertically.*/ xtpBarTextVertical, /**< Display text in the bar vertically, regardless of bar location.*/ xtpBarTextHorizontal /**< Display text in the bar horizontally, regardless of bar location.*/ }; /** * @brief * Type of the control. * * Example: *
pToolBar->GetControls()->Add(xtpControlButton, ID_FILE_NEW);
* @see * CXTPControl, CXTPControl::GetType, CXTPControls, * xtpControlError, xtpControlButton, xtpControlPopup, xtpControlButtonPopup, * xtpControlSplitButtonPopup, xtpControlComboBox, xtpControlEdit, xtpControlCustom, * xtpControlLabel */ enum XTPControlType { xtpControlError, /**< Type is not defined. */ xtpControlButton, /**< Button type. */ xtpControlPopup, /**< Pop-up type. */ xtpControlButtonPopup, /**< Button pop-up. */ xtpControlSplitButtonPopup, /**< Split button pop-up. */ xtpControlComboBox, /**< Combobox button. */ xtpControlEdit, /**< Edit control. */ xtpControlCustom, /**< Custom control. */ xtpControlLabel, /**< Label control. */ xtpControlCheckBox, /**< CheckBox control. */ xtpControlGallery, /**< Gallery control. */ xtpControlRadioButton /**< Radio Button control.*/ }; /** * @brief * Flags of the control. * * Example: *
pControl->SetFlags(xtpFlagRightAlign);
* @see * CXTPControl, CXTPControl::SetFlags, * xtpFlagRightAlign, xtpFlagSkipFocus, xtpFlagLeftPopup, xtpFlagManualUpdate, * xtpFlagNoMovable, xtpFlagControlStretched */ enum XTPControlFlags { xtpFlagRightAlign = 1, /**< Control is right aligned. */ xtpFlagSkipFocus = 2, /**< Control does not have focus. */ xtpFlagLeftPopup = 4, /**< To Pop up child bar left. */ xtpFlagManualUpdate = 8, /**< Control is manually updated. */ xtpFlagNoMovable = 16, /**< To disable customization. */ xtpFlagControlStretched = 32, /**< Control is stretched in parent command bar. */ xtpFlagShowPopupBarTip = 64, /**< Show tooltip always */ xtpFlagWrapRow = 128, /**< Wrap row for toolbar or pop-up bar. */ xtpFlagRibbonTabBackground = 256 /**< Control is on the right side of Ribbon tabs. */ }; /** * @brief * Control's hide flags, these are flags that specify why a control is hidden. * * Example: *
pControl->SetHideFlags(xtpHideGeneric);
* @see * CXTPControl, CXTPControl::SetHideFlags, * xtpNoHide, xtpHideGeneric, xtpHideWrap, xtpHideDockingPosition, xtpHideScroll, * xtpHideCustomize, xtpHideExpand, xtpHideDocTemplate */ enum XTPControlHideFlags { xtpNoHide = 0, /**< Control is visible.*/ xtpHideGeneric = 1, /**< Control is hidden by generic reason. Developer set Visible = FALSE.*/ xtpHideWrap = 2, /**< Control is hidden by wrap. Toolbar is too small and the control is wrapped.*/ xtpHideDockingPosition = 4, /**< Control is hidden by docking position. If a toolbar has a combobox or edit control, when the toolbar is docked in the left or in the right side of frame, the Commandbar ComboBox and Edit controls becomes hidden.*/ xtpHideScroll = 8, /**< Control is hidden by scrolling. There are too many controls in a pop-up and the control is hidden because the pop-up is scrolled*/ xtpHideCustomize = 16, /**< Control is hidden by customize settings. User removed it. This only possible when customization is enabled. This flag is set if the user removes the control from the Add and Remove Buttons pop-up menu.*/ xtpHideExpand = 32, /**< If the control is rarely used and it is not visible because the intelligent menus option on and the command is a hidden command.*/ xtpHideDocTemplate = 64, /**< Control is hidden because active template excluded from its list.*/ xtpHideRibbonTab = 128 /**< Control is hidden because inactive ribbon tab.*/ }; /** * @brief * Button's styles. * @details * This styles can be applied to CXTPControlButton and CXTPControlPopup derived classes. * * Example: *
pControl->SetStyle(xtpButtonIconAndCaption);
* @see * CXTPControlButton, CXTPControl::SetStyle, CXTPControl::GetStyle, * xtpButtonAutomatic, xtpButtonCaption, xtpButtonIcon, xtpButtonIconAndCaption */ enum XTPButtonStyle { xtpButtonUndefined = -1, /**< Automatic style. */ xtpButtonAutomatic = 0, /**< Automatic style. */ xtpButtonCaption = 1, /**< Button draw only caption. */ xtpButtonIcon = 2, /**< Button draw only icon. */ xtpButtonIconAndCaption = 3, /**< Button draw icon and caption. */ xtpButtonIconAndCaptionBelow = 4, /**< Button draw icon and draw caption below icon. */ xtpButtonCaptionAndDescription = 5 /**< Button draw icon, caption and description for pop-up bar. */ }; /** * @brief * Deprecated style for Combo control. */ # define xtpComboNormal xtpButtonAutomatic /** * @brief * Deprecated style for Combo control. */ # define xtpComboLabel xtpButtonCaption /** * @brief * Paint themes used by command bars. * * Example: *
XTPPaintManager()->SetTheme(xtpThemeVisualStudio2005);
* @see * CXTPCommandBars, CXTPPaintManager, * xtpThemeOfficeXP, xtpThemeOffice2000, xtpThemeOffice2003, xtpThemeNativeWinXP, * xtpThemeVisualStudio2005, xtpThemeCustom */ enum XTPPaintTheme { xtpThemeNone = -1, /**< No theme selected. */ xtpThemeOffice2000 = 0, /**< Office 2000 theme. */ xtpThemeOfficeXP = 1, /**< Office XP theme. */ xtpThemeOffice2003 = 2, /**< Office 2003 theme. */ xtpThemeNativeWinXP = 3, /**< Windows XP and later native theme support.*/ xtpThemeVisualStudio2005 = 4, /**< Visual Studio 2005 theme. */ xtpThemeResource = 5, /**< Office 2007 theme. */ xtpThemeRibbon = 6, /**< Office 2007 style ribbon theme. */ xtpThemeVisualStudio2008 = 7, /**< Visual Studio 2008 theme. */ xtpThemeVisualStudio6 = 8, /**< Visual Studio 6 theme. */ xtpThemeVisualStudio2010 = 9, /**< Visual Studio 2010 theme. */ xtpThemeCustom = 10, /**< Custom theme. */ xtpThemeOffice2007System = 11, /**< Office 2007 theme with system colors. */ xtpThemeOffice2013 = 12, /**< Office 2013 theme. */ xtpThemeOffice2016 = xtpThemeOffice2013, /**< Office 2016 theme. */ xtpThemeVisualStudio2012 = 13, /**< Visual Studio 2012 theme, uses INI file.*/ xtpThemeVisualStudio2012Light = 14, /**< Visual Studio 2012 light theme. */ xtpThemeVisualStudio2012Dark = 15, /**< Visual Studio 2012 dark theme. */ xtpThemeVisualStudio2015 = 16, /**< Visual Studio 2015 theme, uses INI file.*/ xtpThemeNativeWindows10 = 17, /**< Windows 10. */ xtpThemeVisualStudio2017 = 18, /**< Visual Studio 2017 theme, uses INI file.*/ xtpThemeVisualStudio2019 = 19, /**< Visual Studio 2019 theme, uses INI file.*/ xtpThemeVisualStudio2022 = 20, /**< Visual Studio 2022 theme, uses INI file.*/ xtpThemeNativeWindows11 = 21, /**< Windows 11. */ }; /** @cond */ # define xtpThemeWhidbey xtpThemeVisualStudio2005 // old names. # define xtpThemeOffice2007 xtpThemeResource /** @endcond */ /** * @brief * Menubar system button flags. * * Example: *
 * CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar", IDR_MAINFRAME);
 * pMenuBar->SetFlags(xtpFlagIgnoreSetMenuMessage);
 * 
* @see * CXTPMenuBar, CXTPCommandBar, CXTPCommandBar::SetFlags, * xtpFlagHideMinimizeBox, xtpFlagHideMaximizeBox, xtpFlagIgnoreSetMenuMessage, * xtpFlagUseMDIMenus, xtpFlagHideClose, xtpFlagHideMDIButtons, xtpFlagAddMDISysPopup */ enum XTPMenuBarFlags { xtpFlagHideMinimizeBox = 0x0100L, /**< To hide minimize box.*/ xtpFlagHideMaximizeBox = 0x0200L, /**< To hide maximize box.*/ xtpFlagIgnoreSetMenuMessage = 0x0400L, /**< To ignore MDI menus.*/ xtpFlagUseMDIMenus = 0x0800L, /**< To use MDI menus. Not longer used.*/ xtpFlagHideClose = 0x1000L, /**< To hide close button.*/ xtpFlagHideMDIButtons = xtpFlagHideMinimizeBox | xtpFlagHideMaximizeBox | xtpFlagHideClose, /**< Specifies to hide all MDI buttons displayed on the Command Bar. */ xtpFlagAddMDISysPopup = 0x2000L /**< To add system MDI pop-up bar. Specifies to add system pop-up menu to the Menu Bar. This will appears as an icon to the far left of the Menu Bar and will display the MDI menu bar options when clicked.*/ }; /** * @brief * Docking flags. * * Example: *
 * CXTPMenuBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar", IDR_MAINFRAME);
 * pMenuBar->EnableDocking(xtpFlagAlignTop | xtpFlagStretched);
 * 
* @see * CXTPToolBar, CXTPToolBar::EnableDocking, * xtpFlagAlignTop, xtpFlagAlignBottom, xtpFlagAlignLeft, xtpFlagAlignRight, * xtpFlagAlignAny, xtpFlagFloating, xtpFlagHideWrap, xtpFlagStretched, xtpFlagNoBorders, * xtpFlagStretchedShared, xtpFlagSmartLayout */ enum XTPToolBarFlags { xtpFlagAlignTop = 0x000001, /**< Allows docking at the top of the client area.*/ xtpFlagAlignBottom = 0x000002, /**< Allows docking at the bottom of the client area.*/ xtpFlagAlignLeft = 0x000004, /**< Allows docking on the left side of the client area.*/ xtpFlagAlignRight = 0x000008, /**< Allows docking on the right side of the client area.*/ xtpFlagAlignAny = (xtpFlagAlignTop | xtpFlagAlignBottom | xtpFlagAlignLeft | xtpFlagAlignRight), /**< Allows docking on any side of the client area.*/ xtpFlagFloating = 0x000010, /**< Allows floating.*/ xtpFlagHideWrap = 0x000020, /**< Allow to hide wrapped controls.*/ xtpFlagStretched = 0x000040, /**< Bar is stretched.*/ xtpFlagNoBorders = 0x000080, /**< Bar has no borders, this will cause CXTPPaintManager::IsFlatToolBar() to return TRUE.*/ xtpFlagStretchedShared = 0x100000, /**< Bar is stretched, but does not fill whole row.*/ xtpFlagSmartLayout = 0x200000 /**< Smart layout enabled.*/ }; /** * @brief * Enumerated type used to determine menu underlines. * * Example: *
 * pCommandBars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
 * 
*/ enum XTPKeyboardCuesShow { xtpKeyboardCuesShowAlways, /**< Show keyboard cues always.*/ xtpKeyboardCuesShowNever, /**< Never show keyboard cues.*/ xtpKeyboardCuesShowWindowsDefault /**< System defined.*/ }; /** * @brief * Enumerated type used to determine if menu underlines execute pop-ups. * * Example: *
 * pCommandBars->GetCommandBarsOptions()->keyboardCuesUse = xtpKeyboardCuesUseAll;
 * 
*/ enum XTPKeyboardCuesUse { xtpKeyboardCuesUseMenuOnly = 0, /**< Activate only menu by using underlines.*/ xtpKeyboardCuesUseAll = 1, /**< Activate menu and tool bars by using underlines.*/ xtpKeyboardCuesUseNone = 2, /**< No using underlines.*/ xtpKeyboardCuesUseAmpersandOnly = 4 /**< Activates menu items with ampersand only (by default first character used if no ampersand found).*/ }; /** * @brief * Enumerated type used to determine the animation effect of pop-up bars. * * Example: *
 pCommandBars->GetCommandBarsOptions()->animationType = xtpAnimateSlide; 
* @see * CXTPCommandBarsOptions, CXTPCommandBarsOptions::animationType, * xtpAnimateWindowsDefault, xtpAnimateRandom, xtpAnimateUnfold, xtpAnimateSlide, * xtpAnimateFade, xtpAnimateNone */ enum XTPAnimationType { xtpAnimateWindowsDefault, /**< As defined in the "Display" settings.*/ xtpAnimateRandom, /**< Any of the first three in random selection.*/ xtpAnimateUnfold, /**< Unfold top to bottom.*/ xtpAnimateSlide, /**< Slide in from left.*/ xtpAnimateFade, /**< Fade-in.*/ xtpAnimateNone /**< No animation.*/ }; /** * @brief * Docking direction enumerator. * @see * CXTPPopupBar, CXTPPopupBar::m_popupFlags, xtpPopupRight, xtpPopupLeft, xtpPopupDown */ enum XTPPopupDirection { xtpPopupRight = 0, /**< Pop-up Bar will be opened right of control.*/ xtpPopupLeft = 1, /**< Pop-up Bar will be opened left of control.*/ xtpPopupDown = 2, /**< Pop-up Bar will be opened bottom of control.*/ xtpPopupUp = 4 /**< Pop-up Bar will be opened top of control.*/ }; /** * @brief * Special keys enumerator. * @details * See CXTPCommandBar::ProcessSpecialKey for details. * @see * CXTPCommandBar, CXTPCommandBar::ProcessSpecialKey, * xtpKeyNext, xtpKeyPrev, xtpKeyBack, xtpKeyPopup, xtpKeyEscape, xtpKeyReturn, * xtpKeyHome, xtpKeyEnd */ enum XTPSpecialKey { xtpKeyNext, /**< Select next key. */ xtpKeyPrev, /**< Select previous key. */ xtpKeyBack, /**< Close active pop-up key. */ xtpKeyPopup, /**< Open selected pop-up key.*/ xtpKeyEscape, /**< Escape key. */ xtpKeyReturn, /**< Return key. */ xtpKeyHome, /**< Select first key. */ xtpKeyEnd, /**< Select last key. */ xtpKeyLeft, /**< Select left. */ xtpKeyRight, /**< Select right. */ xtpKeySpace /**< Space. */ }; /** * @brief * Flags for idle routine. * * Example: *
pToolBar->DelayRedraw();
* @see * CXTPCommandBar::DelayRedraw, CXTPCommandBar::DelayLayout, xtpIdleLayout, xtpIdleRedraw */ enum XTPIdleFlags { xtpIdleLayout = 1, /**< Delay recalculate layout of command bar.*/ xtpIdleRedraw = 2 /**< Delay redraw of command bar.*/ }; # include "Common/XTPPropExchange.inc" /** * @brief * Base message for CommandBars. */ const UINT WM_XTP_COMMANDBARS_BASE = (WM_USER + 9300); /** * @brief * The WM_XTP_TOOLBARVISIBLECHANGED is sent to the CXTPCommandBars site * when the user shows/hides a toolbar object. * @param pToolBar (CXTPToolBar*)wParam pointer to toolbar. * * Example: * Here is an example of how an application would process the * WM_XTP_TOOLBARVISIBLECHANGED message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE(WM_XTP_TOOLBARVISIBLECHANGED, OnToolBarVisibleChanged)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnToolBarVisibleChanged(WPARAM wParam, LPARAM lParam)
 * {
 *    UNUSED_ALWAYS(lParam);
 *    CXTPToolBar* pToolBar = (CXTPToolBar*)wParam;
 *
 *    return 0;
 * }
 * 
* @see * CXTPToolBar */ const UINT WM_XTP_TOOLBARVISIBLECHANGED = (WM_XTP_COMMANDBARS_BASE + 1); /** * @brief * The WM_XTP_CONTROLSELECTED is sent to the CXTPCommandBars site * when the user selects a CXTPCommandBar item. * @param pControl (CXTPControl*)wParam pointer to selected item. * @details * pControl parameter is NULL when the user removes the mouse pointer from * the selected item. * * Example: * Here is an example of how an application would process the WM_XTP_CONTROLSELECTED * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE(WM_XTP_CONTROLSELECTED, OnControlSelected)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnControlSelected(WPARAM wParam, LPARAM lParam)
 * {
 * UNUSED_ALWAYS(lParam);
 * CXTPControl* pControl = (CXTPControl*)wParam;
 *
 * return 0;
 * }
 * 
* @see * CXTPControl, CXTPCommandBar */ const UINT WM_XTP_CONTROLSELECTED = (WM_XTP_COMMANDBARS_BASE + 2); /** * @brief * The WM_XTP_DRAGCONTROLCHANGED is sent to the CXTPCommandBars site * when the user select a button of a toolbar in customization mode. * * Example: * Here is an example of how an application would process the WM_XTP_DRAGCONTROLCHANGED * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE_VOID(WM_XTP_DRAGCONTROLCHANGED, OnDragControlChanged)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * void CMainFrame::OnDragControlChanged()
 * {
 * CXTPControl* pControl = GetCommandBars()->GetDragControl();
 * }
 * 
* @see * CXTPCommandBars::GetDragControl, CXTPCommandBars::SetCustomizeMode */ const UINT WM_XTP_DRAGCONTROLCHANGED = (WM_XTP_COMMANDBARS_BASE + 3); /** * @brief * The WM_XTP_INITMENU is sent to the CXTPCommandBars site when the menu is about to * become active. It occurs when the user clicks an item on the menu bar or presses * a menu key. This allows the application to modify the menu before it is displayed. * @param pMenuBar (CXTPMenuBar*)wParam pointer to CXTPMenuBar object to be initialized. * @return * If an application processes this message, it should return zero. * * Example: * Here is an example of how an application would process the WM_XTP_INITMENU * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE(WM_XTP_INITMENU, OnInitMenu)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnInitMenu(WPARAM wParam, LPARAM lParam)
 * {
 * UNUSED_ALWAYS(lParam);
 * CXTPMenuBar* pMenuBar = (CXTPMenuBar*)wParam;
 *
 * return 0;
 * }
 * 
* @see * CXTPCommandBars, CXTPMenuBar */ const UINT WM_XTP_INITMENU = (WM_XTP_COMMANDBARS_BASE + 4); /** * @brief * The WM_XTP_CONTROLRBUTTONUP is sent to the CXTPCommandBars site when the menu user * presses the right button in a command bar control. * @param pPoint (LPPOINT)wParam Cursor position. * @param pControl (CXTPControl*)lParam Selected control. * @return * If an application processes this message, it should return TRUE. * * Example: * Here is an example of how an application would process the WM_XTP_CONTROLRBUTTONUP * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE(WM_XTP_CONTROLRBUTTONUP, OnControlRButtonUp)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnControlRButtonUp(WPARAM wParam, LPARAM lParam)
 * {
 * CXTPControl* pControl = (CXTPControl*)lParam;
 * if (pControl->GetID() == ID_FAVORITE_LINK)
 * {
 * CControlFavoriteLink* pLink = DYNAMIC_DOWNCAST(CControlFavoriteLink, pControl);
 * if (!pLink)
 * return FALSE;
 *
 * CMenu menu;
 * XTPResourceManager()->LoadMenu(&menu, IDR_MENU_FAVORITE_LINK);
 *
 * CPoint pt;
 * GetCursorPos(&pt);
 *
 * UINT nReturn = CXTPCommandBars::TrackPopupMenu(menu.GetSubMenu(0), TPM_NONOTIFY |
 * TPM_RECURSE | TPM_RETURNCMD, pt.x, pt.y, this);
 *
 * switch (nReturn)
 * {
 * ....
 * }
 * return TRUE;
 * }
 * return FALSE;
 * }
 * 
* @see * CXTPCommandBar, CXTPControl */ const UINT WM_XTP_CONTROLRBUTTONUP = (WM_XTP_COMMANDBARS_BASE + 5); /** * @brief * The WM_XTP_COMMANDBARKEYDOWN is sent to the CXTPCommandBars site when * the user presses a key. * @param pChar (UINT*)wParam pointer to UINT containing pressed key. * @param pCommandBar (CXTPCommandBar*)lParam pointer to CXTPCommandBar object. * * Example: * Here is an example of how an application would process the WM_XTP_COMMANDBARKEYDOWN * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE(WM_XTP_COMMANDBARKEYDOWN, OnCommandBarKeyDown)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnCommandBarKeyDown(WPARAM wParam, LPARAM lParam)
 * {
 * UINT* pChar = (UINT*)wParam;
 *
 * return 0;
 * }
 * 
* @see * CXTPCommandBar */ const UINT WM_XTP_COMMANDBARKEYDOWN = (WM_XTP_COMMANDBARS_BASE + 6); /** * @brief * The WM_XTP_INITCOMMANDSPOPUP is sent to the CXTPCommandBars site when a pop-up menu * is about to become active. * @param pPopupBar Pointer to a pop-up menu. * * Example: * Here is an example of how an application would process the WM_XTP_INITCOMMANDSPOPUP * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_XTP_INITCOMMANDSPOPUP()
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pPopupBar)
 * {
 * // get the list of commands for the pop-up.
 * CXTPControls* pControls = pPopupBar->GetControls();
 * }
 * 
* @see * WM_XTP_UNINITCOMMANDSPOPUP, CXTPPopupBar */ const UINT WM_XTP_INITCOMMANDSPOPUP = (WM_XTP_COMMANDBARS_BASE + 7); /** * @brief * The WM_XTP_TOOLBARCONTEXTMENU is sent to the CXTPCommandBars site when context menu is about * to become visible * @param pToolBar (CXTPToolBar*)wParam Toolbar under cursor; or NULL if clicked docking bar. * @param pPopup (CXTPPopupBar*)lParam Pop-up bar with context menu. * * Example: * Here is an example of how an application would process the WM_XTP_TOOLBARCONTEXTMENU * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE(WM_XTP_TOOLBARCONTEXTMENU, OnToolbarContextMenu)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnToolbarContextMenu(WPARAM wParam, LPARAM lParam)
 * {
 * CXTPToolBar* pToolBar = (CXTPToolBar*)wParam;
 * CXTPPopupBar* pPopup = (CXTPPopupBar*)lParam;
 *
 * pPopupBar->GetControls()->RemoveAll();
 *
 * return TRUE;
 * }
 * 
* @see * CXTPPopupBar, CXTPControls */ const UINT WM_XTP_TOOLBARCONTEXTMENU = (WM_XTP_COMMANDBARS_BASE + 8); /** * @see WM_XTP_INITCOMMANDSPOPUP */ # define ON_XTP_INITCOMMANDSPOPUP() /** @cond */ # undef ON_XTP_INITCOMMANDSPOPUP # define ON_XTP_INITCOMMANDSPOPUP() \ { WM_XTP_INITCOMMANDSPOPUP, \ 0, \ 0, \ 0, \ AfxSig_vs, \ (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CXTPPopupBar*)) \ & OnInitCommandsPopup }, /** @endcond */ /** * @brief * The WM_XTP_UNINITCOMMANDSPOPUP is sent to the CXTPCommandBars site when a pop-up * menu has been closed. * @param pPopupBar Pointer to a pop-up menu. * * Example: * Here is an example of how an application would process the WM_XTP_UNINITCOMMANDSPOPUP * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_XTP_UNINITCOMMANDSPOPUP()
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * void CMainFrame::OnUninitCommandsPopup(CXTPPopupBar* pPopupBar)
 * {
 * // get the list of commands for the pop-up.
 * CXTPControls* pControls = pPopupBar->GetControls();
 * }
 * 
* @see * ON_XTP_INITCOMMANDSPOPUP */ const UINT WM_XTP_UNINITCOMMANDSPOPUP = (WM_XTP_COMMANDBARS_BASE + 9); /** * @see WM_XTP_UNINITCOMMANDSPOPUP */ # define ON_XTP_UNINITCOMMANDSPOPUP() /** @cond */ # undef ON_XTP_UNINITCOMMANDSPOPUP # define ON_XTP_UNINITCOMMANDSPOPUP() \ { WM_XTP_UNINITCOMMANDSPOPUP, \ 0, \ 0, \ 0, \ AfxSig_vs, \ (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(CXTPPopupBar*)) \ & OnUninitCommandsPopup }, /** @endcond */ /** * @brief * This structure is passed as a parameter in CBN_XTP_EXECUTE message. * @details * See description of CBN_XTP_EXECUTE for details. * @see * CBN_XTP_EXECUTE */ typedef struct { NMHDR hdr; /**< NMHDR structure that contains additional information about this notification. */ CXTPControl* pControl; /**< Pointer to the control that caused the event. */ } NMXTPCONTROL, FAR* LPNMXTPCONTROL; /** * @brief * The CBN_XTP_EXECUTE is sent to the CXTPCommandBars site when the user clicks * an item of a CXTPCommandBar object. * @param id ID of the control that was clicked. * @param memberFxn Name of member function to handle the message. * @details * Use ON_COMMAND to map a single command to a member function if you don't need the exact * control that caused the event. Use ON_COMMAND_RANGE or ON_XTP_EXECUTE_RANGE to map a range of * command IDs to one member function.

If you don't set *pResult = 1 then WM_COMMAND also * will be sent for this event. * * Example: * Here is an example of how an application would process the CBN_XTP_EXECUTE * message. *

 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_XTP_EXECUTE(ID_TOOLS_TOOLITEM, OnToolsItem)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * void CMainFrame::OnToolsItem(NMHDR* pNMHDR, LRESULT* pResult)
 * {
 *    CXTPControl* pControl = ((NMXTPCONTROL*)pNMHDR)->pControl;
 *
 *    CToolRec* pTool = (CToolRec*)pControl->GetTag();
 *
 *    if (!pTool)
 *       return;
 *
 *    CString strArg = pTool->m_strArg;
 *    CString strDir = pTool->m_strDir;
 *
 *    // launch the process.
 *    ShellExecute(NULL, _T("open"), pTool->m_strCmd, strArg, strDir, SW_SHOW);
 *
 *    *pResult = 1;
 * }
 * 
* @see * CXTPControl, NMXTPCONTROL */ const UINT CBN_XTP_EXECUTE = 100; /** * @see CBN_XTP_EXECUTE */ # define ON_XTP_EXECUTE(id, memberFxn) /** @cond */ # undef ON_XTP_EXECUTE # define ON_XTP_EXECUTE(id, memberFxn) ON_NOTIFY(CBN_XTP_EXECUTE, id, memberFxn) /** @endcond */ /** * @see CBN_XTP_EXECUTE */ # define ON_XTP_EXECUTE_RANGE(id, idLast, memberFxn) /** @cond */ # undef ON_XTP_EXECUTE_RANGE # define ON_XTP_EXECUTE_RANGE(id, idLast, memberFxn) \ ON_NOTIFY_EX_RANGE(CBN_XTP_EXECUTE, id, idLast, memberFxn) /** @endcond */ /** * @brief * Creates a control structure. * @details * This structure contains extended information about a CXTPControl object to be created. * CXTPCommandBars sends an XTP_COMMANDBARS_CREATECONTROL message to the owner site * when a new CXTPControl object is about to become created. * @see * WM_XTP_CREATECONTROL */ typedef struct { UINT nID; /**< Identifier of the control to be created. */ CXTPControl* pControl; /**< Control to be created. */ BOOL bToolBar; /**< TRUE if control is toolbar located. */ int nIndex; /**< Index of the control to be created. */ CMenu* pMenu; /**< A Pointer to CMenu object. */ CXTPCommandBar* pCommandBar; /**< Pointer to the parent command bar class. */ CString strCaption; /**< Caption of the control to be created. */ XTPControlType controlType; /**< Type of the control. */ XTPButtonStyle buttonStyle; /**< Button Style of the control. */ } XTP_COMMANDBARS_CREATECONTROL, FAR* LPCREATECONTROLSTRUCT; /** * @brief * The WM_XTP_BEFORECREATECONTROL is sent to the CXTPCommandBars site when a * new CXTPControl object is created. * @param lpCreateControl Pointer to an XTP_COMMANDBARS_CREATECONTROL structure with * information about the control to be created. * @return * If an application processes this message, it should return TRUE. * * Example: * Here is an example of how an application would process the WM_XTP_BEFORECREATECONTROL * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_XTP_CREATECONTROL()
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * int CMainFrame::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
 * {
 *    if (lpCreateControl->nID == ID_BDR_NONE)
 *        {
 *        lpCreateControl->controlType = xtpControlSplitButtonPopup;
 *        return TRUE;
 *        }
 *    return FALSE
 * }
 * 
* @see * XTP_COMMANDBARS_CREATECONTROL, CXTPControl, WM_XTP_AFTERCREATECONTROL */ const UINT WM_XTP_BEFORECREATECONTROL = (WM_XTP_COMMANDBARS_BASE + 10); /** * @see WM_XTP_BEFORECREATECONTROL */ # define ON_XTP_CREATECONTROL() /** @cond */ # undef ON_XTP_CREATECONTROL # define ON_XTP_CREATECONTROL() \ { WM_XTP_BEFORECREATECONTROL, \ 0, \ 0, \ 0, \ AfxSig_is, \ (AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(LPCREATECONTROLSTRUCT)) \ & OnCreateControl }, /** @endcond */ /** * @brief * The WM_XTP_AFTERCREATECONTROL is sent to the CXTPCommandBars site after a * new CXTPControl object is created. * @param lpCreateControl Pointer to an XTP_COMMANDBARS_CREATECONTROL structure * with information about the control to be created. * @return * If an application processes this message, it should return TRUE. * * Example: * Here is an example of how an application would process the WM_XTP_AFTERCREATECONTROL * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_XTP_AFTERCREATECONTROL()
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * void CMainFrame::OnAfterCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
 * {
 *    _ASSERTE(lpCreateControl->pControl);
 *
 *    if (lpCreateControl->nID == ID_BDR_NONE)
 *    {
 *       lpCreateControl->pControl->SetCaption(_T("None"));
 *       return;
 *    }
 * }
 * 
* @see * XTP_COMMANDBARS_CREATECONTROL, CXTPControl, WM_XTP_BEFORECREATECONTROL */ const UINT WM_XTP_AFTERCREATECONTROL = (WM_XTP_COMMANDBARS_BASE + 11); /** * @see WM_XTP_AFTERCREATECONTROL */ # define ON_XTP_AFTERCREATECONTROL() /** @cond */ # undef ON_XTP_AFTERCREATECONTROL # define ON_XTP_AFTERCREATECONTROL() \ { WM_XTP_AFTERCREATECONTROL, \ 0, \ 0, \ 0, \ AfxSig_vs, \ (AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(LPCREATECONTROLSTRUCT)) \ & OnAfterCreateControl }, /** @endcond */ /** * @brief * The WM_XTP_GETTABICON message is sent to a MDI child window to retrieve the * icon that will be used for the tabbed interface. * @details * If application returns 0, CDocument::GetTitle will be used. You can override * CXTPTabClientWnd::GetItemIcon instead of processing the message. * @return * ICON handle to be used. * * Example: * Here is an example of how an application would process the WM_XTP_GETTABICON * message. *
 * BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
 *     //{{AFX_MSG_MAP(CChildFrame)
 *     ON_MESSAGE(WM_XTP_GETTABICON, OnGetTabIcon)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CChildFrame::OnGetTabIcon(WPARAM //wParam, LPARAM //lParam)
 * {
 *    HICON hIcon = m_bLoading ? m_hIconLoading : m_hIconNormal;
 *    return (LRESULT)hIcon;
 * }
 * 
* @see * CXTPTabClientWnd, WM_XTP_GETWINDOWTEXT, WM_XTP_GETWINDOWTOOLTIP */ const UINT WM_XTP_GETTABICON = (WM_XTP_COMMANDBARS_BASE + 12); /** * @brief * Creates a bar structure. * @details * This structure contains extended information about a bar to be created. * CXTPCommandBars sends an XTP_COMMANDBARS_CREATEBAR message to the owner site * when a new CXTPCommandBar object is about to be created. * @see * WM_XTP_CREATECOMMANDBAR */ typedef struct { CXTPCommandBar* pCommandBar; /**< Created command bar. */ BOOL bPopup; /**< TRUE if it is a pop-up command bar. */ BOOL bExpandBar; /**< TRUE if it is an expanded pop-up. */ BOOL bCustomBar; /**< TRUE if it is a user-defined toolbar. */ BOOL bTearOffBar; /**< TRUE if it is a user tear-off pop-up. */ LPCTSTR lpcstrCaption; /**< Caption of the command bar. */ UINT nID; /**< Identifier of the command bar. */ } XTP_COMMANDBARS_CREATEBAR, FAR* LPCREATEBARSTRUCT; /** * @brief * The WM_XTP_CREATECOMMANDBAR is sent to the CXTPCommandBars site when a * new CXTPCommandBars object is created. * @param lpCreateBar Pointer to an XTP_COMMANDBARS_CREATEBAR structure with * information about a bar to be created. * @return * If an application processes this message, it should return TRUE. * * Example: * Here is an example of how an application would process the WM_XTP_CREATECOMMANDBAR * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_XTP_CREATECOMMANDBAR()
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * int CMainFrame::OnCreateCommandBar(LPCREATEBARSTRUCT lpCreateBar)
 * {
 *    if (lpCreateBar->bPopup && _tcscmp(lpCreateBar->lpcstrCaption, _T("Find")) == 0)
 *    {
 *
 *       CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(GetCommandBars());
 *       pPopupBar->SetTearOffPopup(_T("Find Bar"), 1000);
 *       lpCreateBar->pCommandBar = pPopupBar;
 *       return TRUE;
 *    }
 *    return FALSE
 * }
 * 
* @see * XTP_COMMANDBARS_CREATEBAR, CXTPCommandBar */ const UINT WM_XTP_CREATECOMMANDBAR = (WM_XTP_COMMANDBARS_BASE + 13); /** * @brief * The WM_XTP_MESSAGEBARCLOSED is sent to the CXTPCommandBars site * when the user clicks the Close button on a message bar object. * @param pMessageBar (CXTPMessageBar*)lParam pointer to message bar being closed. * * Example: * Here is an example of how an application would process the WM_XTP_MESSAGEBARCLOSED * message. *
 * BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
 *     //{{AFX_MSG_MAP(CMainFrame)
 *     ON_MESSAGE(WM_XTP_MESSAGEBARCLOSED, OnMessageBarClosed)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnMessageBarClosed(WPARAM wParam, LPARAM lParam)
 * {
 *    UNUSED_ALWAYS(wParam);
 *    CXTPMessageBar* pMessageBar = (CXTPMessageBar*)lParam;
 *
 *    return 0;
 * }
 * 
* @see * CXTPToolBar */ const UINT WM_XTP_MESSAGEBARCLOSED = (WM_XTP_COMMANDBARS_BASE + 21); /** * @brief * The WM_XTP_SETBAKSTAGEBUTTONKEYTIP is sent to the CXTPRibbonBackstageButton * when the keyboard tip character for this button is changed. * @param nChar (TCHAR)lParam the code of the character for the keyboard tip. */ const UINT WM_XTP_SETBAKSTAGEBUTTONKEYTIP = (WM_XTP_COMMANDBARS_BASE + 31); /** * @brief * The WM_XTP_SETBAKSTAGEBUTTONKEYTIPDRAWFLAG is sent to the CXTPRibbonBackstageButton * to show/hide the keyboard tip. * @param bShow (BOOL)lParam TRUE: to show keyboard tip; FALSE: to hide keyboard tip. */ const UINT WM_XTP_SETBAKSTAGEBUTTONKEYTIPDRAWFLAG = (WM_XTP_COMMANDBARS_BASE + 32); /** * @brief * XTP_CN_UPDATE_CUSTOMIZE_COMMAND_UI is sent to the command target * via WM_COMMAND instead of CN_UPDATE_COMMAND_UI when it is necessary to * update a Customize menu command without updating the command itself. * @param pExtra A pointer to an array of two CXTPControl pointers where the * first element is a pointer to a Customize menu control and * the second element is a pointer to the control itself. * * Example: *
 * BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
 * {
 *    BOOL bHandled = FALSE;
 *
 *    if (XTP_CN_UPDATE_CUSTOMIZE_COMMAND_UI == nCode)
 *    {
 *       CXTPControl** pControls = reinterpret_cast(pExtra);
 *       CXTPControl* pCustomizedMenuControl = pControls[0];
 *       CXTPControl* pControl = pControls[1];
 *       _ASSERTE(nID == pControl->GetID());
 *       pCustomizedMenuControl->SetEnabled(TRUE);
 *       bHandled = TRUE;
 *    }
 *
 *    return bHandled ? TRUE : CXTPMDIFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
 * }
 * 
*/ # define XTP_CN_UPDATE_CUSTOMIZE_COMMAND_UI ((UINT)(INT_MIN + 1)) /** * @see WM_XTP_CREATECOMMANDBAR */ # define ON_XTP_CREATECOMMANDBAR() /** @cond */ # undef ON_XTP_CREATECOMMANDBAR # define ON_XTP_CREATECOMMANDBAR() \ { WM_XTP_CREATECOMMANDBAR, \ 0, \ 0, \ 0, \ AfxSig_is, \ (AFX_PMSG)(AFX_PMSGW)(int (AFX_MSG_CALL CWnd::*)(LPCREATEBARSTRUCT)) \ & OnCreateCommandBar }, /** @endcond */ /** * @brief * This macro generates the C++ header code necessary for a CXTPControl-derived * class that can be serialized. * @param class_name The actual name of the class (not enclosed in quotation marks). * @details * Use the DECLARE_XTP_CONTROL macro in a .H module, then include that module in all .CPP * modules that need access to objects of this class.

If DECLARE_XTP_CONTROL is included in * the class declaration, then IMPLEMENT_XTP_CONTROL must be included in the class * implementation.

The DECLARE_XTP_CONTROL macro includes all the functionality of * DECLARE_SERIAL, DECLARE_DYNAMIC and DECLARE_DYNCREATE. * * Example: *

 * class CBitmapControl: public CXTPControl
 * {
 *    DECLARE_XTP_CONTROL(CBitmapControl)
 *
 *    public:
 *    CBitmapControl();
 *
 * };
 * 
* @see * IMPLEMENT_XTP_CONTROL, DECLARE_XTP_COMMANDBAR */ # define DECLARE_XTP_CONTROL(class_name) /** @cond */ # undef DECLARE_XTP_CONTROL # define DECLARE_XTP_CONTROL(class_name) \ DECLARE_SERIAL(class_name) \ virtual CXTPControl* Clone(BOOL bRecursive); /** @endcond */ /** * @brief * This macro generates the C++ code necessary for a CXTPControl-derived class * that can be serialized. * @param class_name The actual name of the class (not enclosed in quotation marks). * @param base_class_name The name of the base class (not enclosed in quotation marks). * @details * Use the IMPLEMENT_XTP_CONTROL macro in a .CPP module; then link the resulting object code * only once. * * Example: *
 *
 * IMPLEMENT_XTP_CONTROL(CBitmapControl, CXTPControl)
 * 
* @see * DECLARE_XTP_CONTROL, DECLARE_XTP_COMMANDBAR */ # define IMPLEMENT_XTP_CONTROL(class_name, base_class_name) /** @cond */ # undef IMPLEMENT_XTP_CONTROL # define IMPLEMENT_XTP_CONTROL(class_name, base_class_name) \ IMPLEMENT_SERIAL(class_name, base_class_name, VERSIONABLE_SCHEMA | _XTP_SCHEMA_CURRENT) \ CXTPControl* class_name::Clone(BOOL bRecursive) \ { \ class_name* pButton = (class_name*)class_name::CreateObject(); \ pButton->Copy(this, bRecursive); \ return pButton; \ } /** @endcond */ /** * @brief * This macro generates the C++ header code necessary for a CXTPCommandBar-derived * class that can be serialized. * @param class_name The actual name of the class (not enclosed in quotation marks). * @details * Use the DECLARE_XTP_COMMANDBAR macro in a .H module, then include that module in all .CPP * modules that need access to objects of this class.

If DECLARE_XTP_COMMANDBAR is included * in the class declaration, then IMPLEMENT_XTP_COMMANDBAR must be included in the class * implementation.

The DECLARE_XTP_COMMANDBAR macro includes all the functionality of * DECLARE_SERIAL, DECLARE_DYNAMIC and DECLARE_DYNCREATE. * * Example: *

 * class CToolPopupBar: public CXTPPopupBar
 * {
 *    DECLARE_XTP_COMMANDBAR(CToolPopupBar)
 *
 *    public:
 *    CToolPopupBar();
 *
 * };
 * 
* @see * IMPLEMENT_XTP_COMMANDBAR, DECLARE_XTP_CONTROL */ # define DECLARE_XTP_COMMANDBAR(class_name) /** @cond */ # undef DECLARE_XTP_COMMANDBAR # define DECLARE_XTP_COMMANDBAR(class_name) \ DECLARE_SERIAL(class_name) \ virtual CXTPCommandBar* Clone(BOOL bRecursive); /** @endcond */ /** * @brief * This macro generates the C++ code necessary for a CXTPCommandBar-derived * class that can be serialized. * @param class_name The actual name of the class (not enclosed in quotation marks). * @param base_class_name The name of the base class (not enclosed in quotation marks). * @details * Use the IMPLEMENT_XTP_COMMANDBAR macro in a .CPP module; then link the resulting object code * only once. * * Example: *
 *
 * IMPLEMENT_XTP_COMMANDBAR(CToolPopupBar, CXTPPopupBar)
 * ...
 * pCommandBars->SetPopupBarClass(RUNTIME_CLASS(CToolPopupBar));
 * ...
 * 
* @see * DECLARE_XTP_COMMANDBAR, DECLARE_XTP_CONTROL */ # define IMPLEMENT_XTP_COMMANDBAR(class_name, base_class_name) /** @cond */ # undef IMPLEMENT_XTP_COMMANDBAR # define IMPLEMENT_XTP_COMMANDBAR(class_name, base_class_name) \ IMPLEMENT_SERIAL(class_name, base_class_name, VERSIONABLE_SCHEMA | _XTP_SCHEMA_CURRENT) \ CXTPCommandBar* class_name::Clone(BOOL bRecursive) \ { \ class_name* pCommandBar = (class_name*)class_name::CreateObject(); \ pCommandBar->Copy(this, bRecursive); \ return pCommandBar; \ } // Internal defines # define TRUE_POPUP 2 # define TRUE_KEYBOARD 2 # define TRUE_KEYBOARD_NEXT 2 # define TRUE_KEYBOARD_PREV 3 # define TRUE_SPLITCOMMAND 4 # define TRUE_SPLITDROPDOWN 5 # define XTP_EDITSPIN_UP 4 # define XTP_EDITSPIN_DOWN 5 # define XTP_EDITBUDDYBUTTON 6 # define FALSE_EXIT 2 # define LM_HIDEWRAP 0x80 # define LM_POPUP 0x100 AFX_INLINE BOOL IsKeyboardSelected(BOOL bSelected) { return bSelected == TRUE_KEYBOARD_NEXT || bSelected == TRUE_KEYBOARD_PREV; } AFX_INLINE BOOL IsControlCommandEnabled(BOOL bEnabled) { return bEnabled && bEnabled != TRUE_SPLITDROPDOWN; } AFX_INLINE BOOL IsControlDropDownEnabled(BOOL bEnabled) { return bEnabled && bEnabled != TRUE_SPLITCOMMAND; } // ActiveX commands # define WM_XTP_COMMAND (WM_XTP_COMMANDBARS_BASE + 14) # define WM_XTP_UPDATE_COMMAND (WM_XTP_COMMANDBARS_BASE + 15) # define WM_XTP_CUSTOMIZATION_RESETTOOLBAR (WM_XTP_COMMANDBARS_BASE + 16) # define WM_XTP_CUSTOMIZATION_ADDTOOLBAR (WM_XTP_COMMANDBARS_BASE + 17) # define WM_XTP_CUSTOMIZATION_DELETETOOLBAR (WM_XTP_COMMANDBARS_BASE + 18) # define WM_XTP_TEAROFFDONE (WM_XTP_COMMANDBARS_BASE + 19) # define WM_XTP_DELAYEXECUTE (WM_XTP_COMMANDBARS_BASE + 20) # define XTP_CN_REDRAWPARENT 1 # ifndef TPM_RECURSE # define TPM_RECURSE 0x0001L # endif # ifndef _XTP_INCLUDE_COMMANDBARS # undef _XTP_COMMANDBARS_ACTIVEX # endif /** @endcond */ /** * @brief * Call this member to determine if the specified bar position is left, * top, right, or bottom. * @param barPosition Bar position. * @return * TRUE if the specified bar position is left, top, right, or bottom. * FALSE if the position is anything else. */ AFX_INLINE BOOL IsDockingPosition(XTPBarPosition barPosition) { return barPosition == xtpBarLeft || barPosition == xtpBarTop || barPosition == xtpBarRight || barPosition == xtpBarBottom; } /** * @brief * Call this member to determine if the specified button style is button caption * or button icon and caption. * @param buttonStyle Button style. * @return * TRUE if the specified button style is button caption or button icon and caption. * FALSE otherwise. */ AFX_INLINE BOOL IsCaptionStyle(XTPButtonStyle buttonStyle) { return buttonStyle == xtpButtonCaption || buttonStyle == xtpButtonIconAndCaption; } /** * @brief * Call this member to determine if the specified control type is pop-up control, * a button pop-up control, or a split button pop-up control. * @param controlType Control type. * @return * TRUE if the specified control type is pop-up control, a button pop-up control, * or a split button pop-up control. FALSE otherwise. */ AFX_INLINE BOOL IsPopupControlType(XTPControlType controlType) { return controlType == xtpControlPopup || controlType == xtpControlButtonPopup || controlType == xtpControlSplitButtonPopup; } /** * @brief * Call this member to determine if the specified bar position is * left, right, or is a pop-up toolbar. * @param barPosition Bar position. * @return * TRUE if the specified bar position is left, right, or is a * pop-up toolbar. FALSE otherwise. */ AFX_INLINE BOOL IsVerticalPosition(XTPBarPosition barPosition) { return barPosition == xtpBarLeft || barPosition == xtpBarRight || barPosition == xtpBarPopup; } /** * @brief * Call this member to determine if the menu animation type is * set to fade, slide, or unfold. * @param animationType Animation type. * @return * TRUE if the animation type is set to fade, slide, or unfold. */ AFX_INLINE BOOL IsAnimateType(XTPAnimationType animationType) { return animationType == xtpAnimateFade || animationType == xtpAnimateSlide || animationType == xtpAnimateUnfold; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCOMMANDBARDEFINES_H__) /** @endcond */