xtpFlagManualUpdate not working for ribbon? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
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/
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
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 |