Print Page | Close Window

Control execution context

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=18228
Printed Date: 25 November 2024 at 1:54am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Control execution context
Posted By: No.Regsz
Subject: Control execution context
Date Posted: 15 April 2011 at 7:21pm
I have a popup menu for a toolbar button. Similar to Office color picker.

I'd like to reuse the same popup for a split button inside a docking view.

I use the following method and have command handlers in both the document child view and the docking view content dialog:

void CMainFrame::TrackBookmarkPopup(int xPos, int yPos, CWnd *pWnd /*= NULL*/) {
  CXTPCommandBars::TrackPopupMenu(m_pBookmarkPopup, TPM_LEFTBUTTON, xPos, yPos, pWnd, NULL, pWnd);
}

When I use this method once - all commands start to dispatch through a passed docking view child dialog. Even if I open this popup from the toolbar with a docking view closed.

Am I doing it wrong way? Popup bar has changed commands target forever?


-------------
XTP 15.0.1
7 SP1
VS 2010 SP1 Beta



Replies:
Posted By: Oleg
Date Posted: 18 April 2011 at 8:10am
Hi,

Yes, actually its true. After TrackPopupMenu,  pWnd will be set to m_pBookmarkPopup

Maybe solution is call with first pWnd = NULL and then reset owner

m_pBookmarkPopup->SetOwner(NULL);


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