SOLVED: Enumerae xtpControlPopup? |
Post Reply |
Author | |
MadRiver
Groupie Joined: 21 August 2008 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
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. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Right :)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Baldur
Senior Member Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
Post Options
Thanks(0)
|
// Now what? pControl->GetCControls() returns siblings
ICommandBarControlPopup * pControlPopup = (ICommandBarControlPopup * )pControl;
Now you have access to the subcontrols.
|
|
Number8
Groupie Joined: 29 July 2008 Location: United States Status: Offline Points: 17 |
Post Options
Thanks(0)
|
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++ |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Guess it converted to ICommandBarPopupPtr. or something. See tlh.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |