Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Dialog changes with the pane changing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dialog changes with the pane changing

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


Joined: 25 March 2010
Location: China
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eousi Quote  Post ReplyReply Direct Link To This Post Topic: Dialog changes with the pane changing
    Posted: 24 March 2011 at 4:18am
Hi,I made a docking pane in a MDI application and attached a dialog on it.But now I want to change the size of the pane and make the dialog change with the pane.How to solve this problem? Thanks!
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: 25 March 2011 at 6:13am
Hi,

When you move pane, dialog should change its size automatically. if you need change layout of controls inside this dialog you can use our СXTPResizeDialog class.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
eousi View Drop Down
Groupie
Groupie


Joined: 25 March 2010
Location: China
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eousi Quote  Post ReplyReply Direct Link To This Post Posted: 25 March 2011 at 8:48pm
Hi,thank you for your reply,Oleg.But my question is how I can make the dialog change the size automatically when I move pane.
Back to Top
eousi View Drop Down
Groupie
Groupie


Joined: 25 March 2010
Location: China
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eousi Quote  Post ReplyReply Direct Link To This Post Posted: 29 March 2011 at 9:53pm
After two days learning,I solved this problem.LOL
I think we should use OnDockingPaneNotify message handling function.The code is below.
If you have better method or I have made some mistakes,please tell me,thank you!
LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)
{
  if (wParam == XTP_DPN_ACTION)
 {
   XTP_DOCKINGPANE_ACTION * pAction = (XTP_DOCKINGPANE_ACTION*)lParam;
   if (pAction->action==xtpPaneActionSplitterResized)  //Judge if the size of DockingPane is changed
  {
    CRect rcPane;   
    //Get the pane's ID and judge if it is what I want
    if (IDR_PANE==(pAction->pPane)->GetID())    
   {
     //Get the size of this pane,m_pPane is a pointer of pane
     rcPane=m_pPane->GetPaneWindowRect();      
     //make the dialog have the same size of pane
     m_pDlg->SetWindowPos(NULL, 0, 0, rcPane.Width(), rcPane.Height(), SWP_NOZORDER); 
   }   
  }
  return TRUE;
 }
 return FALSE;
}
Back to Top
eousi View Drop Down
Groupie
Groupie


Joined: 25 March 2010
Location: China
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eousi Quote  Post ReplyReply Direct Link To This Post Posted: 29 March 2011 at 11:47pm
But I still have a problem.When the pane is docked,I change the size of pane and the dialog is not at its proper place,it moves a little top and a little left.How can I solve this problem?
Back to Top
eousi View Drop Down
Groupie
Groupie


Joined: 25 March 2010
Location: China
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote eousi Quote  Post ReplyReply Direct Link To This Post Posted: 30 March 2011 at 9:34am

Oh,yes,it really changes automatically,it seems my code is useless.

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.188 seconds.