Programmatically show backstage view |
Post Reply |
Author | |
jli1
Groupie Joined: 15 November 2016 Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 15 November 2016 at 5:13pm |
Hi,
I'm using Xtreme ToolkitPro v16.2.4. I'm trying to figure out how to programmatically show backstage view with the specific tab we want. Just like the user click "File" then click the specific tab. But I only achieved to pop up a separate view which only shows part of the backstage view(the tab content part). This is not what I want. The following is the code I wrote, please point out where is wrong: CXTPRibbonBar* pRibbonBar = DYNAMIC_DOWNCAST(CXTPRibbonBar, GetCommandBars()->GetMenuBar()); ASSERT (pRibbonBar); CXTPRibbonBackstageView *pView = DYNAMIC_DOWNCAST(CXTPRibbonBackstageView, pRibbonBar->GetSystemButton()->GetCommandBar()); if (pView) { CXTPControls* pRibbonControls = pView->GetControls(); int nCount = pRibbonControls->GetCount(); for (int i=0; i < nCount; i++) { CXTPRibbonBackstageTab* pTab = DYNAMIC_DOWNCAST(CXTPRibbonBackstageTab, pRibbonControls->GetAt(i)); if (pTab && (pTab->GetID() == ID_BACKSTAGE_RECENT)) pView->SetActiveTab(pTab); } } |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello,
I suppose you have used example from here But missed
Regards, Oleksandr Lebed |
|
jli1
Groupie Joined: 15 November 2016 Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Thank you very much, Oleksandr.
After I added that missing line, it works now! But there is a minor problem after the backstage view showed with the specific tab content which is I want, lets say its the tab B. In backstage menu there is another tab, let's say the tab A, it's the default tab when user click "File". With my code, when the backstage view shows with tab B, the tab A in menu is highlighted. I have to click tab B menu, then the highlight of tab A is gone. I guess I need to remove/reset the default tab selection for backstage view, but I don't what is that? Thanks. |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
I have tried to reproduce this with v16.2.4 but even your code from first message gives errors. Also I can't reproduce your problem with 17.3. |
|
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 |