17.1, 17.0 ... Ribbon Groups Popup bug
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=22938
Printed Date: 24 December 2024 at 12:46pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: 17.1, 17.0 ... Ribbon Groups Popup bug
Posted By: gpm1
Subject: 17.1, 17.0 ... Ribbon Groups Popup bug
Date 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
|
|