Print Page | Close Window

CCmdUI Dialog Panes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=6458
Printed Date: 12 December 2024 at 9:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CCmdUI Dialog Panes
Posted By: asparagusx
Subject: CCmdUI Dialog Panes
Date Posted: 19 February 2007 at 9:08am
Hallo
 
I have a number of CXTPDockingPane controls, which have CDialog derived dialogs in them. It appears that none of these dialogs receive OnUpdate messages. What should I do to enable this?
 
Thanks
 
Anton Heymann



Replies:
Posted By: akur
Date Posted: 19 February 2007 at 9:18am
Hi,

do you mean receiving some CDialog message that is _similar_ to CView::OnUpdate() ? Would you like to handle WM_PAINT in your dialogs?


Posted By: asparagusx
Date Posted: 19 February 2007 at 9:31am

Akur

No, I would like to handle messages such as

OnUpdateCmdControl(CCmdUI *pCmdUI)

    {
    pCmdUI->SetText("kdlkdlkdkldldldlkdlkd");
    pCmdUI->Enable(FALSE);

    }

(as an example).

Anton Heymann



Posted By: akur
Date Posted: 19 February 2007 at 9:39am
Oh, I see, so probably you have some menus/toolbars in your CDialogs to handle their state. If that's the case, you will need to handle WM_KICKIDLE messages in your CDialogs and make your updates from there, just like in this article:

http://www.codeguru.com/cpp/w-d/dislog/commandui/article.php/c1935/




Posted By: asparagusx
Date Posted: 19 February 2007 at 10:17am

Akur

Thanks for the reply. I have tried this as a standalone CDialog and it works fine, however I am placing the CDialog inside a CXTPDockingPane by using pPane->Attach(.....);

The OnKickIdle method is never called in this case! Is there something else I need to try?

Regards

Anton



Posted By: akur
Date Posted: 19 February 2007 at 2:15pm
Hello,

so try to add that handling into CXTPDockingPane::OnIdleUpdate().


Posted By: akur
Date Posted: 19 February 2007 at 2:16pm
I mean, if your CXTPDockingPane::OnIdleUpdate() is called properly, then you can easily communicate that event down into your child CDialog.


Posted By: asparagusx
Date Posted: 19 February 2007 at 3:27pm

Akur

Thanks for the advice,  but how do I 'derive' a class from CXTPDockingPane. Looking at the CreatePane function it returns a pointer to CXTPDockingPane. Can I use a derived class and then save the pointer to it from CreatePane?

Regards

Anton

 



Posted By: akur
Date Posted: 19 February 2007 at 4:42pm
You need to install your own CXTPDockingPaneManager-derived class to your app and override its OnCreatePane() method so that it will instantiate your own CXTPDockingPane-based class for objects of 'xtpPaneTypeDockingPane' type. Have a look at implementation of CXTPDockingPaneManager::OnCreatePane().


Posted By: Oleg
Date Posted: 20 February 2007 at 2:25am
Hi,
 
See Samples\DockingPane\ActivePaneView  it show how to route updates to panes.


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


Posted By: asparagusx
Date Posted: 20 February 2007 at 6:34am
Oleg/Akur
 
I managed to get this all to work. I used

ON_MESSAGE(WM_IDLEUPDATECMDUI, OnIdleUpdateCmdUI) on a derived class from CXTPDockingPaneManager and the messages are now routed correctly.

Thanks
 
Anton



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