Print Page | Close Window

Cancel the visibility of the CXTPPopupBar menu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=22423
Printed Date: 21 May 2024 at 12:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Cancel the visibility of the CXTPPopupBar menu
Posted By: sdancer75
Subject: Cancel the visibility of the CXTPPopupBar menu
Date Posted: 29 September 2014 at 2:18pm
Hi,

I create an "blank" items popup control "ControlButtonPopup" like below :


m_pPopupHistory = (CXTPControlPopup*)pGroup0->Add(xtpControlButtonPopup, ID_POPUP_HISTORY); 
pPopupBar = CXTPPopupBar::CreatePopupBar(GetCommandBars());
pPopupBar->SetShowGripper(FALSE);
m_pPopupHistory->SetCommandBar(pPopupBar);
pPopupBar->InternalRelease();

because I want to fill the control with items dynamically at a later time. So, I dont want to show up an empty popup menu, for that reason, I check the items count with the code below :

void CMainFrame::OnInitCommandsPopup(CXTPPopupBar* pCommandBar) {
     CXTPControls* pControls = pCommandBar->GetControls();
    if (pCommandBar == (CXTPPopupBar*)m_pPopupHistory->GetCommandBar()) {
nItemsCount = pControls->GetCount();
if (nItemsCount == 0) {
AfxMessageBox(_T("There are no items yet !!"));
}
}
}

The problem is that I can not block the control to show up the empty popup menu. Is there any way to cancel the visibility of the popup menu ?

Regards,






-------------
Just me!



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