Command routing |
Post Reply |
Author | |
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
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
|
|
Barto
Groupie Joined: 27 February 2005 Location: Germany Status: Offline Points: 60 |
Post Options
Thanks(0)
|
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 |
|
WindFlashing
Groupie Joined: 21 March 2006 Status: Offline Points: 15 |
Post Options
Thanks(0)
|
Hi, I have a question. If I need both docking pane and toolbar messages, which base class should be derived? |
|
Barto
Groupie Joined: 27 February 2005 Location: Germany Status: Offline Points: 60 |
Post Options
Thanks(0)
|
I guess you could derive from both like CMyClass : public CXTPFrameWndBase<CXTPCommandBarsSiteBase<BASE> > but I'm not sure... |
|
WindFlashing
Groupie Joined: 21 March 2006 Status: Offline Points: 15 |
Post Options
Thanks(0)
|
Oh, it's nice idea. Thanks. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Actually better CMyClass : public CXTPFrameWndBase<BASE >
|
|
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 |