Print Page | Close Window

Command routing

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3871
Printed Date: 27 September 2024 at 3:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Command routing
Posted By: ABuenger
Subject: Command routing
Date 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

 




Replies:
Posted By: Barto
Date 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



Posted By: WindFlashing
Date 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?



Posted By: Barto
Date 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...



Posted By: WindFlashing
Date Posted: 28 March 2006 at 8:19pm

Oh, it's nice idea.

Thanks.



Posted By: Oleg
Date Posted: 29 March 2006 at 7:43am

Actually better

CMyClass : public CXTPFrameWndBase<BASE >

 

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net