Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Cancel the visibility of the CXTPPopupBar menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cancel the visibility of the CXTPPopupBar menu

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

Joined: 08 July 2008
Location: Greece
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdancer75 Quote  Post ReplyReply Direct Link To This Post Topic: Cancel the visibility of the CXTPPopupBar menu
    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!
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.141 seconds.