Ribbon Selection Update |
Post Reply |
Author | |
BastianPL
Groupie Joined: 15 April 2006 Status: Offline Points: 69 |
Post Options
Thanks(0)
Posted: 25 April 2007 at 12:45pm |
Hi, i attached my gallery control to ribbon bar. I have also "drop down gallery". But the problem is with selection. If i select item in smaller gallery and i click drop down button, in drop down gallery item is selected ok, but if i change selection in "bigger" gallery the selection in smaller gallery is still this same.
Do YOU have any ideas ???
There is my code:
/*************************************************************************************************************************************************************\ * * void OnFormatSelect( NMHDR *pNMHDR, LRESULT *pResult ) * * DESCRIPTION: * Called when users change the gallery selection * Changes the current selected Format * \*************************************************************************************************************************************************************/ void CMainFrame::OnFormatSelect( NMHDR *pNMHDR, LRESULT *pResult ){ NMXTPCONTROL* tagNMCONTROL = (NMXTPCONTROL *)pNMHDR; CXTPControlGallery *pGroup = DYNAMIC_DOWNCAST( CXTPControlGallery, tagNMCONTROL->pControl ); if ( pGroup ) { CXTPControlGalleryItem *pSelectedItem = pGroup->GetItem( pGroup->GetSelectedItem() ); if ( pSelectedItem ) { int nIndex = pSelectedItem->GetID(); m_RibbonFormat.SelectFormat( m_RibbonFormat.m_FormatGalleryControl.GetName( nIndex ) ); } *pResult = TRUE; return; } *pResult = FALSE; } /*************************************************************************************************************************************************************\ * * void OnUpdateFormatSelect(CCmdUI *pCmdUI) * * DESCRIPTION: * Update selected gallery state (selected Format) * \*************************************************************************************************************************************************************/ void CMainFrame::OnUpdateFormatSelect( CCmdUI *pCmdUI ){ CXTPControlGallery *pGallery = DYNAMIC_DOWNCAST( CXTPControlGallery, CXTPControl::FromUI( pCmdUI ) ); if ( pGallery ) { CString cs = pGallery->GetCaption(); int nSel = m_nSelectedFormatPopupGallery; TRACE2 (" Selected pop-up gallery: %s = %d \n\r", cs, nSel); //if ( m_nSelectedFormatPopupGallery != -1 ) //{ // int nSel = m_nSelectedFormatPopupGallery; // TRACE1 (" Selected pop-up gallery: %d \n\r", nSel); // // // pGallery->SetCheckedItem( m_nSelectedFormatPopupGallery ); // pGallery->EnsureVisible( m_nSelectedFormatPopupGallery ); // m_nSelectedFormatPopupGallery = -1; //} } pCmdUI->Enable( TRUE ); } /*************************************************************************************************************************************************************\ * * void OnFormatSelectGallery( NMHDR *pNMHDR, LRESULT *pResult ) * * DESCRIPTION: * Called when users change the Format selection * Changes the current selected Format * \*************************************************************************************************************************************************************/ void CMainFrame::OnFormatSelectGallery( NMHDR *pNMHDR, LRESULT *pResult ){ NMXTPCONTROL* tagNMCONTROL = (NMXTPCONTROL *)pNMHDR; CXTPControlGallery *pGroup = DYNAMIC_DOWNCAST( CXTPControlGallery, tagNMCONTROL->pControl ); if ( pGroup ) { int Idx = pGroup->GetSelectedItem(); CXTPControlGalleryItem *pSelectedItem = pGroup->GetItem( Idx ); if ( pSelectedItem ) { int nID = pSelectedItem->GetID(); m_RibbonFormat.SelectFormat( m_RibbonFormat.m_FormatGalleryControl.GetName( nID ) ); m_nSelectedFormatPopupGallery = Idx; } *pResult = TRUE; return; } *pResult = FALSE; } /*************************************************************************************************************************************************************\ * * void OnUpdateFormatSelectGallery( CCmdUI *pCmdUI ) * * DESCRIPTION: * Update selected gallery state (selected Format) * \*************************************************************************************************************************************************************/ void CMainFrame::OnUpdateFormatSelectGallery( CCmdUI *pCmdUI ){ CXTPControlGallery *pGallery = DYNAMIC_DOWNCAST( CXTPControlGallery, CXTPControl::FromUI( pCmdUI ) ); if ( pGallery ) { int nIndex = m_RibbonFormat.m_FormatGalleryControl.Find( m_RibbonFormat.GetSelectedFormat() ); pGallery->SetCheckedItem( nIndex ); pGallery->EnsureVisible( nIndex ); } pCmdUI->Enable( TRUE ); } |
|
Bastian
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
yes, now this indeed problem of 11.1 release. Getselected always return -1 for popup galleries. Think it will be some maintaince release. Please write to support I will send you changed files to replace.
Thanks.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |