Print Page | Close Window

sub menu popup problem

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=169
Printed Date: 20 April 2024 at 9:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: sub menu popup problem
Posted By: douglashogan
Subject: sub menu popup problem
Date Posted: 24 September 2003 at 5:00am

When I call CommandBars::TrackPopupMenu (), if the popup menu i am calling has a futher sub popup menu, then I don't think my owner parameter is getting sent to the sub popup window. Therefore, any commands from this sub menu are sent to the mainframe window (NULL) and not to the owner window that I have specified.

 

Also, TrackPopupMenu seems to have a confusing definition with a site window and an owner window being specified. The doc is a little out of sync here.

 



-------------
Regards
Douglas Hogan



Replies:
Posted By: Oleg
Date Posted: 25 September 2003 at 10:07am

Thank you Douglas. It is the problem of CommandBars 8.5 only, We release hotfix (8.51) on this week:

 

you can patch your source :

void CXTPControl::OnExecute()

{

m_bPressed = TRUE_KEYBOARD;

CXTPCommandBar* pCommandBar = m_pParent->GetSourceParentCommandBar();

if (pCommandBar->m_pReturnCmd)

{

*pCommandBar->m_pReturnCmd = m_nId;

return;

}

NMXTPCONTROL tagNMCONTROL;

tagNMCONTROL.hdr.code = CBN_XTP_EXECUTE;

tagNMCONTROL.hdr.idFrom = m_nId;

tagNMCONTROL.hdr.hwndFrom = 0;

tagNMCONTROL.pControl = this;

CWnd* pOwner = m_pParent->GetOwnerSite();

CXTPCommandBars* pCommandBars = m_pParent->GetCommandBars();

XTPMouseManager()->SendTrackLost();

if (m_nId == 0)

return;

 

try

{

if (pCommandBars)

{

pCommandBars->SetCommandUsed(m_nId);

}

if (pOwner->SendMessage(WM_XTP_COMMAND, m_nId, (LPARAM)&tagNMCONTROL) == 0)

{

pOwner->SendMessage(WM_COMMAND, m_nId);

}

}

catch (...)

{

}

}




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