Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - CCmdUI Dialog Panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CCmdUI Dialog Panes

 Post Reply Post Reply
Author
Message
asparagusx View Drop Down
Groupie
Groupie


Joined: 06 February 2007
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote asparagusx Quote  Post ReplyReply Direct Link To This Post Topic: CCmdUI Dialog Panes
    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
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
asparagusx View Drop Down
Groupie
Groupie


Joined: 06 February 2007
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote asparagusx Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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/


Back to Top
asparagusx View Drop Down
Groupie
Groupie


Joined: 06 February 2007
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote asparagusx Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2007 at 2:15pm
Hello,

so try to add that handling into CXTPDockingPane::OnIdleUpdate().
Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
asparagusx View Drop Down
Groupie
Groupie


Joined: 06 February 2007
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote asparagusx Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
akur View Drop Down
Senior Member
Senior Member


Joined: 16 May 2006
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote akur Quote  Post ReplyReply Direct Link To This Post 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().
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
asparagusx View Drop Down
Groupie
Groupie


Joined: 06 February 2007
Status: Offline
Points: 53
Post Options Post Options   Thanks (0) Thanks(0)   Quote asparagusx Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.191 seconds.