Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Command routing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Command routing

 Post Reply Post Reply
Author
Message
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Topic: Command routing
    Posted: 24 March 2006 at 5:16pm

I have created a pane which is derived from CWnd and then attached it to a CXTPDockingPane.

Inside of the pane (CWnd) is a CXTPToolBar and a view (CView derived) like in the Whidbey and other samples.

Everything works fine but the command routing is annoying. ON_COMMAND and ON_UPDATE_COMMAND_UI for the toolbar buttons can not be handled by the main frame or the child view, only by the parent CWnd of the toolbar.

But the CWnd is just a container for the toolbar and view.

I've overloaded OnCmdMsg and forward it to the view, but it seems to me that the command routing doesn't work well if the toolbar/commandbar is inside a docking pane.

Andre

 

Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post Posted: 27 March 2006 at 3:33am

depending on which messages you want to handle, you need to derive your frame/view/window from these template base classes:

CXTPFrameWndBase<BASE> if you need docking pane messages

CXTPCommandBarsSiteBase<BASE> if you need toolbar messages

Back to Top
WindFlashing View Drop Down
Groupie
Groupie


Joined: 21 March 2006
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote WindFlashing Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2006 at 5:34am

Hi,

I have a question.

If I need both docking pane and toolbar messages, which base class should be derived?

Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2006 at 9:47am

I guess you could derive from both like

CMyClass : public CXTPFrameWndBase<CXTPCommandBarsSiteBase<BASE> >

but I'm not sure...

Back to Top
WindFlashing View Drop Down
Groupie
Groupie


Joined: 21 March 2006
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote WindFlashing Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2006 at 8:19pm

Oh, it's nice idea.

Thanks.

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: 29 March 2006 at 7:43am

Actually better

CMyClass : public CXTPFrameWndBase<BASE >

 

 

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.109 seconds.