Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - 17.1, 17.0 ... Ribbon Groups Popup bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

17.1, 17.0 ... Ribbon Groups Popup bug

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

Joined: 06 June 2006
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote gpm1 Quote  Post ReplyReply Direct Link To This Post Topic: 17.1, 17.0 ... Ribbon Groups Popup bug
    Posted: 24 February 2016 at 6:24am
Hello.

Can some one explain fairy sense of code from:
BOOL CXTPRibbonGroupControlPopup::OnSetPopup(BOOL bPopup)
{
    m_bPopup = bPopup;
    if (bPopup)
    {
        CMDTARGET_RELEASE(m_pCommandBar);

        CXTPCommandBars* pCommandBars = m_pParent->GetCommandBars();
        ASSERT(pCommandBars);

        if (!m_pPopupGroup)
        {
            m_pCommandBar = new CXTPPopupToolBar();
            m_pCommandBar->SetCommandBars(pCommandBars);
            m_pCommandBar->Popup(this, IsKeyboardSelected(GetSelected()));
        }
        else
        {

            m_pCommandBar = new CXTPRibbonGroupPopupToolBar(m_pPopupGroup);
            m_pCommandBar->SetCommandBars(pCommandBars);

            m_pCommandBar->EnableCustomization(FALSE);
            m_pCommandBar->Popup(this, IsKeyboardSelected(GetSelected()));
        }
    }
    else
    {
        ASSERT(m_pCommandBar);

        if (m_pCommandBar)
        {
            m_pCommandBar->SetTrackingMode(FALSE);

            if (m_pPopupGroup)
            {
                // we need to copy the popped ribbon group to the existing (in order not to lose user's changes)

                CXTPRibbonGroupPopupToolBar *pPopupToolbar = DYNAMIC_DOWNCAST(CXTPRibbonGroupPopupToolBar, m_pCommandBar);

                if (pPopupToolbar && pPopupToolbar->m_pRibbonGroup)
                {
                    m_pPopupGroup->RemoveAll();
                    m_pPopupGroup->Copy(pPopupToolbar->m_pRibbonGroup);
                }
            }
        }
    }

    RedrawParent();
    return TRUE;
}

What is
                if (pPopupToolbar && pPopupToolbar->m_pRibbonGroup)
                {
                    m_pPopupGroup->RemoveAll();
                    m_pPopupGroup->Copy(pPopupToolbar->m_pRibbonGroup);

                }
doing?

For example I create in one group of a ribbon any CCombobox and store its pointer ....
After I need to get info from combo ... but unfortunately  the ribbon size bigger than screen... and ribbongroup become as popup group.
I get an exception as now pointer contain a garbage.


Product: Xtreme ToolkitPro (MFC) version 16.3.1/17.1.0-20.3.0
Platform: Windows 10 (64bit)
Language: Visual C++ 2008/2013/2015/2019/2022
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.156 seconds.