![]() |
OnUpdateRibbonTab |
Post Reply ![]() |
Author | |
MGebler ![]() Groupie ![]() Joined: 18 May 2006 Location: Germany Status: Offline Points: 64 |
![]() ![]() ![]() ![]() ![]() Posted: 24 June 2009 at 11:03am |
Big problems in version 12. Have a look at your RibbonMDI sample an insert the highlighted line
void CMainFrame::OnUpdateRibbonTab(CCmdUI* pCmdUI) { CXTPRibbonControlTab* pControl = DYNAMIC_DOWNCAST(CXTPRibbonControlTab, CXTPControl::FromUI(pCmdUI)); if (!pControl) return; CXTPRibbonTab* pTab = pControl->FindTab(ID_TAB_EDIT); if (!pTab) return; pTab->SetVisible( FALSE ); // ... pTab->SetVisible(MDIGetActive() != NULL); } Try to select the EDIT Tab -> Nothing happens. And now the real life problem. In my MDI-application the childframes decide whether a tab or group is visible or not. Therefore I have to hide all ribbon tabs and groups; dispatch the update command to the views of a child frame, andf if one of these views is responsible for the command they show the tab/group (SetVisible(TRUE), if they are not responsible they do nothing. Plese help me |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
This scenario works for me.
In Main Frame add
void CMainFrame::OnUpdateRibbonTab(CCmdUI* pCmdUI)
{ CXTPRibbonControlTab* pControl = DYNAMIC_DOWNCAST(CXTPRibbonControlTab, CXTPControl::FromUI(pCmdUI)); if (!pControl) return; CXTPRibbonTab* pTab = pControl->FindTab(ID_TAB_EDIT);
if (!pTab) return; pTab->SetVisible( FALSE );
} in your view
void CRibbonMDISampleView::OnUpdateRibbonTab(CCmdUI* pCmdUI)
{ CXTPRibbonControlTab* pControl = DYNAMIC_DOWNCAST(CXTPRibbonControlTab, CXTPControl::FromUI(pCmdUI)); if (!pControl) return; CXTPRibbonTab* pTab = pControl->FindTab(ID_TAB_EDIT); if (!pTab) return; pTab->SetVisible(TRUE); } now Tab is visible only when View is active.
|
|
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 |