17.1, 17.0 ... Ribbon Groups Popup bug |
Post Reply |
Author | |
gpm1
Groupie Joined: 06 June 2006 Status: Offline Points: 54 |
Post Options
Thanks(0)
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 |
|
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 |