Last month, I wrote an article about improved windows Separation Control for wtl. This article supplements and improves this article.
In the article Improving the separation window control of wtl, we modified the csplitterwindow of wtl to implement the following changes. That is, the two subpanel windows of the separation window can be the controls in the dialog box window, you do not need to set the parent windows of the two controls as separate windows. However, we find that if you use the cpanecontainer control or the sub-dialog window as the sub-panel, you must set the parent window as the separation window in the cpanecontainer or dialog window. Modify the code of the separation window to improve this. After modification, the parent window of the cpanecontainer control or subdialog box window is the Child Window of the dialog box where the separation window is located. The Code is as follows:
Void updatesplitterlayout ()
...{
If (m_nsingtransferane = split_pane_none & m_xysplitterpos =-1)
Return;
T * PT = static_cast <t *> (this );
Rect =... {0, 0, 0, 0 };
If (m_nsingpolicane = split_pane_none)
...{
If (getsplitterbarrect (& rect ))
Pt-> invalidaterect (& rect );
For (INT npane = 0; npane <m_npanescount; npane ++)
...{
If (getsplitterpanerect (npane, & rect ))
...{
If (m_hwndpane [npane]! = NULL)
...{
DWORD dwflag = swp_nozorder;
Hwnd hwndparent =: getparent (m_hwndpane [npane]);
If (hwndparent! = Pt-> m_hwnd)
...{
Dwflag = 0;
Pt-> clienttoscreen (& rect );
Cwindow (hwndparent). screentoclient (& rect );
}
: Setwindowpos (m_hwndpane [npane], null, rect. Left, rect. Top, rect. Right-rect. Left, rect. Bottom-rect. Top, dwflag );
}
Else
Pt-> invalidaterect (& rect );
}
}
}
Else
...{
If (getsplitterpanerect (m_nsinglepane, & rect ))
...{
If (m_hwndpane [m_nsingtransferane]! = NULL)
...{
DWORD dwflag = swp_nozorder;
Hwnd hwndparent =: getparent (m_hwndpane [m_nsingpolicane]);
If (hwndparent! = Pt-> m_hwnd)
...{
Dwflag = 0;
Pt-> clienttoscreen (& rect );
Cwindow (hwndparent). screentoclient (& rect );
}
: Setwindowpos (m_hwndpane [m_nsinglepane], null, rect. Left, rect. Top, rect. Right-rect. Left, rect. Bottom-rect. Top, dwflag );
}
Else
Pt-> invalidaterect (& rect );
}
}
}