Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [SOLVED] Open Backstage Page Programmably
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Open Backstage Page Programmably

 Post Reply Post Reply
Author
Message
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Open Backstage Page Programmably
    Posted: 30 September 2016 at 8:02am
How do I open a specific backstage page programmably from code?

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2016 at 2:15am
Really, is this not possible? Please find a solution, add this to one of the samples.

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (1) Thanks(1)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2016 at 7:59am
Hello cpede,

You can use algorithm from calls

CXTPRibbonBackstageView::ShowBackstageView() Line 757 C++
  > CXTPRibbonBackstageView::SetFocusedControl(CXTPControl * pFocusedControl) Line 246 C++
       > CXTPRibbonBackstageView::SetActiveTab(CXTPRibbonBackstageTab * pTab) Line 188 C++

So for reproduce in RibbonSample we can modify OnViewShowHide method (checkBox in VIEW > Show > Ruler):
void CMainFrame::OnViewShowHide(UINT nID)
{
    //m_bOptions[nID - ID_VIEW_RULER] ^= 1;
    
    pRibbonBar->SetPopuped(0); //popup Backstage

    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)
                continue;

            if (pTab->GetID() == ID_BACKSTAGE_PRINT)
                pView->SetActiveTab(pTab);        //to exclude searching we can save pTabPrint pointer on creation.
        }
    }
}

Regards,
 Oleksandr Lebed
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.234 seconds.