![]() |
Dialog changes with the pane changing |
Post Reply ![]() |
Author | |
eousi ![]() Groupie ![]() Joined: 25 March 2010 Location: China Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() 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!
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
eousi ![]() Groupie ![]() Joined: 25 March 2010 Location: China Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
eousi ![]() Groupie ![]() Joined: 25 March 2010 Location: China Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
After two days learning,I solved this problem.
![]() 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; } |
|
![]() |
|
eousi ![]() Groupie ![]() Joined: 25 March 2010 Location: China Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
eousi ![]() Groupie ![]() Joined: 25 March 2010 Location: China Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
Oh,yes,it really changes automatically,it seems my code is useless. |
|
![]() |
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 |