Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - sub menu popup problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

sub menu popup problem

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


Joined: 02 July 2003
Location: Switzerland
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote douglashogan Quote  Post ReplyReply Direct Link To This Post Topic: sub menu popup problem
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group
Avatar

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: 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 (...)

{

}

}

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.094 seconds.