Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > General Discussion
  New Posts New Posts RSS Feed - Ribbon Selection Update
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon Selection Update

 Post Reply Post Reply
Author
Message
BastianPL View Drop Down
Groupie
Groupie
Avatar

Joined: 15 April 2006
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote BastianPL Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon Selection Update
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 2:13pm
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.