Print Page | Close Window

xtpFlagManualUpdate not working for ribbon?

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=13738
Printed Date: 20 May 2024 at 12:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: xtpFlagManualUpdate not working for ribbon?
Posted By: znakeeye
Subject: xtpFlagManualUpdate not working for ribbon?
Date Posted: 19 March 2009 at 12:38pm
XTP 13.0.0.
 
I have a ribbon control which I want to handle in CMainFrame:
void CMainFrame::OnMyControl() { ... }
 
However, I want another window to be responsible for the state of this control:
void CMyWindow::OnUpdateMyControl(CCmdUI *pCmdUI) { ... pCmdUI->Enable(condition); }
 
The problem is that "Enable(FALSE)" inside my update-handler has no effect. The control remains enabled due to the message-map entry in CMainFrame. I tried the xtpFlagManualUpdate flag, but no success.
 
What am I doing wrong?


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: Oleg
Date Posted: 20 March 2009 at 6:09am
Hi,
 
So what you do to route cmd messages to this CMyWindow?
 
Don't set xtpFlagManualUpdate flag - it stop all update notifications for control.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 20 March 2009 at 10:03am
BOOL CMainFrame::OnCmdMsg(...)
{
     if (ActivePane == MyWindow && MyWindow.OnCmdMsg(...)) // The update-handler lives here!
          return TRUE;
 
     return CXTPFrameWnd::OnCmdMsg(...); //  The command-handler lives in this class!
}
 
Reading through the docs it seems MFC auto-enables the control if an update-handler is not found (which will be the case if I'm deactivating the pane).
 
Is there a solution to this problem?


-------------
PokerMemento - http://www.pokermemento.com/


Posted By: Oleg
Date Posted: 23 March 2009 at 2:02am
Hi,
If you have handler it have to be executed anyway. Try to set breakpoint in CXTPControl::NotifySite  in pSite->OnCmdMsg line and check if your window receives it.
 
Myabe just MyWindow  != ActivePane  ? :)


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