|  | 
| CCmdUI Dialog Panes | 
| Post Reply   | 
| Author | |
| asparagusx   Groupie   Joined: 06 February 2007 Status: Offline Points: 57 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| akur   Senior Member   Joined: 16 May 2006 Status: Offline Points: 139 |  Post Options  Thanks(0)  Quote  Reply  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? | |
|  | |
| asparagusx   Groupie   Joined: 06 February 2007 Status: Offline Points: 57 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| akur   Senior Member   Joined: 16 May 2006 Status: Offline Points: 139 |  Post Options  Thanks(0)  Quote  Reply  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/ | |
|  | |
| asparagusx   Groupie   Joined: 06 February 2007 Status: Offline Points: 57 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| akur   Senior Member   Joined: 16 May 2006 Status: Offline Points: 139 |  Post Options  Thanks(0)  Quote  Reply  Posted: 19 February 2007 at 2:15pm | 
| 
   Hello, so try to add that handling into CXTPDockingPane::OnIdleUpdate(). | |
|  | |
| akur   Senior Member   Joined: 16 May 2006 Status: Offline Points: 139 |  Post Options  Thanks(0)  Quote  Reply  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.
    | |
|  | |
| asparagusx   Groupie   Joined: 06 February 2007 Status: Offline Points: 57 |  Post Options  Thanks(0)  Quote  Reply  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 
 | |
|  | |
| akur   Senior Member   Joined: 16 May 2006 Status: Offline Points: 139 |  Post Options  Thanks(0)  Quote  Reply  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().
    | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| asparagusx   Groupie   Joined: 06 February 2007 Status: Offline Points: 57 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| 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 |