Print Page | Close Window

Hierarchical menu: How?

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=12400
Printed Date: 07 October 2024 at 12:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Hierarchical menu: How?
Posted By: Number8
Subject: Hierarchical menu: How?
Date Posted: 10 October 2008 at 4:36pm
C++:
I create a menu:
    ICommandBarPopupPtr pPopupMenu = 0;
        pPopupMenu = m_pCmdBar->ActiveMenuBar->GetControls()->Add(xtpControlPopup, 0, _bstr_t("TEST"), -1, false);
        pPopupMenu->PutId(32000);
        pPopupMenuControls = pPopupMenu->GetCommandBar()->GetControls();

Add a menu item:
            pAction = pActions->Add(101, _bstr_t("New"), _bstr_t(""), _bstr_t(""), _bstr_t("TEST));

            pControl = pPopupMenuControls->Add(xtpControlButton,  101, "");

I create another menu (as above), and want to add this first menu to it.  I iterate over the CommandBar controls to find the control with this menuname/menuid (TEST/32000), and try to add it to the new menu:
          assert(xtpControlPopup == pCtrl->GetType());
          OutputDebugString(pCtrl->GetCaption()); OutputDebugString("\n");
          // This looks like the control -- popupMenu -- that I am looking for....
          pPopupMenuControls->AddControl(pCtrl);

Unfortunately, the TEST menu does not appear on the second menu I create.
What am I doing wrong?
TIA for any advice...




-------------
Product: Xtreme SuitePro (ActiveX) version 12.1.0
Platform: Windows XP (32bit) - SP 3
Language: C / C++




Replies:
Posted By: Oleg
Date Posted: 13 October 2008 at 6:19am
Hi,
You can't add again already added menu. Have to remove it first or Copy (see Copy method).


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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