当前位置: &
& 查看源码
bcgpribbonbar.h
bcgpribbonbar.h:源码内容
//*******************************************************************************
//©RIGHT&NOTES
//&---------------
//&This&is&a&part&of&BCGControlBar&Library&Professional&Edition
//&Copyright&(C)&&BCGSoft&Ltd.
//&All&rights&reserved.
//&This&source&code&can&be&used,&distributed&or&modified
//&only&under&terms&and&conditions&
//&of&the&accompanying&license&agreement.
//*******************************************************************************
//&BCGPRibbonBar.h&:&header&file
#if&!defined(AFX_BCGPRIBBONBAR_H__B3C69A4D_9CDE_406F_6920A__INCLUDED_)
#define&AFX_BCGPRIBBONBAR_H__B3C69A4D_9CDE_406F_6920A__INCLUDED_
#if&_MSC_VER&&&1000
#pragma&once
#endif&//&_MSC_VER&&&1000
#define&AFX_IDW_RIBBON_BAR
0xE806&&//&CBCGPRibbonBar
#define&RIBBON_CAPTION_BUTTONS 3
#include&&BCGCBPro.h&
#ifndef&BCGP_EXCLUDE_RIBBON
#include&&BCGPControlBar.h&
#include&&BCGPRibbonButton.h&
#include&&BCGPRibbonQuickAccessToolbar.h&
class&CBCGPRibbonC
class&CBCGPRibbonB
class&CBCGPRibbonMainB
class&CBCGPToolbarMenuB
class&CBCGPRibbonMainP
class&CBCGPRibbonEditC
class&CBCGPRibbonKeyT
class&CBCGPRibbonP
class&CBCGPRibbonStatusB
/////////////////////////////////////////////////////////////////////////////
//&BCGPRibbonCategoryColor
enum&BCGPRibbonCategoryColor
BCGPCategoryColor_None,
BCGPCategoryColor_Red,
BCGPCategoryColor_Orange,
BCGPCategoryColor_Yellow,
BCGPCategoryColor_Green,
BCGPCategoryColor_Blue,
BCGPCategoryColor_Indigo,
BCGPCategoryColor_Violet
/////////////////////////////////////////////////////////////////////////////
//&CBCGPRibbonCaptionButton
class&BCGCBPRODLLEXPORT&CBCGPRibbonCaptionButton&:&public&CBCGPRibbonButton
DECLARE_DYNCREATE&(CBCGPRibbonCaptionButton)
friend&class&CBCGPRibbonB
BOOL&IsMDIChildButton&()&const
return&m_hwndMDIChild&!=&NULL;
protected:
CBCGPRibbonCaptionButton&(UINT&uiCmd&=&0,&HWND&hwndMDIChild&=&NULL);
virtual&void&OnDraw&(CDC*&pDC);
virtual&void&OnLButtonUp&(CPoint&point);
virtual&CSize&GetRegularSize&(CDC*&pDC);
virtual&CSize&GetCompactSize&(CDC*&pDC)
return&GetRegularSize&(pDC);
virtual&BOOL&IsShowTooltipOnBottom&()&const { return&FALSE; }
virtual&int&AddToListBox&(CBCGPRibbonCommandsListBox*&/*pWndListBox*/,&BOOL&/*bDeep*/)
return&-1;
HWND m_hwndMDIC
/////////////////////////////////////////////////////////////////////////////
//&CBCGPRibbonContextCaption
class&BCGCBPRODLLEXPORT&CBCGPRibbonContextCaption&:&public&CBCGPRibbonButton
DECLARE_DYNCREATE&(CBCGPRibbonContextCaption)
friend&class&CBCGPRibbonB
BCGPRibbonCategoryColor GetColor&()&const
return&m_C
int&GetRightTabX&()&const
return&m_nRightTabX;
UINT&GetContextID&()&const
return&m_uiID;
protected:
CBCGPRibbonContextCaption&(LPCTSTR&lpszName,&UINT&uiID,&BCGPRibbonCategoryColor&clrContext);
CBCGPRibbonContextCaption&();
virtual&void&OnDraw&(CDC*&pDC);
virtual&void&OnLButtonUp&(CPoint&point);
BCGPRibbonCategoryColor m_C
m_nRightTabX;
/////////////////////////////////////////////////////////////////////////////
//&CBCGPRibbonBar&window
#define&BCGPRIBBONBAR_HIDE_ELEMENTS 0x0001
#define&BCGPRIBBONBAR_HIDE_ALL
class&BCGCBPRODLLEXPORT&CBCGPRibbonBar&:&public&CBCGPControlBar
friend&class&CBCGPRibbonC
friend&class&CBCGPRibbonCmdUI;
friend&class&CBCGPBaseRibbonE
friend&class&CBCGPRibbonCustomizeP
friend&class&CBCGPPrintPreviewV
friend&class&CBCGPRibbonMainB
friend&class&CBCGPRibbonPanelMenuB
friend&class&CBCGPFrameI
friend&class&CBCGPRibbonE
friend&class&CBCGPRibbonP
friend&class&CBCGPRibbonC
friend&class&CBCGPRibbonC
DECLARE_DYNAMIC(CBCGPRibbonBar)
static&BOOL&SaveRibbon&(const&CBCGPRibbonBar*&rb,&const&CBCGPRibbonStatusBar*&sb,
const&CString&&strFolder,&
const&CString&&strResourceName,
DWORD&dwFlags&=&0x0F,
const&CString&&strResourceFolder&=&_T(&res\BCGSoft_ribbon&),&
const&CString&&strResourcePrefix&=&_T(&IDR_BCGP&));
//&Construction
CBCGPRibbonBar(BOOL&bReplaceFrameCaption&=&TRUE);
BOOL&Create(CWnd*&pParentWnd,
DWORD&dwStyle&=&WS_CHILD&|&WS_VISIBLE&|&CBRS_TOP,
UINT&nID&=&AFX_IDW_RIBBON_BAR);
BOOL&CreateEx(CWnd*&pParentWnd,&DWORD&dwCtrlStyle&=&0,
DWORD&dwStyle&=&WS_CHILD&|&WS_VISIBLE&|&CBRS_TOP,
UINT&nID&=&AFX_IDW_RIBBON_BAR);
virtual&BOOL&LoadFromXML&(UINT&uiXMLResID);
virtual&BOOL&LoadFromXML&(LPCTSTR&lpszXMLResID);
virtual&BOOL&LoadFromBuffer&(LPCTSTR&lpszXMLBuffer);
void&SetScenicLook&(BOOL&bScenicLook&=&TRUE,&BOOL&bRecalc&=&TRUE);
BOOL&IsScenicLook&()&const
return&m_bScenicL
//&Operations
virtual&void&RecalcLayout&();
//----------------------------------------------------------------------
//&Enable/disable&ribbon&main&button&(large&rounded&button&on&top&left):
//----------------------------------------------------------------------
void&SetMainButton&(CBCGPRibbonMainButton*&pButton,&CSize&sizeButton);
//--------------------------
//&Ribbon&categories&(tabs):
//--------------------------
CBCGPRibbonMainPanel*&AddMainCategory&(
uiSmallImagesResID,
uiLargeImagesResID,
sizeSmallImage&=&CSize&(16,&16),
sizeLargeImage&=&CSize&(32,&32),
CRuntimeClass* pRTI&=&NULL);
CBCGPRibbonCategory*&AddCategory&(
uiSmallImagesResID,
uiLargeImagesResID,
sizeSmallImage&=&CSize&(16,&16),
sizeLargeImage&=&CSize&(32,&32),
nInsertAt&=&-1,
CRuntimeClass* pRTI&=&NULL);
CBCGPRibbonCategory*&AddContextCategory&(
lpszContextName,
uiContextID,
BCGPRibbonCategoryColor clrContext,
uiSmallImagesResID,
uiLargeImagesResID,
sizeSmallImage&=&CSize&(16,&16),
sizeLargeImage&=&CSize&(32,&32),
CRuntimeClass*
pRTI&=&NULL);
CBCGPRibbonCategory*&AddQATOnlyCategory&(
uiSmallImagesResID,
sizeSmallImage&=&CSize&(16,&16));
CBCGPRibbonCategory*&AddPrintPreviewCategory&();
void&EnablePrintPreview&(BOOL&bEnable&=&TRUE);
BOOL&IsPrintPreviewEnabled&()&const
return&m_bIsPrintP
void&EnableMinimizeButton(BOOL&bEnable&=&TRUE);
BOOL&HasMinimizeButton()&const
return&m_bHasMinimizeB
int&GetCategoryCount&()&
int&GetVisibleCategoryCount&()&
CBCGPRibbonCategory*&GetCategory&(int&nIndex)&
int&GetCategoryIndex&(CBCGPRibbonCategory*&pCategory)&
void&ShowCategory&(int&nIndex,&BOOL&bShow&=&TRUE);
void&ShowContextCategories&(UINT&uiContextID,&BOOL&bShow&=&TRUE);
BOOL&HideAllContextCategories&();
BOOL&ActivateContextCategory&(UINT&uiContextID);
BOOL&RemoveCategory&(int&nIndex);
void&RemoveAllCategories&();
virtual&BOOL&SetActiveCategory&(CBCGPRibbonCategory*&pCategory,&BOOL&bForceRestore&=&FALSE);
CBCGPRibbonCategory*&GetActiveCategory&()&const
return&m_pActiveC
int&FindCategoryIndexByData&(DWORD&dwData)&
BOOL&GetContextName&(UINT&uiContextID,&CString&&strName)&
//-------------------------------
//&Ribbon&elements&direct&access:
//-------------------------------
CBCGPBaseRibbonElement*&FindByID&(UINT&uiCmdID,&BOOL&bVisibleOnly&=&TRUE,&BOOL&bExcludeQAT&=&FALSE)&
CBCGPBaseRibbonElement*&FindByData&(DWORD_PTR&dwData,&BOOL&bVisibleOnly&=&TRUE)&
BOOL&SetElementKeys&(UINT&uiCmdID,&LPCTSTR&lpszKeys,&LPCTSTR&lpszMenuKeys&=&NULL);
void&GetElementsByID&(UINT&uiCmdID,&
CArray&CBCGPBaseRibbonElement*,&CBCGPBaseRibbonElement*&&&arButtons,&BOOL&bIncludeFloaty&=&FALSE);
void&GetVisibleElements&(
CArray&CBCGPBaseRibbonElement*,&CBCGPBaseRibbonElement*&&&arButtons);
void&SetQuickAccessDefaultState&(const&CBCGPRibbonQATDefaultState&&state);
void&SetQuickAccessCommands&(const&CList&UINT,UINT&&&lstCommands,&BOOL&bRecalcLayout&=&TRUE);
void&GetQuickAccessCommands&(CList&UINT,UINT&&&lstCommands);
void&GetElementsByName&(LPCTSTR&lpszName,&
CArray&CBCGPBaseRibbonElement*,&CBCGPBaseRibbonElement*&&&arButtons,&DWORD&dwFlags&=&0);
//--------------------------------------------------
//&Additional&elements&located&on&the&right&of&tabs:
//--------------------------------------------------
void&AddToTabs&(CBCGPBaseRibbonElement*&pElement);
void&RemoveAllFromTabs&();
//------------------
//&Tooltips&support:
//------------------
void&EnableToolTips&(BOOL&bEnable&=&TRUE,&BOOL&bEnableDescr&=&TRUE);
BOOL&IsToolTipEnabled&()&const
return&m_bToolT
BOOL&IsToolTipDescrEnabled&()&const
return&m_bToolTipD
int&GetTooltipFixedWidthRegular&()&const
return&m_nTooltipWidthR
int&GetTooltipFixedWidthLargeImage&()&const
return&m_nTooltipWidthLargeI
void&SetTooltipFixedWidth&(int&nWidthRegular,&int&nWidthLargeImage); //&0&-&set&variable&size
//-----------------
//&Key&tip&support:
//-----------------
void&EnableKeyTips&(BOOL&bEnable&=&TRUE);
BOOL&IsKeyTipEnabled&()&const
return&m_bKeyT
void&GetItemIDsList&(CList&UINT,UINT&&&lstItems,&BOOL&bHiddenOnly&=&FALSE)&
void&ToggleMimimizeState&();
BOOL&OnSysKeyDown&(CFrameWnd*&pFrameWnd,&WPARAM&wParam,&LPARAM&lParam);
BOOL&OnSysKeyUp&(CFrameWnd*&pFrameWnd,&WPARAM&wParam,&LPARAM&lParam);
//&Attributes
int&GetCaptionHeight&()&const
return&m_nCaptionH
int&GetCategoryHeight&()&const
return&m_nCategoryH
BOOL&IsReplaceFrameCaption&()&const
return&m_bReplaceFrameC
CBCGPRibbonMainButton*&GetMainButton&()&const
return&m_pMainB
CBCGPRibbonCategory*&GetMainCategory&()&const
return&m_pMainC
virtual&CBCGPBaseRibbonElement*&HitTest&(CPoint&point,&
BOOL&bCheckActiveCategory&=&FALSE,
BOOL&bCheckPanelCaption&=&FALSE);
//---------------------------------
//&Quick&access&toolbar&attributes:
//---------------------------------
void&SetQuickAccessToolbarOnTop&(BOOL&bOnTop);
BOOL&IsQuickAccessToolbarOnTop&()&const
return&m_bQuickAccessToolbarOnTop&&&&m_bReplaceFrameC
CRect&GetQuickAccessToolbarLocation&()&const
return&m_QAToolbar.GetRect&();
CRect&GetQATCommandsLocation&()&const
return&m_QAToolbar.GetCommandsRect&();
BOOL&IsQATEmpty&()&const
return&(int)&m_QAToolbar.m_arButtons.GetSize&()&&=&1;
CBCGPBaseRibbonElement*&GetQATDroppedDown&()
return&m_QAToolbar.GetDroppedDown&();
DWORD&GetHideFlags&()&const
return&m_dwHideF
int&GetTabTrancateRatio&()&const
return&m_nTabTrancateR
void&SetMaximizeMode&(BOOL&bMax,&CWnd*&pWnd&=&NULL);
void&SetActiveMDIChild&(CWnd*&pWnd);
virtual&CBCGPBaseRibbonElement*&GetDroppedDown&();
virtual&CBCGPBaseRibbonElement*&GetFocused&();
BOOL&IsTransparentCaption&()&const
return&m_bIsTransparentC
BOOL&AreTransparentTabs&()&const
return&m_bIsTransparentCaption&&&&m_bTransparentT
int&GetKeyboardNavigationLevel&()&const
return&m_nKeyboardNavL
void&SetKeyboardNavigationLevel&(CObject*&pLevel,&BOOL&bSetFocus&=&TRUE);
CObject*&GetKeyboardNavLevelParent&()&const
return&m_pKeyboardNavLevelP
CObject*&GetKeyboardNavLevelCurrent&()&const
return&m_pKeyboardNavLevelC
BOOL&IsDlgBarMode&()&const
return&m_bDlgBarM
protected:
m_bDlgBarM
m_nCategoryH
m_nCategoryMinW
m_bRecalcCategoryH
m_bRecalcCategoryW
CBCGPRibbonCategory* m_pActiveC
CBCGPRibbonCategory* m_pActiveCategoryS
m_nHighlightedT
CArray&CBCGPRibbonCategory*,CBCGPRibbonCategory*&&m_arC
CArray&int,int&
m_arVisibleCategoriesS
m_nCaptionH
m_rectCaptionT
CBCGPRibbonMainButton* m_pMainB
m_bAutoDestroyMainB
CBCGPRibbonCategory* m_pMainC
CBCGPRibbonCategory* m_pPrintPreviewC
m_bIsPrintP
m_sizeMainB
CBCGPBaseRibbonElement* m_pH
CBCGPBaseRibbonElement* m_pP
const&BOOL
m_bReplaceFrameC
m_bQuickAccessToolbarOnT
m_nTabTrancateR
CBCGPRibbonButtonsGroup m_TabE
CToolTipCtrl*
m_nSystemButtonsN
m_bMaximizeM
m_bAutoCommandT
m_bPrintPreviewM
m_bIsTransparentC
m_bTransparentT
m_rectSysB
m_bToolTipD
m_nTooltipWidthR
m_nTooltipWidthLargeI
m_bIsCustomizeM
m_nKeyboardNavL
m_pKeyboardNavLevelP
m_pKeyboardNavLevelC
m_nCurrKeyC
m_bDontSetKeyT
m_bHasMinimizeB
CBCGPRibbonCaptionButton&m_CaptionButtons&[RIBBON_CAPTION_BUTTONS];
CArray&CBCGPRibbonContextCaption*,&CBCGPRibbonContextCaption*&
m_arContextC
CBCGPRibbonQuickAccessToolbar m_QAT
CArray&CBCGPRibbonKeyTip*,CBCGPRibbonKeyTip*&
m_bScenicL
//&Overrides
virtual&void&OnClickButton&(CBCGPRibbonButton*&pButton,&CPoint&point);
virtual&BOOL&IsMainRibbonBar&()&const { return&TRUE; }
virtual&BOOL&IsShowGroupBorder&(CBCGPRibbonButtonsGroup*&/*pGroup*/)&const { return&FALSE; }
virtual&void&OnEditContextMenu&(CBCGPRibbonEditCtrl*&pEdit,&CPoint&point);
virtual&void&DWMCompositionChanged&();
virtual&BOOL&OnShowRibbonQATMenu&(CWnd*&pWnd,&int&x,&int&y,&CBCGPBaseRibbonElement*&pHit);
virtual&BOOL&TranslateChar&(UINT&nChar);
virtual&void&OnRTLChanged&(BOOL&bIsRTL);
//&ClassWizard&generated&virtual&function&overrides
//{{AFX_VIRTUAL(CBCGPRibbonBar)
virtual&BOOL&PreTranslateMessage(MSG*&pMsg);
protected:
virtual&BOOL&PreCreateWindow(CREATESTRUCT&&cs);
virtual&BOOL&OnCommand(WPARAM&wParam,&LPARAM&lParam);
virtual&LRESULT&WindowProc(UINT&message,&WPARAM&wParam,&LPARAM&lParam);
//}}AFX_VIRTUAL
virtual&void&OnUpdateCmdUI&(CFrameWnd*&pTarget,&BOOL&bDisableIfNoHndler);
virtual&void&OnControlBarContextMenu&(CWnd*&pParentFrame,&CPoint&point);
virtual&BOOL&OnSetAccData&(long&lVal);
virtual&BOOL&OnBeforeShowPaletteContextMenu&(const&CBCGPBaseRibbonElement*&pHit,&CMenu&&menu);
protected:
virtual&CSize&CalcFixedLayout(BOOL&bStretch,&BOOL&bHorz);
virtual&BOOL&AllowShowOnControlMenu&()&const
return&FALSE;
virtual&void&OnFillBackground&(CDC*&pDC,&CRect&rectClient);
virtual&BOOL&LoadState&(LPCTSTR&lpszProfileName&=&NULL,&int&nIndex&=&-1,&UINT&uiID&=&(UINT)&-1);
virtual&BOOL&SaveState&(LPCTSTR&lpszProfileName&=&NULL,&int&nIndex&=&-1,&UINT&uiID&=&(UINT)&-1);
virtual&void&OnSetPrintPreviewKeys&(
CBCGPRibbonPanel*&pPrintPanel,
CBCGPRibbonPanel*&pZoomPanel,
CBCGPRibbonPanel*&pPreviewPanel);
virtual&BOOL&HideInPrintPreviewMode&()&const
{ return&FALSE; }
virtual&void&OnBeforeProcessKey&(int&&nChar);
//&Implementation
virtual&~CBCGPRibbonBar();
void&PopTooltip&();
BOOL&DrawMenuImage&(CDC*&pDC,&const&CBCGPToolbarMenuButton*&pMenuItem,&
const&CRect&&rectImage);
virtual&BOOL&OnShowRibbonContextMenu&(CWnd*&pWnd,&int&x,&int&y,&CBCGPBaseRibbonElement*&pHit);
void&ForceRecalcLayout&();
void&DeactivateKeyboardFocus&(BOOL&bSetFocus&=&TRUE);
void&ShowKeyTips&(BOOL&bRepos&=&FALSE);
void&HideKeyTips&();
protected:
void&ShowSysMenu&(const&CPoint&&point);
void&SetPrintPreviewMode&(BOOL&bSet&=&TRUE);
void&SetVisibilityInFrame&(int&cxFrame,&int&cyFrame);
CBCGPRibbonContextCaption*&FindContextCaption&(UINT&uiID)&
void&UpdateToolTipsRect&();
BOOL&ProcessKey&(int&nChar);
BOOL&NavigateRibbon&(int&nChar);
static&CBCGPBaseRibbonElement*&FindNextFocusedElement&(
int&nChar,&const&CArray&CBCGPBaseRibbonElement*,&CBCGPBaseRibbonElement*&&&arElems,
CRect&rectElems,&CBCGPBaseRibbonElement*&pFocused,
BOOL&bIsScrollLeftAvailable,&BOOL&bIsScrollRightAvailable,&int&&nScroll);
static&CBCGPBaseRibbonElement*&FindNearest&(CPoint&pt,&const&CArray&CBCGPBaseRibbonElement*,&CBCGPBaseRibbonElement*&&&arButtons);
void&RemoveAllKeys&();
//&Generated&message&map&functions
protected:
//{{AFX_MSG(CBCGPRibbonBar)
afx_msg&int&OnCreate(LPCREATESTRUCT&lpCreateStruct);
afx_msg&void&OnSize(UINT&nType,&int&cx,&int&cy);
afx_msg&void&OnPaint();
afx_msg&void&OnLButtonDown(UINT&nFlags,&CPoint&point);
afx_msg&void&OnLButtonUp(UINT&nFlags,&CPoint&point);
afx_msg&void&OnMouseMove(UINT&nFlags,&CPoint&point);
afx_msg&void&OnCancelMode();
afx_msg&void&OnLButtonDblClk(UINT&nFlags,&CPoint&point);
afx_msg&void&OnDestroy();
afx_msg&void&OnSizing(UINT&fwSide,&LPRECT&pRect);
afx_msg&BOOL&OnMouseWheel(UINT&nFlags,&short&zDelta,&CPoint&pt);
afx_msg&void&OnSettingChange(UINT&uFlags,&LPCTSTR&lpszSection);
afx_msg&void&OnTimer(UINT_PTR&nIDEvent);
afx_msg&void&OnSysColorChange();
afx_msg&BOOL&OnEraseBkgnd(CDC*&pDC);
afx_msg&void&OnSysCommand(UINT&nID,&LPARAM&lParam);
afx_msg&BOOL&OnSetCursor(CWnd*&pWnd,&UINT&nHitTest,&UINT&message);
afx_msg&void&OnSetFocus(CWnd*&pOldWnd);
afx_msg&void&OnKillFocus(CWnd*&pNewWnd);
afx_msg&void&OnShowWindow(BOOL&bShow,&UINT&nStatus);
//}}AFX_MSG
afx_msg&LRESULT&OnSetFont&(WPARAM,&LPARAM);
afx_msg&LRESULT&OnGetFont&(WPARAM,&LPARAM);
afx_msg&LRESULT&OnMouseLeave&(WPARAM,&LPARAM);
afx_msg&LRESULT&OnBCGUpdateToolTips&(WPARAM,&LPARAM);
afx_msg&BOOL&OnNeedTipText(UINT&id,&NMHDR*&pNMH,&LRESULT*&pResult);
afx_msg&LRESULT&OnPostRecalcLayout&(WPARAM,LPARAM);
DECLARE_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//&CBCGPRibbonBar&idle&update&through&CBCGPRibbonCmdUI&class
class&CBCGPRibbonCmdUI&:&public&CCmdUI
CBCGPRibbonCmdUI&();
virtual&void&Enable(BOOL&bOn);
virtual&void&SetCheck(int&nCheck);
virtual&void&SetText(LPCTSTR&lpszText);
virtual&void&SetRadio(BOOL&bOn&=&TRUE);
CBCGPBaseRibbonElement* m_pU
//////////////////////////////////////////////////////////////////////
//&CBCGPRibbonMainButton
class&BCGCBPRODLLEXPORT&CBCGPRibbonMainButton&:&public&CBCGPRibbonButton
friend&class&CBCGPRibbonC
friend&class&CBCGPRibbonC
DECLARE_DYNCREATE(CBCGPRibbonMainButton);
CBCGPRibbonMainButton&()
CBCGPRibbonMainButton&(UINT&uiBmpResID)
SetImage&(uiBmpResID);
CBCGPRibbonMainButton&(HBITMAP&hBmp)
SetImage&(hBmp);
void&SetImage&(UINT&uiBmpResID);
void&SetImage&(HBITMAP&hBmp);
void&SetScenicImage&(UINT&uiBmpResID);
void&SetScenicImage&(HBITMAP&hBmp);
CBCGPToolBarImages&&GetImage&()
{ return&m_I
CBCGPToolBarImages&&GetScenicImage&() { return&m_ImageS }
protected:
virtual&BOOL&IsShowTooltipOnBottom&()&const { return&FALSE; }
virtual&BOOL&IsMainRibbonButton&()&const
return&TRUE;
virtual&BOOL&CanBeAddedToQAT&()&const
return&FALSE;
virtual&int&AddToListBox&(CBCGPRibbonCommandsListBox*&/*pWndListBox*/,&BOOL&/*bDeep*/)
return&-1;
virtual&CSize&GetImageSize&(RibbonImageType&/*type*/)&const
ASSERT_VALID&(this);
return&m_Image.GetImageSize&();
virtual&void&DrawImage&(CDC*&pDC,&RibbonImageType&type,&CRect&rectImage);
virtual&void&OnLButtonDown&(CPoint&point);
virtual&void&OnLButtonDblClk&(CPoint&point);
virtual&BOOL&OnKey&(BOOL&bIsMenuKey);
virtual&BOOL&IsDrawTooltipImage&()&const { return&FALSE; }
BOOL&ShowMainMenu&();
CBCGPToolBarImages
CBCGPToolBarImages
extern&BCGCBPRODLLEXPORT&UINT&BCGM_ON_CHANGE_RIBBON_CATEGORY;
extern&BCGCBPRODLLEXPORT&UINT&BCGM_ON_RIBBON_CUSTOMIZE;
extern&BCGCBPRODLLEXPORT&UINT&BCGM_ON_HIGHLIGHT_RIBBON_LIST_ITEM;
extern&BCGCBPRODLLEXPORT&UINT&BCGM_ON_BEFORE_SHOW_RIBBON_ITEM_MENU;
extern&BCGCBPRODLLEXPORT&UINT&BCGM_ON_BEFORE_SHOW_PALETTE_CONTEXTMENU;
#define&ForceRelalcLayout ForceRecalcLayout
#endif&//&BCGP_EXCLUDE_RIBBON
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
//&Microsoft&Visual&C++&will&insert&additional&declarations&immediately&before&the&previous&line.
#endif&//&!defined(AFX_BCGPRIBBONBAR_H__B3C69A4D_9CDE_406F_6920A__INCLUDED_)
CopyRight & 2008- All Rights reserved. 苏ICP备
号 京公网安备:95mainmenu自动快捷键,再取项内容时怎么去除快捷键[&f] - Delphi当前位置:& &&&mainmenu自动快捷键,再取项内容时怎么去除快捷键[&mainmenu自动快捷键,再取项内容时怎么去除快捷键[&f]&&网友分享于:&&浏览:308次mainmenu自动快捷键,再取项内容时如何去除快捷键[&f]比如mainmenu使用了快捷键,又不想去除掉快捷键,此时在取mainmenu.items[0].caption为&文件[&f]&,如何取时将[&f]去掉啊,有什么方法吗------解决方案--------------------Delphi(Pascal) code
str:=copy(mainmenu1.Items[0].Caption,length(mainmenu1.Items[0].Caption)-3,4);
mainmenu1.Items[0].Caption:='xxx'+
------解决方案--------------------用圆括号可以这样:Delphi(Pascal) code
Caption := StripHotkey('文件(&f)'); // 文件
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有