Print Page | Close Window

SOLVED: Enumerae xtpControlPopup?

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


Topic: SOLVED: Enumerae xtpControlPopup?
Posted By: MadRiver
Subject: SOLVED: Enumerae xtpControlPopup?
Date Posted: 29 September 2008 at 1:05pm
Hello,

I am trying to enumerate the menus in the CommandBars object.

If I have a CommandBar of type XTPBarType::xtpBarTypeMenuBar, I can enumerate its controls.

If a control is type xtpControlPopup, how do I enumerate the menu items/buttons on that popup?

Some incomplete code:
        ICommandBar * pBar = pBar = g_spCommandBars->GetItem(ii);

        if (pBar->GetType() == XTPBarType::xtpBarTypeMenuBar) {

            ICommandBarControl * pControl = 0;

            pControls = pBar->GetControls();  
            int cnt = pControls->GetCount();
            for (int ii = 1; ii <= cnt; ++ii) {
                pControl  = pControls->GetItem(ii);
                if (pControl->GetType() == xtpControlPopup) {
                    // Now what?  pControl->GetCControls() returns siblings.
                }
            }

UPDATE:  If the control is type xtpControlPopup, get the CommandBar.
It will be type xtpBarTypePopup, and you can enumerate its Controls collection.




Replies:
Posted By: Oleg
Date Posted: 29 September 2008 at 2:41pm
Right :)

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


Posted By: Baldur
Date Posted: 29 September 2008 at 5:50pm
// Now what?  pControl->GetCControls() returns siblings
 
ICommandBarControlPopup * pControlPopup = (ICommandBarControlPopup * )pControl;
 
Now you have access to the subcontrols.


Posted By: Number8
Date Posted: 10 October 2008 at 3:41pm
Originally posted by Baldur Baldur wrote:

// Now what?  pControl->GetCControls() returns siblings
 
ICommandBarControlPopup * pControlPopup = (ICommandBarControlPopup * )pControl;
 
Now you have access to the subcontrols.


Hmmm,   there is no "ICommandBarPopup" in my .tlh or .tli.

If I use ICommandBarPopup, I get a casting error.



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



Posted By: Oleg
Date Posted: 13 October 2008 at 6:20am
Hi,
Guess it converted to ICommandBarPopupPtr. or something. See tlh.


-------------
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