Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - SOLVED: Enumerae xtpControlPopup?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED: Enumerae xtpControlPopup?

 Post Reply Post Reply
Author
Message
MadRiver View Drop Down
Groupie
Groupie


Joined: 21 August 2008
Location: United States
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadRiver Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED: Enumerae xtpControlPopup?
    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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2008 at 2:41pm
Right :)
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Baldur View Drop Down
Senior Member
Senior Member


Joined: 22 November 2006
Location: Germany
Status: Offline
Points: 244
Post Options Post Options   Thanks (0) Thanks(0)   Quote Baldur Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2008 at 5:50pm
// Now what?  pControl->GetCControls() returns siblings
 
ICommandBarControlPopup * pControlPopup = (ICommandBarControlPopup * )pControl;
 
Now you have access to the subcontrols.
Back to Top
Number8 View Drop Down
Groupie
Groupie


Joined: 29 July 2008
Location: United States
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Number8 Quote  Post ReplyReply Direct Link To This Post 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++

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2008 at 6:20am
Hi,
Guess it converted to ICommandBarPopupPtr. or something. See tlh.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.