Print Page | Close Window

[SOLVED] Open Backstage Page Programmably

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23147
Printed Date: 23 December 2024 at 9:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Open Backstage Page Programmably
Posted By: cpede
Subject: [SOLVED] Open Backstage Page Programmably
Date 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++)



Replies:
Posted By: cpede
Date 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++)


Posted By: olebed
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net