Print Page | Close Window

Command routing for CXTExcelTabCtrl views

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=10505
Printed Date: 15 November 2025 at 1:58am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Command routing for CXTExcelTabCtrl views
Posted By: whudson
Subject: Command routing for CXTExcelTabCtrl views
Date Posted: 05 May 2008 at 9:43am
I have an MDI application which has tabbed windows very much like an Excel workbook, using CXTExcelTabCtrl. But I am having trouble with where MFC sends commands like ID_EDIT_COPY (and the associated update command used to enable the corresponding menu item).
 
If I click with a mouse in the current view, all works as expected. However, when I change views by clicking on a tab, the commands appear to be routed elsewhere - either the parent or the Excel tab ctrl, I haven't checked this yet. But the Edit Copy menu item becomes greyed out because there is nothing to handle the ON_UPDATE_COMMAND_UI message. Again, if I click in the window, it all resumes working.
 
I have tried using various Activate and SetFocus functions and messages in response to the notification from the Excel ctrl that it has changed the current view, but none of these has the same effect as physically clicking with the mouse. What blindingly obvious thing am I missing?? (I have even tried sending an LBUTTONDOWN message to the curren view, but that had no effect either.)
 
Thanks in advance for any clues.
 
Regards,
 
William



Replies:
Posted By: mgampi
Date Posted: 05 May 2008 at 10:49am
Hi;
only a suggestion - not tested yet:
 
In your CXTExcelTabCtrl derived class overwrite OnCmdMsg and first try to route the call to the currently active view.


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: whudson
Date Posted: 05 May 2008 at 11:05am
Martin -
 
Thanks for the suggestion. I don't actually have a CXTExcelTabCtrl-derived class at the moment. A CXTExcelTabCtrl object is a member of my parent view. This is the way it appears to be done in the Codejock-supplied sample.
 
The other issue is that it all works splendily once the user clicks in the client area of the newly-selected view. If I could just change the state of the MFC framework so that it behaved the same way, I would be home and dry.
 
Regards,
 
William



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