/** * @file XTPCommandBarsOptions.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(__XTPCOMMANDBARSOPTIONS_H__) # define __XTPCOMMANDBARSOPTIONS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCommandBars; class CXTPPropExchange; /** * @brief * Options of the command bars. * @see * CXTPCommandBars::GetCommandBarsOptions * * Example: *
pCommandBars->GetCommandBarsOptions()->animationType = xtpAnimateFade;
*/ class _XTP_EXT_CLASS CXTPCommandBarsOptions : public CXTPCmdTarget { public: /** * @brief * Constructs an CXTPCommandBarsOptions object. */ CXTPCommandBarsOptions(); public: /** * @brief * Either reads options from or writes options to an archive. * @param ar A CArchive object to serialize to or from. */ void Serialize(CArchive& ar); /** * @brief * Either reads options from or writes options to an archive. * @param pPX A CXTPPropExchange object to serialize to or from. * @param bUserOptionsOnly TRUE to serialize user's options only. */ void DoPropExchange(CXTPPropExchange* pPX, BOOL bUserOptionsOnly = FALSE); /** * @brief * Call this method to enable/disable menu underlines. * @param keyboardCues Determines if menu underlines are enabled. * @details * keyboardCues parameter can be one of the following: * xtpKeyboardCuesShowAlways Show keyboard cues always. * xtpKeyboardCuesShowNever Show keyboard cues always. * xtpKeyboardCuesShowWindowsDefault System defined. */ void ShowKeyboardCues(XTPKeyboardCuesShow keyboardCues); /** * @brief * Call this method to get menu underlines state. * @return * Returns one of the following: * xtpKeyboardCuesShowAlways - Show keyboard cues always. * xtpKeyboardCuesShowNever - Show keyboard cues always. * xtpKeyboardCuesShowWindowsDefault - System defined. */ XTPKeyboardCuesShow GetShowKeyboardCues() const; /** * @brief * Gets DPI bitmap scaling flag. If enabled, all raster icons and bitmaps * used in the control will be stretched automatically if DPI scaling * factor for control's window isn't equal to 100%. The default value is * derived from CXTPDpi::IsDpiBitmapScalingEnabled. Once changed the new value will be used. * @return * The current value of the DPI bitmap scaling flag for the control. */ BOOL IsDpiBitmapScalingEnabled() const; /** * @brief * Sets DPI bitmap scaling flag. If enabled, all raster icons and bitmaps * used in the control will be stretched automatically if DPI scaling * factor for control's window isn't equal to 100%. The default value is * derived from CXTPDpi::IsDpiBitmapScalingEnabled. Once changed the new value will be used. * @param bEnable TRUE to enable bitmaps scaling, FALSE to disable. */ void EnableDpiBitmapScaling(BOOL bEnable = TRUE); /** * @brief * Gets DPI gallery item scaling flag. If enabled, the gallery * items will be scaled automaticaly according to the current DPI * scaling. * @return * The current value of the DPI gallery item scaling. */ BOOL IsDpiGalleryItemScalingEnabled() const; /** * @brief * Sets DPI gallery item scaling flag. If enabled, the gallery * items will be scaled automaticaly according to the current DPI * scaling. * @param bEnable TRUE to enable gallery item scaling, FALSE to disable. */ void EnableDpiGalleryItemScaling(BOOL bEnable = TRUE); /** @cond */ _XTP_DEPRECATED_IN_FAVOR2(EnableDpiGalleryItemScaling, EnableDpiBitmapScaling) void SetDPIScallingOptions(BOOL bScaleGalleryItems, BOOL bScaleToolbarIcons = TRUE); _XTP_DEPRECATED_IN_FAVOR(IsDpiGalleryItemScalingEnabled) BOOL GetGalleryItemsScalling() const; _XTP_DEPRECATED_IN_FAVOR(IsDpiBitmapScalingEnabled) BOOL GetToolbarsIconsScalling() const; /** @endcond */ public: BOOL bAlwaysShowFullMenus; /**< TRUE to show full menus always. */ BOOL bShowFullAfterDelay; /**< TRUE to show full menus after short delay. */ BOOL bToolBarScreenTips; /**< TRUE to show toolbar's tooltips */ BOOL bToolBarAccelTips; /**< TRUE to add accelerators to tooltips. */ BOOL bLargeIcons; /**< TRUE to use large toolbars icons. */ BOOL bSyncFloatingBars; /**< TRUE to hide floating bars when site frame deactivated. */ BOOL bShowExpandButtonAlways; /**< TRUE to show expand buttons always. */ BOOL bDblClickFloat; /**< TRUE to make toolbar floating be double-clicking. */ BOOL bShowTextBelowIcons; /**< TRUE to show captions below icons. */ BOOL bAltDragCustomization; /**< Allows users to change a toolbar button's position by dragging it while holding down ALT. */ BOOL bAutoHideUnusedPopups; // TRUE to hide unused pop-up controls. This is similar to how the // Windows Start menu hides infrequently used pop-ups.*/ BOOL bDirtyState; /**< TRUE if the user has done any type of customization to menus or toolbars. (I.e. Moving a toolbar or adding a new button). After a load or save of the BarStae this is set to FALSE. */ BOOL bShowPopupBarToolTips; /**< TRUE to display ToolTips for controls in pop-up menus. */ BOOL bShowContextMenuAccelerators; /**< TRUE to show accelerators in context menus. */ XTPAnimationType animationType; /**< Animation type. */ BOOL bAutoUpdateShortcuts; /**< TRUE to update shortcuts from accelerator table. */ DWORD keyboardCuesUse; /**< Keyboard cues used. */ BOOL bFlyByStatus; /**< Status bar displays information about the button. */ CSize szIcons; /**< Size of the normal icons. */ CSize szLargeIcons; /**< Size of the large icons. */ CSize szPopupIcons; /**< Size of icons displayed in pop-up menus. */ BOOL bUseAltNumPadKeys; /**< TRUE to allow activate menu with Alt + num pad key. */ BOOL bUseSystemSaveBitsStyle; /**< TRUE to use CS_SAVEBITS class style for pop-ups and shadows. */ BOOL bDisableCommandIfNoHandler; /**< TRUE to disable commands if no handler is presented. */ BOOL bWrapLargePopups; /**< Wrap controls for large pop-ups instead scroll them. */ CMap m_mapHiddenCommands; /**< Hidden command array. */ CMap m_mapUsedCommands; /**< Used commands array. */ BOOL bShowKeyboardTips; /**< TRUE to use keyboard tips. */ BOOL bShowMiniToolbarTips; /**< TRUE to show tips for controls in a mini toolbar, default is FALSE. */ BOOL bShowPopupButtonsSelectedToolbarOnly; /**< TRUE to show only popup with current icons only */ protected: // DPI-scalling parameters BOOL m_bAutoScaleDpiGalleryItems; /**< TRUE by default. Enables scaling of ribbon gallery items (both inline and displayed in pop-up). */ BOOL m_bAutoScaleDpiToolbarIcons; /**< FALSE by default. Enables scaling of toolbar (on ribbon as well) buttons icons. */ private: BOOL m_bAutoScaleDpiToolbarIconsModified; private: CXTPCommandBars* m_pCommandBars; XTPKeyboardCuesShow keyboardCuesShow; # ifdef _XTP_COMMANDBARS_ACTIVEX /** @cond */ long nUpdatePeriod; DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPCommandBarsOptions); public: afx_msg BOOL OleGetOfficeStyleDisabledIcons(); afx_msg void OleSetOfficeStyleDisabledIcons(BOOL bOfficeStyleDisabledIcons); afx_msg BOOL OleGetFadedIcons(); afx_msg void OleSetFadedIcons(BOOL); afx_msg BOOL OleGetDisabledIcons(); afx_msg void OleSetDisabledIcons(BOOL); afx_msg BOOL OleGetIconsWithShadow(); afx_msg void OleSetIconsWithShadow(BOOL); afx_msg void OleSetIconSize(BOOL bBigIcons, long cx, long cy); afx_msg int OleGetIconWidth(BOOL bLargeIcons); afx_msg int OleGetIconHeight(BOOL bLargeIcons); afx_msg void OleSetPopupIconSize(long cx, long cy); afx_msg int OleGetPopupIconWidth(); afx_msg int OleGetPopupIconHeight(); afx_msg void OleAddHiddenCommand(long nIDCommand); afx_msg BOOL OleGetLunaColors(); afx_msg void OleSetLunaColors(BOOL bLunaColors); afx_msg BOOL OleGetUseSharedImageList(); afx_msg void OleSetUseSharedImageList(BOOL bUseSharedImageList); afx_msg void OleSetFont(LPFONTDISP pFontDisp); afx_msg double OleGetMaxPopupWidth(); afx_msg void OleSetMaxPopupWidth(double dMaxWidthDivisor); LPFONTDISP OleGetFont(); afx_msg BOOL OleIsBalloonStyleSupported(); afx_msg int OleGetShowKeyboardCues(); afx_msg LPFONTDISP OleGetSmallCaptionFont(); afx_msg LPFONTDISP OleGetComboBoxFont(); afx_msg void OleSetSmallCaptionFont(LPFONTDISP pFontDisp); afx_msg void OleSetComboBoxFont(LPFONTDISP pFontDisp); afx_msg void OleSetDPIScallingOptions(BOOL bScaleGalleryItems, BOOL bScaleToolbarIcons); afx_msg BOOL OleIsDPIScallingEnabled(); afx_msg COLORREF OleGetVSStateColor(); afx_msg void OleSetVSStateColor(COLORREF clr); afx_msg void OleSetShowPopupButtonsSelectedToolbarOnly(BOOL bVal); afx_msg BOOL OleGetShowPopupButtonsSelectedToolbarOnly(); afx_msg void OleUpdatePeriodChanged(); afx_msg void OleRemoveHiddenCommands(); DECLARE_PROPERTY(ExpandHoverDelay, long); DECLARE_PROPERTY(ExpandDelay, long); BOOL bSyncActiveFloatingFrames; /** @endcond */ # endif friend class CXTPCommandBars; }; static const TCHAR _xtpCommandBarOptionsSection[] = _T("%s-Options"); /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSOPTIONS_H__) /** @endcond */