Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Toolbar docking pane focus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar docking pane focus

 Post Reply Post Reply
Author
Message
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 443
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar docking pane focus
    Posted: 28 January 2010 at 10:41am
Hello,

We're currently making use of several toolbars within docking panes, and have noticed that clicking a button within a toolbar does not give focus to the parent docking pane.

This is a problem in our case because we have a pop-up menu in our toolbar, and it has accelerators associated with it. The accelerators won't fire until the docking pane has focus.

Is there any way to have the docking panel receive focus when a user clicks within its toolbar?
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: 29 January 2010 at 6:18am
I guess you could override OnCmdMsg and make sure the command is routed to that pane. E.g.
 
CMainFrame::OnCmdMsg(...)
{
    if (m_paneWithToolbar.OnCmdMsg(...))
        return TRUE;
 
    return ::OnCmdMsg(...);
}
 
However, this could yield problems if your command is handled in different places. Usually, only the active window shall have a crack at the command.
PokerMemento - http://www.pokermemento.com/
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.109 seconds.