|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
tera t
|
Jan 31, 2008 - 10:06 PM
|
|
|
Technical Support
|
Feb 13, 2008 - 3:45 AM
|
Your code looks absolutely correct. You can use the CExtToolControlBar::CommandToIndex() method instead of the for() loop in your ScanCommandItems() method.
|
|
tera t
|
Feb 12, 2008 - 1:16 AM
|
Hello.
I seem not to be able to ask you a question well. Not dynamic, I want to change it into appointed CmdID from the program inside. I seem to be able to do it by the following programs. If there is the method that is better than this, please teach it
CExtBarButton * pExtBarButton; pExtBarButton = ScanCommandItems( nGrpCmdID ); if ( pExtBarButton != NULL ){ CExtRibbonButton * pNodeGrid; pNodeGrid = (CExtRibbonButton *)pExtBarButton; pNodeGrid->SetCmdID ( ID_LINE3 , true , true ); }
----------------------------------------------------------------
CExtBarButton * CMuRibbonBar::ScanCommandItems( UINT nCmdID ) {
if( ! IsVisible() ) return 0;
INT nBtnsCount = GetButtonsCount(); if( nBtnsCount == 0 ) return 0;
INT nUpdateBtnsCount = 0; bool bUpdateBar = false; for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ ) { CExtBarButton * pTBB = NULL;
pTBB = ( ( CExtRibbonPage * )( this ) ) -> GetButton( nBtnIdx ); ASSERT_VALID( pTBB ); UINT nTbbCmdID = pTBB->GetCmdID( false ); if( nTbbCmdID != nCmdID ) continue; return pTBB; } // for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ )
return NULL; }
|
|
Technical Support
|
Feb 8, 2008 - 12:21 PM
|
The ribbon bar buttons display exactly the same menus like toolbar buttons. If you need fully dynamic menus, then you can choose one of the following ways:
1) Change command tree nodes describing popup menu structure under ribbon bar’s button.
2) Make this menu containing only one command item and handle the CExtPopupMenuWnd::g_nMsgPrepareMenu (or CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel ) registered windows message like demonstrated in the ProfUIS_Controls sample application. This will allow you to find a single command item in a popup menu, remove it and insert a set of other menu items instead.
|
|
tera t
|
Feb 4, 2008 - 2:41 AM
|
Hello.
I know how to use __ECTN_TBB_SEPARATED_DROPDOWN| __ECTN_TBB_AUTOCHANGE_ID.
What I want to hear. It was generated in the ribbon bar inside. pTBB = new CExtBarButton
With pTBB, I want to operate a menu from the program side.
|
|
Technical Support
|
Feb 2, 2008 - 11:19 AM
|
Please apply the __ECTN_TBB_SEPARATED_DROPDOWN|__ECTN_TBB_AUTOCHANGE_ID styles to the ribbon command tree node which represents the ribbon button with line widths menu. As a result, this button will automatically change its icon and its effective command part to the last invoked menu item’s icon and command identifier.
|
|