![]() |
Command routing for CXTExcelTabCtrl views |
Post Reply
|
| Author | |
whudson
Newbie
Joined: 05 May 2008 Location: United Kingdom Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: Command routing for CXTExcelTabCtrl viewsPosted: 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
|
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
whudson
Newbie
Joined: 05 May 2008 Location: United Kingdom Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
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
|
|
![]() |
|
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 |