Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - xtpFlagManualUpdate not working for ribbon?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

xtpFlagManualUpdate not working for ribbon?

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: xtpFlagManualUpdate not working for ribbon?
    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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.143 seconds.