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 tera
|
Apr 8, 2009 - 4:21 AM
|
Hello. I want to make this RibbonNode non-display.
Please teach a way. 
|
|
tera tera
|
Apr 8, 2009 - 8:44 PM
|
Hello. 
__ECTN_TBB_SEPARATED_DROPDOWN type is not non-displayed.
Please check it. VERIFY( _iconTmp123.m_bmpNormal.LoadBMP_Resource( MAKEINTRESOURCE(ID_PB_ALL_BORDERS) ) );
_iconTmp123.m_bmpNormal.Make32();
_iconTmp123.m_bmpNormal.AlphaColor( RGB(255,0,255), RGB(0,0,0), 0 );
pTempNode123 = new CExtCustomizeCmdTreeNode(
ID_PB_ALL_BORDERS, ID_PB_ALL_BORDERS, NULL, 0,
_T("&All Borders"), _T("&All Borders"), _T(""), 0L, &_iconTmp123 );
pTempNode123->CmdKeyTipSet( new CExtCustomizeCmdKeyTip( __EXT_MFC_SAFE_TCHAR( _T(’A’) ) ), false );
pNodeParagraphBorder->InsertNode( NULL, pTempNode123 );
pTempNode123->ModifyFlags( __ECTN_TBB_HIDDEN );
|
|
Technical Support
|
Apr 8, 2009 - 9:16 PM
|
Thank you for reporting us this issue. To fix it please update the source code for the following method:
bool CExtPopupMenuWnd::UpdateFromCmdTree(
HWND hWndCmdRecv,
CExtCustomizeCmdTreeNode * pNode,
bool bTopLevel // = true
)
{
ASSERT_VALID( this );
ASSERT_VALID( pNode );
m_pNode = pNode;
if( hWndCmdRecv != NULL )
m_hWndCmdReceiver = hWndCmdRecv;
ASSERT( m_hWndCmdReceiver != NULL );
ASSERT( ::IsWindow(m_hWndCmdReceiver) );
__EXT_MFC_SAFE_LPCTSTR strProfileName = g_CmdManager->ProfileNameFromWnd( m_hWndCmdReceiver );
bool bCustomizeMode = false;
CExtCustomizeSite * pSite =
CExtCustomizeSite::GetCustomizeSite( m_hWndCmdReceiver );
if( pSite != NULL )
bCustomizeMode = pSite->IsCustomizeMode();
INT iter = 0;
for( ; iter < m_items_all.GetSize(); iter++)
{
MENUITEMDATA & mi = ItemGetInfo( iter );
if( mi.IsPopup() )
{
CExtPopupMenuWnd * pPopup = mi.GetPopup();
pPopup->m_hWndCmdReceiver = m_hWndCmdReceiver;
INT nSaved = pPopup->m_nFadeOutAnimationStepCount;
pPopup->m_nFadeOutAnimationStepCount = -1;
pPopup->_OnCancelMode();
pPopup->m_nFadeOutAnimationStepCount = nSaved;
VERIFY( pPopup->_BuildItems( NULL, false ) );
mi.DestroyPopup();
}
}
m_items_all.RemoveAll();
if( pNode == NULL )
return true;
ASSERT_VALID( pNode );
m_bTopLevel = bTopLevel;
if( m_bTopLevel )
m_pWndParentMenu = NULL;
int nMruUpdateIndex = -1, nInsertedIndex = 0;
int nMenuItemCount = pNode->GetNodeCount();
m_items_all.RemoveAll();
bool bSeparatorMode = false;
for( int nItemIndex = 0; nItemIndex < nMenuItemCount; nItemIndex++ )
{
CExtCustomizeCmdTreeNode * pChildNode = pNode->ElementAt( nItemIndex );
ASSERT_VALID( pChildNode );
if( ( pChildNode->GetFlags() & __ECTN_GROUP_START ) )
{
if( ! bSeparatorMode )
{
bSeparatorMode = true;
VERIFY( ItemInsert( CExtPopupMenuWnd::TYPE_SEPARATOR, nInsertedIndex++ ) );
}
}
if( pChildNode->GetFlags() & __ECTN_TBB_HIDDEN )
continue;
UINT nMenuItemID = pChildNode->GetCmdID( false );
if( ID_FILE_MRU_FIRST <= nMenuItemID
&& nMenuItemID <= ID_FILE_MRU_LAST
&& (! bCustomizeMode )
)
{
if( nMruUpdateIndex < 0 )
nMruUpdateIndex = nInsertedIndex;
continue;
}
MENUITEMDATA mi( this );
mi.SetCmdReceiver( m_hWndCmdReceiver );
VERIFY( mi.UpdateFromCmdTree( m_hWndCmdReceiver, pChildNode, nInsertedIndex ) );
if( ! mi.IsSeparator() )
{
bSeparatorMode = false;
CExtCmdItem * pCmdItem = NULL;
if( mi.IsPopup() )
{
CExtPopupMenuWnd * pDesc = mi.GetPopup();
pDesc->m_hWndCmdReceiver = m_hWndCmdReceiver;
pDesc->UpdateFromCmdTree( hWndCmdRecv, pChildNode, false );
pDesc->m_pWndParentMenu = this;
}
else
{
pCmdItem = g_CmdManager->CmdGetPtr( strProfileName, mi.GetCmdID() );
if( pCmdItem != NULL )
mi.SetAccelText( pCmdItem->m_sAccelText );
}
mi.SetText( pChildNode->GetTextInMenu( pCmdItem ) );
mi.AccelCharInit();
mi.MeasureItem( NULL );
}
_InsertItem( -1, mi );
nInsertedIndex++;
}
int nMruInsertCount = 0;
if( nMruUpdateIndex >= 0 )
{
CRecentFileList * pRecentFileList = InternalFriendlyWinApp::_GetFriendlyApp()-> _GetRecentFileList();
if( pRecentFileList != NULL )
{
int nRecentCount = pRecentFileList->GetSize();
TCHAR sCurrDir[_MAX_PATH+1];
::memset(sCurrDir,0,sizeof(sCurrDir));
::GetCurrentDirectory(_MAX_PATH,sCurrDir);
int nLenCurDir = (int)_tcslen(sCurrDir);
for( int nItemIndex=0; nItemIndex<nRecentCount; nItemIndex++ )
{
CExtSafeString sDisplayName( _T("") );
CExtSafeString sDisplayNameFullPath( _T("") );
CExtSafeString sDisplayNameMenu( _T("") );
CExtSafeString sDisplayNameTipTool( _T("") );
sDisplayNameFullPath = ( ! pRecentFileList->m_arrNames[ nItemIndex ].IsEmpty() ) ? LPCTSTR( pRecentFileList->m_arrNames[ nItemIndex ] ) : _T("");
pRecentFileList->GetDisplayName( *((CString *)&sDisplayName), nItemIndex, sCurrDir, nLenCurDir, TRUE );
if( sDisplayName.IsEmpty() || sDisplayNameFullPath.IsEmpty() )
continue;
if( g_bMRU_UseFullPathsInMenu )
sDisplayNameMenu = sDisplayNameFullPath;
else
sDisplayNameMenu = sDisplayName;
if( g_bMRU_UseFullPathsInTipTool )
sDisplayNameTipTool = sDisplayNameFullPath;
else
sDisplayNameTipTool = sDisplayName;
UINT nCmdID = ID_FILE_MRU_FIRST + nItemIndex;
ASSERT( nCmdID <= ID_FILE_MRU_LAST );
CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( g_CmdManager->ProfileNameFromWnd( m_hWndCmdReceiver ), nCmdID );
if( pCmdItem == NULL )
pCmdItem = g_CmdManager->CmdAllocPtr( g_CmdManager->ProfileNameFromWnd( m_hWndCmdReceiver ), nCmdID );
ASSERT( pCmdItem != NULL );
if( pCmdItem == NULL )
return false;
int nDisplayIndex = nItemIndex+1;
if( nDisplayIndex < 10 )
pCmdItem->m_sMenuText.Format( _T("&%d %s"), nDisplayIndex, sDisplayNameMenu );
else
pCmdItem->m_sMenuText.Format( _T("%d&%d %s"), nDisplayIndex/10, nDisplayIndex%10, sDisplayNameMenu );
CExtSafeString sRecentFileFmt1,sRecentFileFmt2;
if( ! g_ResourceManager->LoadString( sRecentFileFmt1, IDS_RECENT_FILE_FMT_1 ) )
sRecentFileFmt1 = _T("Recent file %d");
if( ! g_ResourceManager->LoadString( sRecentFileFmt2, IDS_RECENT_FILE_FMT_2 ) )
sRecentFileFmt2 = _T("Recent file %d (\"%s\")");
pCmdItem->m_sToolbarText.Format( (LPCTSTR)sRecentFileFmt1, nItemIndex + 1 );
pCmdItem->m_sTipTool.Format( (LPCTSTR)sRecentFileFmt2, nItemIndex + 1, sDisplayNameTipTool );
pCmdItem->m_sTipStatus = pCmdItem->m_sTipTool;
BOOL bInsRetVal = ItemInsert( nCmdID, nMruUpdateIndex + nItemIndex );
if( ! bInsRetVal )
{
ASSERT( FALSE );
return false;
}
nMruInsertCount++;
}
}
if( nMruInsertCount == 0
&& nMruUpdateIndex > 0
&& nMruUpdateIndex < (ItemGetCount()-1)
&& ItemGetInfo( nMruUpdateIndex ).IsSeparator()
&& ItemGetInfo( nMruUpdateIndex-1 ).IsSeparator()
)
m_items_all.RemoveAt( nMruUpdateIndex );
}
_SyncItems();
return true;
}
|
|
Technical Support
|
Apr 8, 2009 - 6:43 AM
|
You should use the __ECTN_TBB_HIDDEN style and the CExtCustomizeCmdTreeNode::ModifyFlags method.
|
|