Print Page | Close Window

Dialog changes with the pane changing

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=18113
Printed Date: 04 May 2024 at 5:16am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dialog changes with the pane changing
Posted By: eousi
Subject: Dialog changes with the pane changing
Date 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!



Replies:
Posted By: Oleg
Date 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


Posted By: eousi
Date 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.


Posted By: eousi
Date 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;
}


Posted By: eousi
Date 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?


Posted By: eousi
Date Posted: 30 March 2011 at 9:34am

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




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